Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Padding with
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01116422
Message ID:
01116432
Views:
18
>>Help me out here, guys. My brain's turned to mush.
>>
>>- I'm importing an XLS -> dbf
>>- a numeric val from the XLS becomes a string val in the dbf
>>- I need to express this as a 4-char field, right justified and prefilled with "0"s
>>
>>So 13 -> "13" and I need "0013"
>>
>>I can't seem to get it right, using different permutations of STR( X, 4) and PADL( X, 4, "0").
>>
>>I either end up with "" or "13"
>>
>>Any quick ideas before I go home?
>>
>>'ppreciate it
>>
>>Incidentally, I'm adding to this old FPD 2.6 system. But I'm testing the module in VFP7 where I can work more quickly. When I import in 7, the num field becomes a num, which I have to STR(). When I compile and link in FPD, and run the exe, I get a mismatched var error, cos the num field has become a char, and so doesn't need STR()ing.
>>
>>So it would seem that the functionality of IMPORT has changed.
>>
>>Terry
>
>
>? TRANSFORM(13,[@L 9999])
>
Thanks BB. That works fine too. But I think Tamar just pipped you to the post :-)

Cheers

Terry
- Whoever said that women are the weaker sex never tried to wrest the bedclothes off one in the middle of the night
- Worry is the interest you pay, in advance, for a loan that you may never need to take out.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform