On my box (UniData 7.2) in a native UniData account: X = 1 CRT X "R%4" Returns %4
But in a PICK flavor account, it returns 0001 This can also be controlled for an individual program with the $BASICTYPE compiler option, but there are other syntax issues to look out for, mainly the LOCATE command. John Israel Senior Programmer/Analyst Dayton Superior Corporation 1125 Byers Road Miamisburg, OHÂ 45342 -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Charlie Noah Sent: Friday, July 08, 2011 3:34 PM To: U2 Users List Subject: Re: [U2] Simple FMT question Hi Bob, Tryany of these: X = 1 FMT(X, 'MD%4') =0001 FMT(X, 'MR%4') =0001 FMT(X, 'R%4') =0001 X 'MD%4' =0001 X 'R%4' =0001 These all; work in Jbase, Universe flavor, YMMV. Regards, Charlie Noah On 07-08-2011 2:17 PM, Bob Woodward wrote: > 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 > [email protected] > http://listserver.u2ug.org/mailman/listinfo/u2-users > _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
