Indigo Rose Software

Professional Software Development Tools

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

    Star Question about ListBox and Data (delimited List)

    its me again
    in AMS4 i used several listboxes to store information or make file listings with some data assignet to them. most times i had multiple things as data in a delimited list (var1;;var2;;var3) but in AMS5 there are no del. lists? now there are tables?

    but how can I "add" an table as data to a listbox entry or put the data in a table? it seems it was easier in AMS4 :confused:

    i found the Table.Concat feature which returns a delimited list but if i have a del. list as data of a listbox object, how can i put it into an table? :confused:

    hope someone knows how to do it.

  2. #2
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    There is a script in AMS 5 that will parse a delimited list. Look at the scriplets in your Gallery.

  3. #3
    Join Date
    Dec 2003
    Posts
    163
    ah, thank you!
    just took a look at it. i think it will take a while to understand how it works.

    but there is one last thing i want to ask.
    at the end of the file there is some code to "Purpose: Makes a table into a delimited string" but isnt that what Table.Concat does? :confused:

  4. #4
    Join Date
    Sep 2002
    Location
    Sol 3
    Posts
    3,160
    Yes, there are actually two functions in that scriplet, one takes a delimited string to a table and the other from a table to a delimited string. The second is not necessary since there is the Table.Concat function. This could have been created before that Action existed, maybe?

  5. #5
    Join Date
    Dec 2003
    Posts
    163
    could be
    i know how it works now

    but i encountered another issue :(
    i have a "mini browser" with favorites. its a listbox where name and url (as data) is saved. i save it to a .ini file and read it on startup but i cant figure out yet why i have to incese the tablecount by 1.
    here what i wrote.

    PHP Code:
    on Startup:
    tblFavorites INIFile.GetValueNames(_SourceFolder.."\\Settings.ini""Favorites");
    tblFavoritesCount Table.Count(tblFavorites);

    on Page Preload:
    FavoritesCounter 1;
    repeat
        FavName 
    tblFavorites[FavoritesCounter]; -- i couldnt use tblFavorites[FavoritesCounterin the next line in a ini.getvalue commandgot error that it must be a string
        FavURL 
    INIFile.GetValue(_SourceFolder.."\\settings.ini""Favorites"FavName);
        
    ListBox.AddItem("Favorites"FavNameFavURL);
        
    FavoritesCounter FavoritesCounter 1;
    until FavoritesCounter == tblFavoritesCount 
    in the last line i added +1 at the end. if i dont do this i get an error if there is only 1 entry in the favorites secton of the ini and if there are more the last entry in the ini is not read and displayed in the listbox. but why? the count of the table starts at 1 and the counter starts at 1 too :confused: :confused: :confused:

    btw: if i use while it doesnt work either.


    ---------------------------------

    another thing i have noticed: set ini value does not recognize the difference between "test" and "TEST".

    take a look at this:

    PHP Code:
    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
        
    ListBox.AddItem("Favorites"CurrentURLNameCurrentURL);
        
    INIFile.SetValue(_SourceFolder.."\\Settings.ini""Favorites"CurrentURLNameCurrentURL);
    end 
    it successfully adds the new entry "TEST" to the list (if you enter TEST into the dialog box) but in the settings.ini the entry "test" will be overwritten.
    is this a known issue? :confused:
    Last edited by SonG0han; 12-16-2003 at 11:05 AM.

  6. #6
    Join Date
    Dec 2003
    Posts
    163
    will this be fixed in the next version and can anyone answer my question above pls?

  7. #7
    Join Date
    Oct 2003
    Posts
    908
    INI files are not case sensitive.

  8. #8
    Join Date
    Dec 2003
    Posts
    163

    Huh?

    so you won't/can't change this in 5.0.0.3, right? :(

    hmm ok. seems I have to change it and compare existing entries with the entry that will be added, saw something like that in the helpfile. thx for response.

  9. #9
    Join Date
    Oct 2003
    Posts
    908
    That's just the way INI files are and the way the Windows API has been written since Windows 3.0. We really can't do anything about that.

  10. #10
    Join Date
    Dec 2003
    Posts
    163
    ok, thanks

Posting Permissions

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