Try: X = FMT(X,'4"0"R') ... works here on UniData 6.1

Larry Hiscock
Western Computer Services


-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Bob Woodward
Sent: Friday, July 08, 2011 12:17 PM
To: u2-users@listserver.u2ug.org
Subject: [U2] Simple FMT question

Hi Group,

 

I don't know why this is kicking my butt but I'm trying to do a simple X
= FMT(X,"4\0R") statement, straight out of the HELP UNIBASIC listing and
I can't seem to get it to work.  The problem is the fill character, in
this case the number zero, but what I get back is just the letter "R",
without the quote marks.  I get pretty much the same result no matter
what fill character I use.  I simply want to format a number to be 4
characters long with leading zeros.  If X="1", then it should result in
X="0001", or so I've been lead to believe.

 

I know that X = ("0000":X)[4] works to get my results but FMT should
work, too.  The major benefit is that if the number is more than 4
digits, FMT won't truncate it.  I hope.....

 

Environment is UniData 6.1 on a Windows server.   Comments anyone?

 

Thanks,

 

BobW

 

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to