Code: Select all
public handler Vec(in tX as Real, in tY as Real, in tZ as optional Real) as Array
variable tVec as Array
put the empty array into tVec
put tX into tVec["x"]
put tY into tVec["y"]
if tZ is not undefined then
put tZ into tVec["z"]
end if
return tVec
end handler -- Vec
private handler testVec() as Array
variable tVec as Array
put the empty array into tVec
-- put Vec(1,2) into tVec -- This throws compiler error "too few arguments"
put Vec(1,2,3) into tVec -- works OK
return tVec
end handler -- testVec
Any ideas on the best approach? I would like to access the Vec() function from LCS and LCB to see if I can get some speed improvements.