Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
The other way around
Message
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00385262
Message ID:
00385275
Views:
10
Hi George,
>>
>
>>PROCEDURE ReverseIt
>> PARA cText
>> cReversed=""
>> FOR I = LEN(cText) TO 1 STEP -1
>> cReversed=cReversed+SUBS(cText,i,1)
>> ENDFOR
>> RETURN cReversed
>>ENDPROC
>Or..
FUNCTION ReverseIt
>  LPARAMETER cText
>
>  LOCAL lcresult, lni, lnlast
>  lnlast = LEN(cText)
>  lcresult = ""
>  FOR lni = 1 TO lnlast
>   lcresult = SUBSTR(cText, lni, 1) + lcresult
>  NEXT
>  RETURN lcresult
>ENDFUNC
From Steve Black's "Text" session at DevConnections, John's would be more efficient. Some VFP optimization on StrVar = StrVar + ...
Bill Armbrecht
VFP MCP
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform