Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.
VB Array Problem
Name: quanta15 Date: March 28, 2003 at 08:37:45 Pacific OS: NA CPU/Ram: NA
Comment:
Does anyone know an efficient way to take out duplicate values in an array? I have a web page that queries a dtabase and get a long list of keywords to display in a . I don't want any duplicates, so maybe someone can help me out?
Name: Elric Date: March 29, 2003 at 03:09:14 Pacific
Reply:
G'day
Try using a modified bubble sort (plenty of examples in this forum recently). Instead of doing the if n[j]]n[j+1]then swap
replace with if n[j]=n[j+1] then do nothing else n[j]=n[j+1]
You might have to fiddle with it a bit, but it should work (good idea to sort then too) regards, Elric
0
Response Number 2
Name: elric Date: March 29, 2003 at 03:14:50 Pacific
Reply:
G'day,
I'm sorry about that: greater than doesn't work, so I use square bracket instead- now that doesn't work --- any ideas???????????
that first line should have read:
if n[j] is greater than n[j+1] then swap
those square brackets worked but the gtr than square bracket didn't??????????? hope I haven't confused you too much... regards, Elric
0
Response Number 3
Name: elric Date: March 29, 2003 at 03:17:36 Pacific
Reply:
G'day,
OOps!!!!!! It did - my spacing I think. Time to get my eyes tested I think. Just ignore my rambling.. regards, Elric
0
Response Number 4
Name: rasdub Date: April 2, 2003 at 05:47:19 Pacific
Reply:
Why not clean the process at the beginning of the task? When you query the database, just use the DISTINCT keyword in your query (i.e., SELECT DISTINCT(LastName) FROM Employees). Then you will only get one occurrence of each returned value. Make sense?
Summary: I am new to Vb and trying to create an array to hold 10000 numbers. I must use a random number generator to load the array with alues. Display the first 100 values unsorted, sort the array, and then d...
Summary: correction, instead of: $symbolfile = array("data/symbols.dat"); I'm using: $symbolfile = file("data/symbols.dat"); Although, if I echo it out, it appears to work ok. It must be a problem with anothe...
Summary: I have a problem, i have a program where i enter 10 values into a 1d array, eg: 2,33,55,11,99,101,3,7,66,654. I NEED TO ASSIGN A RANK TO EACH OF THESE VALUES, STARTING WITH 1 FOR LARGEST DOWN TO 10 FO...