+= works weird for strings
pik33
Posts: 2,388
dim filename$ as string filename$="123456" filename$+=space$(38) print filename$
It compiles, but:
warning: assignment discards const attribute from pointer
and the result is: �x3��
Standard syntax works as expected: the result is 123456 and 38 spaces at the end.
dim filename$ as string filename$="123456" filename$=filename$+space$(38) print filename$
Comments
There were some bugs with handling the temporary strings required for += when the right hand side is a function call. For now either avoid += with strings (except for simple variables and literal strings) or else update to the most recent github source code.
Thanks for the bug report,