? Transform(123, '@L 99999') && 00123
Thierry Nivelet FoxInCloud Give your VFP app a second life in the cloud http://foxincloud.com/
Le 12/09/2016 à 21:39, Gene Wirchenko a écrit :
Hello:
On Foxite, Shaheryar Rashed started a thread "slow save atnetwork". While I had nothing to add in general, I did note some awkward code: mvoucher = Right('0000' + Alltrim(Str(Thisform.voucherno1.Value)),5)
How do you do leading zeroes cleanly? This is a thing that hasbothered me. One would think it would make an excellent option for transform(). There is @L but transform(123,"@L") generates "0000000123.00" which is not anything that anyone is likely to want. Usually, I want leading zeroes on integers.
transform() is not the answer; padl() is. Suppose you have 123and want "00123". padl(123,5,"0") does it. Since the VFP documentation does not specify how the first expression is stringised, you might prefer padl(transform(123),5,"0")
Sincerely,
Gene Wirchenko
[excessive quoting removed by server]