But it's shown as 'string'. To repro (see following script):
- Array $GAf[] is undefined
- Define it by setting one element "c" to 0
- now check any other (non-existing) element by VarType(): it's shown as "string"
- (should be "undefined", I think)
- set a yet undefiined element to 3
- VarType() now shows it correct as "int".
Result: an undefined element can't be recognized!
(Sample script, made from a real world script. There the array is Global - but that makes no difference.)
Code: Select all
//§
"Test"
step;
$GAf["c"] = 0; // define $GAf[] by setting 1 element
$exist = VarType($GAf["abc"]); // is undefined, but shown as "string"
$exist = VarType($GAf[11]); // is undefined, also shown as "string"
$GAf["abc"] = 3; // define it by setting to 3
$exist = VarType($GAf["abc"]); // now correct shown as "int"
XYplorer Beta Club