Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Pickup first characters in a string
Message
 
 
À
24/08/2002 22:41:29
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00692996
Message ID:
00693417
Vues:
22
Dragan,

Great solution! Although you need to add an IsLower() test to the construction of the string. The code below would actually cause the chrtran() to remove all the letters.

>Actually, I'd rather make this a class, and build such a string like this, in its .init:
>
>
this.lcChars=""
>for i=32 to 255
>   lcChr=chr(i)
>   if isalpha(lcChr)
>      this.lcChars=this.lcChars+lcChr
>   endif
>endfor
>
>I've found IsAlpha() function to be correct for codepages I used so far; having this run only once would make the speed a non-issue, and then the chrtran() would be language correct as well. And we wouldn't have to do anything to do to the app if it's moved to another language, as this would respect the local ANSI codepage setting.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform