Padding field with zeros

GirlNet

Member
I've looked everywhere and I can't find this reference at all. How do you pad a variable length field with preceeding zeros? So . . . 000429 needs to be 9 character long, the output would be 000000429.:rolleyes:

Plus, the recordset changes length - so maybe next its 00042.

Thanks ever so much!
 

TomBascom

Curmudgeon
I've looked everywhere and I can't find this reference at all. How do you pad a variable length field with preceeding zeros? So . . . 000429 needs to be 9 character long, the output would be 000000429.:rolleyes:
Code:
for each customer no-lock:
  display name custNum format "9999999999".
end.
Plus, the recordset changes length - so maybe next its 00042.

I don't understand.
 

GirlNet

Member
What about integers? It seems that format ">>>>>>>>>9" is not giving me 0000000001 when the value is 1.

Thank you!
 

enoon

Member
What about integers? It seems that format ">>>>>>>>>9" is not giving me 0000000001 when the value is 1.

Thank you!

the ">" character mean that when displaying the number when it has no value it can display an ampy string "", of course when it has value it will display it.

The "9" character will display "0" instead of empty string "" when it has no value, otherwise it will display the value.

At any time you can force a format for an integer: lets say the format is ">>9" and the value is 7 it will display "7" but when you say DISPLAY 7 FORMAT "999" the output will be "007".
 
Top