Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Detecting other software...
Message
From
16/01/2004 16:50:39
 
 
To
16/01/2004 16:44:24
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00867610
Message ID:
00867684
Views:
33
>P.S. An unrelated q. Is there an easy way to invert a char. string? i.e. 'ABCD' to 'DCBA'.

does this work for you? (needs foxtools.fll loaded)
clear

?ReverseStr("Gunnar", 1)

FUNC ReverseStr
	PARA;
		StrToReverse;
		StrDelimiter
	LOCAL ;
		NewString, ;
		i

	NewString = ""
	IF TYPE("StrDelimiter") = "N"
		FOR i=1 TO LEN(StrToReverse) STEP StrDelimiter
			NewString = SUBS(StrToReverse, i, StrDelimiter) + NewString
		ENDFOR
	ELSE
		FOR i=1 TO words(StrToReverse, StrDelimiter)
			NewString = ALLT(wordnum(StrToReverse, i, StrDelimiter)) + NewString
		ENDFOR
		NewString = STRTRAN(NewString, StrDelimiter, "")
	ENDIF
	RETURN(NewString)
ENDFUNC
Previous
Reply
Map
View

Click here to load this message in the networking platform