prog8/examples/test.p8
Irmen de Jong 5731b79554 don't allow problematic string and array assignments anymore, improve error messages.
In certain cases you will need to use string.copy() explicitly to overwrite strings with new strings.
2024-10-09 00:51:05 +02:00

31 lines
593 B
Lua

%import textio
%import string
%zeropage basicsafe
main {
sub start() {
str name1 = "irmen"
str name2 = "other"
bool[2] flags = [true, false]
txt.print(name1)
txt.nl()
name1 = name2
txt.print(name1)
txt.nl()
flags = [false, true]
ubyte[10] array
ubyte[10] array2
void string.copy(name2, name1)
array = array2
name2 = "zzz"
array = [1,2,3,4,5,6,7,8,9,10]
;; array = cx16.r0
;; array = name1
;; name1 = array
;; name1 = cx16.r0
}
}