Mike Yearwood
Toronto, Ontario, Canada
General information
Category:
Coding, syntax & commands
>I have a string like "one, two, three" and I need it to be in the order "three, two, one".
>
>Does anybody have an efficient algorithm to do this?
LPARAMETERS tcText
LOCAL lnLines,lcText,x
LOCAL ARRAY laLines[1]
lnLines=ALINES(laLines,m.tcText,1,",")
lcText = laLines[m.lnLines]
FOR x = lnLines-1 TO 1 STEP -1
lcText = m.lcText + "," + laLines[m.x]
ENDFOR x
RETURN m.lcText
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only