Smbx 1.4.5: weird strings
Posted: 17 Mar 2021, 17:54
Something weird about strings is that you can't get a value directly:
* String variable and get a string from the table:
But if I concatenate it with a "" it is fixed
* String gets a name property of an npc
But this works:
* In a function:
This fails
But if I add "", it works:
* String variable and get a string from the table:
Code: Select all
dim var1 as string
var1=str(vartable) '← failsBut if I concatenate it with a "" it is fixed
Code: Select all
dim var1 as string
var1=str(vartable) & "" '← works
* String gets a name property of an npc
Code: Select all
dim sssa as string
sssa=npc(1).name '← it fails
But this works:
Code: Select all
dim sssa as string
sssa=npc(1).name & ""
* In a function:
This fails
Code: Select all
script corr(return string)
dim sss as string="sdddddddddddd"
return sss
end scriptBut if I add "", it works:
Code: Select all
script corr(return string)
dim sss as string="sdddddddddddd"
return sss & ""
end script