Option_Explicit
11-12-2003, 07:36 PM
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.
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.