
Originally Posted by
sayzer
At my best guess, this is what you are asking.
You need the print always to the right.
Code:
<font color="#000000">MYNUMBER <font color="#000080"><b>VAR BYTE
</b></font>MYNUMBER = <font color="#FF0000">0
</font><font color="#000080"><b>ADCIN </b></font><font color="#FF0000">0</font>, MYNUMBER
<font color="#000080"><b>LCDOUT </b></font><font color="#FF0000">$FE</font>, <font color="#FF0000">$83
</font><font color="#000080"><b>IF </b></font>MYNUMBER > <font color="#FF0000">99 </font><font color="#000080"><b>THEN
LCDOUT DEC3 </b></font>MYNUMBER <font color="#000080"><i>' three digits + "-Dingles"
</i><b>ELSE
IF </b></font>MYNUMBER > <font color="#FF0000">9 </font><font color="#000080"><b>THEN </b><i>' one space + two digits + "-Dingles"
</i><b>LCDOUT </b></font><font color="#008000">" "</font>, MYNUMBER
<font color="#000080"><b>ELSE
LCDOUT </b></font><font color="#008000">" "</font>,<font color="#000080"><b>DEC1 </b></font>MYNUMBER <font color="#000080"><i>' two spaces + one digit + "-Dingles"
</i><b>ENDIF
ENDIF
LCDOUT </b></font><font color="#008000">"-Dingles"
</font>
Ahh, I see. I was hoping there would be some compiler directive/keyword/function-switch to use in PBP, something like printf in C but this is fine, whatever works ...right?.
Since I need a posible 5-digit number perhaps turning the IF/THEN into a CASE statement would work here? something like this:
Code:
MYNUMBER VAR BYTE
MYNUMBER = 0
...
ADCIN 0, MYNUMBER
...
...
SELECT CASE MYNUMBER
CASE IS > 9999
LCDOUT $FE, $83, DEC5 MYNUMBER ' 5 digits
CASE IS > 999
LCDOUT $FE, $83, " ", DEC4 MYNUMBER ' 1 space and 4 digits
CASE IS > 99
LCDOUT $FE, $83, " ", DEC3 MYNUMBER ' 2 spaces and 3 digits
CASE IS > 9
LCDOUT $FE, $83, " ", DEC2 MYNUMBER ' 3 spaces and 2 digits
CASE ELSE
LCDOUT $FE, $83, " ", DEC1 MYNUMBER ' 4 spaces and 1 digit
END SELECT
Thanks for response
Bookmarks