Page 1 of 1

ToString$ ()

Posted: Fri Nov 21, 2008 11:00 am
by saschech@gmx.de
Hallo to together
I have a counter 0 to 9999,that i print with ToString$ ().
The good,the hex up/down is displayed dec. in the display,but if the counter change:

100 display 100
99 display 990
9 display 900
5 display 500

is this normal?

Regards wolfgang

Re: ToString$ ()

Posted: Fri Nov 21, 2008 11:28 am
by Benj
Hi Wolfgang

Yes thats normal. What you need to do is print one or two characters of white space after your number to make sure the previous number gets erased.

Eg instead of printing "100" and then "5" which will lead to "500", print this instead "100 " and "5 " which will lead to "5 ".

Re: ToString$ ()

Posted: Fri Nov 21, 2008 11:43 am
by Steve
Or clear the display before printing the number.

Re: ToString$ ()

Posted: Fri Nov 21, 2008 11:45 am
by saschech@gmx.de
Hallo Benj
I understand what you mean,my problem,where i put in the space?
timer_set_00_dec = 901
timer_00_set_wert = ToString$(timer_set_00)

a
timer_set_00_dec = timer_set_00_dec - 1
wait
timer_00_set_wert = ToString$(timer_set_00_dec)
go to a


Regards wolfgang

Re: ToString$ ()

Posted: Fri Nov 21, 2008 2:12 pm
by Benj
Hi Wolfgang

For your program

Code: Select all

timer_set_00_dec = 901
timer_00_set_wert = ToString$(timer_set_00)

a
timer_set_00_dec = timer_set_00_dec - 1
wait
timer_00_set_wert = ToString$(timer_set_00_dec)
go to a
Would become

Code: Select all

timer_set_00_dec = 901
timer_00_set_wert = ToString$(timer_set_00)
timer_00_set_wert = timer_00_set_wert + "  "

a
timer_set_00_dec = timer_set_00_dec - 1
wait
timer_00_set_wert = ToString$(timer_set_00_dec)
timer_00_set_wert = timer_00_set_wert + "  "
go to a