Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
The other way around
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00385262
Message ID:
00385275
Vues:
11
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
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform