Blockland Forums > Modification Help
[BL SOURCE CODE/REFERENCE] Building related functions
mctwist:
--- Quote from: phflack on November 21, 2017, 02:57:01 AM ---I've never heard of those functions before
that would be useful to know
--- End quote ---
This is the very reason that scripting to Blockland is difficult as there might be information available, but most of it is that you decipher yourself and never share it.
From what I know, expandEscape will add escape character(backslash \) for certain characters, like backslash (\) and quote (").
The other function, getSafeVariableName, will cleanup the string so it contains characters that could be used inside of a variable:
--- Code: ---$myVar[getSafeVariableName($arrayIndex)];
--- End code ---
Of course, anything could be put there anyway, but it's most recommended to use it to make sure you are in the green.
And as always, I could be completely wrong on this, then please correct me.
Latte:
You shouldn't have to stress over getSafeVariableName. So long as you're not exporting $myVar* anywhere, you can use any string you want.
mctwist:
--- Quote from: Latte on November 21, 2017, 02:50:53 PM ---You shouldn't have to stress over getSafeVariableName. So long as you're not exporting $myVar* anywhere, you can use any string you want.
--- End quote ---
Fair point.