sannybuilder / dev

Sanny Builder Bug Tracker and Roadmap development
https://sannybuilder.com
44 stars 0 forks source link

unexpected result in opcode 05AA for longer strings #295

Open x87 opened 4 months ago

x87 commented 4 months ago
0@s = '0123456789ABCDE'

compiles with no error producing valid bytecode (opcode 05AA). but the runtime (game) limits number of chars written into 0@s to 8 characters. so 0@s contains 01234567 without a null-terminator.

need some kind of a warning to the user?

x87 commented 4 months ago

same happens in pretty much all opcodes that expect a short string. game cuts it to first 8 characters. if the game expects a longer string ("double quotes"), then a long string with single quotes may work

MiranDMC commented 3 months ago

By design SCM do not require terminator in short or long string variables, so game will always read only the correct amount of the characters. It my opinion showcased example can be simply handled as compilation error, as for sure it is not what user meant to do (text truncation).