Indigo Rose Software

Professional Software Development Tools

 
Results 1 to 4 of 4
  1. #1
    Join Date
    Oct 2002
    Posts
    54

    Listbox & Global List Madness

    Ok what I'm doing is creating a text file with a list of web addresses and and Desriptions for each address. - ie: "AMS Support;;http://www.indigorose.com/forums"
    so I'm using this to read the text file then seperate the descriptions to a listbox, and the web addresses to a Global list.

    ListBoxObject[AListBox].Remove (All)
    %URLFileL% = TextFile.CountLines ("%SrcDir%\List\url.txt")
    %URLVar% = "0"
    WHILE (%URLVar% < %URLFileL%)
    %TextLine% = TextFile.GetLine ("%SrcDir%\List\url.txt", %URLVar%)
    %URLText% = String.GetDelimitedString ("%TextLine%", ";;", 0)
    ListBoxObject[AListBox].Add (End, "%URLText%")
    %URLText% = String.GetDelimitedString ("%TextLine%", ";;", 1)
    GlobalList[URLGlobalList].Add (End, "%URLText%")
    %URLVar% = Evaluate (%URLVar% + 1)
    END WHILE

    Now as long as I add the items to the end of each Listbox/Global list, the index numbers should be the same for each, so when I call up from listbox index 4 the corrosponding index 4 in the global list will be the correct address for the listed description..

    ie:
    %SelectedIndex% = ListBoxObject[AListBox].GetSelected
    IF (%SelectedIndex% = 0)
    %ListItem% = GlobalList[URLGlobalList].GetItem (0)
    File.Open (open, "%ListItem%")
    END IF


    I can't find a condition to verify that the I am getting the correct web address for the listbox selection I make.
    Am I out to lunch on this?
    BTW: I need to use a textfile, so users can edit their own list of Urls to keep, without keeping all this within the .exe file.

  2. #2
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    I can't find a condition to verify that the I am getting the correct web address for the listbox selection I make.
    Am I out to lunch on this?
    Message dialogs can be inserted anywhere in your code to test values at runtime, i.e. when you click the listbox a message dialog can display the value for you.

    Other than that I didn't really see a specific question in your post, hope that helps...

    Corey Milner
    Creative Director, Indigo Rose Software

  3. #3
    Join Date
    Oct 2002
    Posts
    54
    well corey, I did this for the listbox

    %SelectedIndex% = ListBoxObject[AListBox].GetSelected
    IF (%SelectedIndex% = %SelectedIndex%)
    %ListItem% = GlobalList[URLGlobalList].GetItem (%SelectedIndex%)
    File.Open (open, "%ListItem%")
    END IF

    and it seems to work,

    What the question was, I wasn't sure if adding items to the global list would keep the same index numbers as the listbox items reliably.
    When i %SelectedIndex% = 6, then %ListItem% = 6 better have the correct data.
    this code did make sense as to what I'm trying to accomplish?

    anyway, all seems to work

  4. #4
    Corey is offline Indigo Rose Staff Alumni
    Join Date
    Aug 2002
    Posts
    9,746
    Cool.

    Corey Milner
    Creative Director, Indigo Rose Software

Posting Permissions

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