Just had a little problem with format$ but wasn't able to fix it.
However, playing around with format$ I repeatedly got strange
results similar to my original one, i.e. different results of x=1/3
depending on the mask$ given in format$(x,mask$). In the following
code I listed the results of msgbox/format$ at the end of the
respective line. The behaviour of the program is similar after
substituting ext by single. I feel that the problem was already
discussed somewhere in this forum, but couldn't find anything.
Am I doing anything wrong? I'm using PII/NT4/PB6. Any idea?
Regards, Hanns.
------------------
[This message has been edited by Hanns Ackermann (edited August 23, 2000).]
However, playing around with format$ I repeatedly got strange
results similar to my original one, i.e. different results of x=1/3
depending on the mask$ given in format$(x,mask$). In the following
code I listed the results of msgbox/format$ at the end of the
respective line. The behaviour of the program is similar after
substituting ext by single. I feel that the problem was already
discussed somewhere in this forum, but couldn't find anything.
Am I doing anything wrong? I'm using PII/NT4/PB6. Any idea?
Regards, Hanns.
Code:
#compile exe function pbmain() as long dim x as ext ' single: similar results On Error Goto Er x=1/3 msgbox str$(x) ' = .333333333333333 msgbox format$(x,"##.####################") ' =0.033333333333333331200 msgbox format$(x,"##.##################") ' =0.333333333333333312 msgbox format$(x," ##.#####################") ' =0.00333333333333333312000 msgbox format$(x,"#.#######################^^^^") ' = .333333333333333 msgbox str$(x) ' =0 !!!!!!!!!!!!!! x=x+0.5 msgbox str$(x) ' =0 !!!!!!!!!!!!!! exit function Er:: msgbox "ERROR" end function
------------------
[This message has been edited by Hanns Ackermann (edited August 23, 2000).]
Comment