2020-09-20 21:49:36 +00:00
|
|
|
%import floats
|
|
|
|
%import textio
|
2024-11-23 14:51:38 +00:00
|
|
|
%import strings
|
2020-08-27 16:10:22 +00:00
|
|
|
%zeropage basicsafe
|
2019-08-11 14:01:37 +00:00
|
|
|
|
|
|
|
main {
|
|
|
|
|
|
|
|
sub start() {
|
|
|
|
ubyte[] ubarr = [100, 0, 99, 199, 22]
|
|
|
|
byte[] barr = [-100, 0, 99, -122, 22]
|
|
|
|
uword[] uwarr = [1000, 0, 222, 4444, 999]
|
|
|
|
word[] warr = [-1000, 0, 999, -4444, 222]
|
|
|
|
float[] farr = [-1000.1, 0, 999.9, -4444.4, 222.2]
|
|
|
|
str name = "irmen"
|
|
|
|
ubyte ub
|
|
|
|
byte bb
|
|
|
|
word ww
|
|
|
|
uword uw
|
|
|
|
float ff
|
|
|
|
|
|
|
|
; LEN/STRLEN
|
|
|
|
ubyte length = len(name)
|
2020-08-27 16:10:22 +00:00
|
|
|
if length!=5 txt.print("error len1\n")
|
2019-08-11 14:01:37 +00:00
|
|
|
length = len(uwarr)
|
2020-08-27 16:10:22 +00:00
|
|
|
if length!=5 txt.print("error len2\n")
|
2024-11-23 14:51:38 +00:00
|
|
|
length=strings.length(name)
|
2020-08-27 16:10:22 +00:00
|
|
|
if length!=5 txt.print("error strlen1\n")
|
2019-08-11 14:01:37 +00:00
|
|
|
name[3] = 0
|
2024-11-23 14:51:38 +00:00
|
|
|
length=strings.length(name)
|
2020-08-27 16:10:22 +00:00
|
|
|
if length!=3 txt.print("error strlen2\n")
|
2019-08-11 14:01:37 +00:00
|
|
|
|
2024-11-23 12:22:19 +00:00
|
|
|
txt.print("\nyou should see no errors printed above (first run only).")
|
2019-08-11 14:01:37 +00:00
|
|
|
}
|
|
|
|
}
|