Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Programmatically removing zero's
Message
De
13/06/2005 15:07:10
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Divers
Thread ID:
01022697
Message ID:
01022877
Vues:
13
>>>What if the field begins with letter ;o)
>>
>>In that case (and in case of padding with any other character)... suppose we have a field padded with a dollar sign:
>>
>>
>>cValue="$$$$$$$22341"
>>c="$"
>>*-- starts here
>>cValue=" "+cValue
>>do while " "+c
>>   cValue=strtran(cValue, " "+c, " ")
>>enddo
>>cValue=substr(cValue,2)
>>
>>This trick to add a space in front (or any other character for that matter - chr(255) would be my choice if the first character that's supposed to remain may be a space) was just to make sure we don't erase any "$" inside the string.
>>
>>Maybe not too elegant - this is what I did back in FP 1.02 :). But it worked.
>
>-----------------------------------------
>
>Dragan I don't understand this line:
>
do while " "+c   && " "+c  isn't condition
>
Ooops... should be do while " "+c $ cValue.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform