prog8/examples/test.p8

47 lines
922 B
Plaintext
Raw Normal View History

2024-06-01 13:03:01 +00:00
%import textio
2024-08-22 20:54:38 +00:00
%import string
%option no_sysinit
%zeropage basicsafe
2024-07-21 11:35:28 +00:00
main {
sub start() {
2024-08-22 20:54:38 +00:00
str name = "zn.iff.jpg"
ubyte index
bool found
index, found = string.find(name, '.')
if found {
txt.print_ub(index)
txt.nl()
} else {
txt.print(". not found\n")
}
index, found = string.find(name, '@')
if found {
txt.print_ub(index)
txt.nl()
} else {
txt.print("@ not found\n")
}
index, found = string.rfind(name, '.')
if found {
txt.print_ub(index)
txt.nl()
} else {
txt.print(". not r found\n")
}
index, found = string.rfind(name, '@')
if found {
txt.print_ub(index)
txt.nl()
} else {
txt.print("@ not r found\n")
}
2024-07-21 11:35:28 +00:00
}
}