integer format

make

Member
hi !

i have defined a variable :

def ch as int.

i wanto display this var like this : for example : 01 or 02 ...

how should i format this variable?

def ch as int format "99". ??????

this do not work.
when i display with the message statemant i only see : 1 or 2...

greets
make
 
The format you have used is correct. But it only works for DISPLAY statements.

The MESSAGE statement converts all fields to character.

Therefore


DEF VAR ch AS INT NO-UNDO FORMAT "99" INIT 1.

DISPLAY ch.

shows "01".


DISPLAY STRING(ch).

shows "1"

MESSAGE ch.

shows "1", because it acts like a STRING function

MESSAGE STRING(ch,'99').

shows "01" because we over-ride the default format.
 
Top