Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Programmatically removing zero's
Message
From
13/06/2005 12:05:38
Dragan Nedeljkovich
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP1
Network:
Windows 2000 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01022697
Message ID:
01022790
Views:
16
>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.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform