Question:
how to sort alphabetical array string in vb6?
ketusoni007
2011-11-21 08:38:56 UTC
hi im ketan soni, im new to vb6 please help me for this
i store list of name in array string and i want to display them in alphabetical order in lable caption
Thanks in advance
Three answers:
2011-11-21 09:50:18 UTC
it simple in vb6 than other languages like C



you can just compare by using if and relational operators

for example



first of all you sort the string(i use 2D string of 10 element)

for i=0 to 10

for j=i+1 to 10

if str(j)>str(i) then

tempstr=str(i)

str(i)=str(j)

str(j)=tempstr

end if

next j

next i



after this you can display it on label caption



for i=0 to 10

label1.caption = label1.caption & str(i) & chr(13)

next i
?
2016-10-29 08:10:52 UTC
Vb6 String Array
AJ
2011-11-21 08:43:13 UTC
Stop trying to use VB6. It is an obsolete VB edition. No one supports VB6 anymore.



You need to learn to program using VB 2010.



Then you can use things like ListOf(type) and query against it using LINQ.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...