|
-
Nov 15th, 1999, 12:33 PM
#1
Thread Starter
New Member
Hi guys,
I'm (unsucessfully) trying to create and populate a 2 dinensional array to store distances between two places.
I am then trying to use two list boxes to choose the start and end point of the journey. I cannot seem to get the listindex property to find the appropiate distance in the array. If anyone out there could help .....I would really appreciate it.
Cheers
Steven
-
Nov 15th, 1999, 01:16 PM
#2
Lively Member
almost sounds similar to a problem i had two days ago
go back to page three of the topic list
look for a topic aaron young Recombolistindex
Topic Starter Jessie
Posted 11-14-1999 09:44pm
read both parts of the subject i not sure this will help but you never know it worked for me
-
Nov 15th, 1999, 02:27 PM
#3
Thread Starter
New Member
Jessie,
Thanks for the help, I am currently looking at the info.
Cheers
-
Nov 15th, 1999, 06:59 PM
#4
Are you trying to populate the array from 2 listboxes? Or you're trying to read the values from the array?
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Nov 16th, 1999, 05:48 AM
#5
Thread Starter
New Member
Serge,
I'm trying to read my values from the array so that in list1/cbo1 there is alreay entires like London and list2/cbo2 will contain destination eg Paris, and the distance between the two (already loaded by the program in the array) will be displayed.
Cheers
-
Nov 16th, 1999, 09:31 AM
#6
How do you have those values in the array (i.e. do you have them as string like "London", Paris" etc)??? or do you actually save the position (ListIndex) of the item?
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
-
Nov 16th, 1999, 10:34 AM
#7
Thread Starter
New Member
Serge,
I'm trying to save the position (lstIndex) of the item
-
Nov 16th, 1999, 07:03 PM
#8
So my guess, you save those indexes like this arrYourArray(0,0) would have value lets say 1 (London in first Listbox), but what's the value for the second Listbox arrMyArray(0,1)?
I think in this situation you better create a User Defined Datatype:
Code:
Private Type utTravel
iStart As Integer
iDestination As Integer
End Type
'----Then here you would declare your array of this user defined type:
Private tTravel(5) As utTravel
'-----Then lets say you want to select items in the Listboxes for the array element 2
List1.ListIndex = tTravel(2).iStart
List2.ListIndex = tTravel(2).iDestination
Whew, I hope I didn't confuse you that much.
Regards,
------------------
Serge
Software Developer
[email protected]
[email protected]
ICQ#: 51055819
[This message has been edited by Serge (edited 11-17-1999).]
-
Nov 18th, 1999, 03:28 AM
#9
New Member
One thing that always gets me when I use ListBoxes and ComboBoxes with arrays is that I forget that ListBoxes are always zero-based while arrays do not have to be.
-
Nov 18th, 1999, 12:40 PM
#10
Thread Starter
New Member
Super,I'll give it a try, cheers mate
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|