simplified containment check, only possible on string and arrays (as per the docs)

This commit is contained in:
Irmen de Jong
2022-03-27 15:23:32 +02:00
parent e41d6787bb
commit 3b6e7eccdd
17 changed files with 176 additions and 211 deletions

View File

@@ -2,8 +2,39 @@
;
; Written by Irmen de Jong (irmen@razorvine.net) - license: GNU GPL 3.0
%import textio
prog8_lib {
%option force_output
; nothing here for now
sub string_contains(ubyte needle, str haystack) -> ubyte {
txt.print(">>>string elt check: ")
txt.print_ub(needle)
txt.spc()
txt.print_uwhex(haystack, true)
txt.nl()
return 0
}
sub bytearray_contains(ubyte needle, uword haystack_ptr, ubyte num_elements) -> ubyte {
txt.print(">>>bytearray elt check: ")
txt.print_ub(needle)
txt.spc()
txt.print_uwhex(haystack_ptr, true)
txt.spc()
txt.print_ub(num_elements)
txt.nl()
return 0
}
sub wordarray_contains(ubyte needle, uword haystack_ptr, ubyte num_elements) -> ubyte {
txt.print(">>>wordarray elt check: ")
txt.print_ub(needle)
txt.spc()
txt.print_uwhex(haystack_ptr, true)
txt.spc()
txt.print_ub(num_elements)
txt.nl()
return 0
}
}