Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 11 of 11
  1. #1
    Join Date
    Dec 2003
    Posts
    163

    Arrow Bugs, Errors, Questions and all the other stuff

    hi AMS5 Team!
    I have noticed some things I want to tell you. I dont know if they are already known or not, pls take a look at it.

    i put everything from bugs, errors and Questions in here to keep the forums ordered. I think it doesnt look "so good" if there are 20 threads from the same user and everyone has only a minor question in it, right? :

    here we go...

    1. if i enter text in an input field (not in ams runtime, in designtime) they get screwed up. text is mixed and its just crappy black text you cant read. maybe there is a way to fix it?

    2. if I use a web object and put the url in an input field (like in the template browser) you get the URLs of iFrames in the inputfield. is there a way to disable this or does a workaround exist?

    3. if I execute a link which opens a new window in a web-object with javascript nothing happen

    4. it seems the + key is not recognized by AMS5. the following code example should do something if you hit the + key but nothing happens. if i use other keys it works.

    if (e_Key == 43) then
    ----ACTION HERE
    end


    5. Just added some bookmarks to my global functions but if i leave the codeeditor and come back all bookmarks are gone. tried it several times. can you confirm this?

    thats all. Thank you for your time and patience.

  2. #2
    Join Date
    Feb 2001
    Location
    Indigo Rose Software
    Posts
    2,728
    In answer to 4:

    The virtual key code for the + key on the numeric keypad is 107.

    The code for the + key on the main part of the keyboard is actually a shifted =, so in other words it's 187 when the shift key is held down.

  3. #3
    Join Date
    Dec 2003
    Posts
    163
    oh, forgot that with the shifted = on english keyboards!
    i have a + key on my german keyboard, with shift I get a * and with altGr i get ~. i tried this +-key and the one on the numpad and thought that is the + (ASCII 43 in the table in helpfile)

    shift + = on my keyboard is an question mark (?). i try if 187 is the +-key on my keyboard tomorrow, time for bed now

    Thank you very much!!

  4. #4
    Join Date
    Dec 2003
    Posts
    163

    Star PLEASE help!

    hi!
    I hope someone can help me, i have a problem with the following code:

    PHP Code:
    -- DATEN-Datei einlesen (Section Names)
            -- 
    ALTDATA TextFile.ReadToString(_SourceFolder.."\\DATA.ini");
    -- 
    Tabelle Leeren
    DATA_Sections 
    = {};

    DATA_Sections INIFile.GetSectionNames(_SourceFolder.."\\DATA.ini");
    -- 
    Namen der neuen Kategorie abfragen
    NewCatName 
    Dialog.Input("Enter name of new Category""Category Name:"""MB_ICONQUESTION);
    -- 
    Prüfen ob die Kategorie schon existiert
    -- (Suche in strDATA siehe oben)
            -- 
    ALTSearchResult String.Find(DATANewCatName1false);
    strDATA_Sections "";
    strDATA_Sections Table.Concat(DATA_Sections";"1TABLE_ALL);
        
    Dialog.Message("DEBUG""Daten: "..strDATA_Sections);
    CatSearchResult String.Find(strDATA_SectionsNewCatName1false);
        
    Dialog.Message("DEBUG""Daten: "..CatSearchResult);
    -- 
    Wenn Sie noch nicht existiert am Ende des Files anhängen
    if (CatSearchResult == -1then
        string 
    "\r \r["..NewCatName.."]\r"
        
    Dialog.Message("DEBUG""Daten: "..string);
        
    TextFile.WriteFromString(_SourceFolder.."\\DATA.ini"stringtrue);
        
    Dialog.Message("DEBUG""Daten: ".."INI geändert!");
    else
        
    result Dialog.Message("Error""This Category Name does already exist!"MB_OKMB_ICONEXCLAMATIONMB_DEFBUTTON1);
    end 
    it creates a new section in an ini file if it does not already exist (sad that ther is no actoin for that in the INI section)
    the first time it works but if i push the button a 2nd time i get this error message

    attempt to index a string value
    but why? i tried to empty the table and the variables but it did not change anything :(


    btw: if i add \n or \r to a string i dont have a new line in the textfiles i write. how can i add a new line with the write textfile command?

    hope someone knows the answer, thx in advance!

  5. #5
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312
    Hi,

    try the following code.
    I didn't find out why your problem exists but I know a solution for you.

    PHP Code:
    DATA_Sections INIFile.GetSectionNames(_SourceFolder.."\\DATA.ini"); 
    -- 
    Namen der neuen Kategorie abfragen 
    NewCatName 
    Dialog.Input("Enter name of new Category""Category Name:"""MB_ICONQUESTION); 
    -- 
    Prüfen ob die Kategorie schon existiert 
    CatSearchResult
    false;
    for 
    count in DATA_Sections do
      if (
    DATA_Sections[count]==NewCatNamethen
        CatSearchResult 
    true
      
    else
        
    CatSearchResult false
      end
    end
    if (CatSearchResult == falsethen 
        string 
    "\["..NewCatName.."\]";
        
    TextFile.WriteFromString(_SourceFolder.."\\DATA.ini""\r\n"true); 
        
    TextFile.WriteFromString(_SourceFolder.."\\DATA.ini"stringtrue); 
    else 
        
    result Dialog.Message("Error""This Category Name does already exist!"MB_OKMB_ICONEXCLAMATIONMB_DEFBUTTON1); 
    end 

    Greatings from Salzburg/Austria
    Stefan

  6. #6
    Join Date
    Dec 2003
    Posts
    163
    thanks, i will try that!
    i already thought about using the "for x in table do" method but i thought it would be easier to make a delimited string out of the table, its less to code

    but why does it not work with a del. list of the tablecontents? anyone knows? :confused:

  7. #7
    Join Date
    Dec 2003
    Posts
    163
    hello again.
    i didnt test it in the app where i needed the code yet but i used it in another project and think i found a little "error" in it.

    PHP Code:
    for count in DATA_Sections do 
      if (
    DATA_Sections[count]==NewCatNamethen 
        CatSearchResult 
    true 
      
    else 
        
    CatSearchResult false 
      end 
    end 
    could it be that this doesnt work?
    for every entry the code between do and end is evulated, right? so if its true at the first entry it will get false if it reaches the last? -> so everytime only the last entry counts - right or not? :confused:

    Below you find the code of my "Add to Favorites" function. it adds an entry to a INI file and checks if it is already present. i used BREAK to exit if the result is TRUE - its true when it is already in the file and then it should not add it again.

    if you have some time I would be very happy about suggestions or tips to improve the code but as far as I can see it works.

    PHP Code:
    -- AddToFavorites Function
    function 
    AddToFavorites()
        
    CurrentURL Web.GetURL("Browser");
        
    CurrentURLName Dialog.Input("Enter the name for your new Favorites entry""Name of current Page:"""MB_ICONQUESTION);
        if (
    CurrentURLName == "") or (CurrentURLName == "CANCEL"then
            Dialog
    .Message("Error""You must enter a name for the new entry."MB_OKMB_ICONEXCLAMATIONMB_DEFBUTTON1);
        else
            -- 
    Prüfen ob der Name schon in der INI vorhanden ist! (groß-/klein muß egal sein!)
            --> 
    INI einlesen und nach dem neuen Eintrag suchen:
            
    tblFavoritesNames = {};
            
    tblFavoritesNamesCount Table.Count(tblFavoritesNames);
            if 
    tblFavoritesNamesCount 0 then
                Count 
    1;
                while 
    Count <= tblFavoritesNamesCount do
                    
    Table.Remove(tblFavoritesNamesCount);
                    
    Count Count 1
                end
            end
            tblFavoritesNames 
    INIFile.GetValueNames(_SourceFolder.."\\Settings.ini""Favorites");
            
            
    SearchResult false
            for 
    count in tblFavoritesNames do
                  if (
    String.Lower(tblFavoritesNames[count]) == String.Lower(CurrentURLName)) then
                    SearchResult 
    true
                    
    break
                  else
                    
    SearchResult false
                  end
            end 
            
    if (SearchResult == falsethen  
                ListBox
    .AddItem("Favorites"CurrentURLNameCurrentURL);
                
    INIFile.SetValue(_SourceFolder.."\\Settings.ini""Favorites"CurrentURLNameCurrentURL);
            else  
                
    Dialog.Message("Error""An entry with this name does alredy exist!\nPlease chose another name."MB_OKMB_ICONEXCLAMATIONMB_DEFBUTTON1);
            
    end
        end
    end 
    NOTE: if I dont delete the tableentries it doesnt seem to work. so you have to delete the table entries every time?

    bye *waves*

  8. #8
    Join Date
    Dec 2003
    Posts
    163

    Huh? err, its broken

    hmm i got some errors if there are no entries and I tried to prevent this and added some new lines of code but now it lets me only add 1 entry if the favorites section in the ini is empty.

    i dont get any error messages. I try to find the problem but I hope someone can help me and give me a tip


    new code (i belive it could be much better)
    PHP Code:
    -- AddToFavorites Function
    function 
    AddToFavorites()
        
    CurrentURL Web.GetURL("Browser");
        
    CurrentURLName Dialog.Input("Enter the name for your new Favorites entry""Name of current Page:"""MB_ICONQUESTION);
        if (
    CurrentURLName == "") or (CurrentURLName == "CANCEL"then
            Dialog
    .Message("Error""You must enter a name for the new entry."MB_OKMB_ICONEXCLAMATIONMB_DEFBUTTON1);
        else
            -- 
    Prüfen ob der Name schon in der INI vorhanden ist! (groß-/klein muß egal sein!)
            --> 
    INI einlesen und nach dem neuen Eintrag suchen:
            
    tblFavoritesNames = {};
            
    tblFavoritesNamesCount 0;
            
    tblFavoritesNamesCount Table.Count(tblFavoritesNames);
            if 
    tblFavoritesNamesCount 0 then
                Count 
    1;
                while 
    Count <= tblFavoritesNamesCount do
                    
    Table.Remove(tblFavoritesNamesCount);
                    
    Count Count 1
                end
            end
            tblFavoritesNames 
    INIFile.GetValueNames(_SourceFolder.."\\Settings.ini""Favorites");
            
            
    SearchResult false

    if (
    tblFavoritesNames == nilthen
        tblFavoritesNames 
    = {};
    end
            tblFavoritesNamesCount 
    0;
            
    tblFavoritesNamesCount Table.Count(tblFavoritesNames);

    if (
    tblFavoritesNamesCount ~= 0then
            
    for count in tblFavoritesNames do
                  if (
    String.Lower(tblFavoritesNames[count]) == String.Lower(CurrentURLName)) then
                    SearchResult 
    true
                    
    break
                  else
                    
    SearchResult false
                  end
            end 
    else
        if (
    SearchResult == falsethen  
            ListBox
    .AddItem("Favorites"CurrentURLNameCurrentURL);
            
    INIFile.SetValue(_SourceFolder.."\\Settings.ini""Favorites"CurrentURLNameCurrentURL);
        else  
            
    Dialog.Message("Error""An entry with this name does alredy exist!\nPlease chose another name."MB_OKMB_ICONEXCLAMATIONMB_DEFBUTTON1);
        
    end
    end

        end
    end 

  9. #9
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312
    Hi,

    I didn't test it so there was an error.

    PHP Code:
    for count in DATA_Sections do  
      if (
    DATA_Sections[count]==NewCatNamethen  
        CatSearchResult 
    true  
      
    else  
        
    CatSearchResult false  
      end  
    end 
    Change it to
    PHP Code:
    CatSearchResult false;
    for 
    count in DATA_Sections do  
      if (
    DATA_Sections[count]==NewCatNamethen  
        CatSearchResult 
    true;
      
    end  
    end 
    you do not need the "else" part

    Stefan

  10. #10
    Join Date
    Dec 2003
    Posts
    163
    thanks

    any other suggestions for the code above? :

  11. #11
    Join Date
    Nov 2003
    Location
    Salzburg / Austria
    Posts
    312
    Hi SonG0han,

    try the following solution.

    Stefan
    Attached Files

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts