prog8/examples/test.p8

34 lines
677 B
Plaintext
Raw Normal View History

%import textio
%zeropage basicsafe
2020-12-08 00:02:38 +00:00
main {
2021-01-13 21:32:17 +00:00
sub start() {
str text = "44"
uword textptr = &text
ubyte nlen = conv.any2uword(textptr)
ubyte lastchr = text[nlen]
ubyte valid_operand
2021-02-13 22:50:03 +00:00
valid_operand = nlen>0 and lastchr==0
txt.print("\nvalidoper? ")
txt.print_ub(valid_operand)
txt.nl()
valid_operand = nlen>0
valid_operand = valid_operand and lastchr==0
txt.print("\nvalidoper? ")
txt.print_ub(valid_operand)
txt.nl()
valid_operand = nlen and lastchr==0
txt.print("\nvalidoper? ")
txt.print_ub(valid_operand)
2021-02-13 22:50:03 +00:00
txt.nl()
2021-01-10 14:15:00 +00:00
}
2020-08-27 17:47:50 +00:00
}