Hi
I am trying to understand function args, but the code gives strange results and breaks, i have no way of stepping through/adding breakpoint for debugging:
Code: Select all
Function p_test(param1, param2, ...)
Local pars = arg.n
Local k
DebugPrint("param1=", arg[0], " param2=", arg[1])
For k = 1 To arg.n
DebugPrint("k=",k," To ", arg.n)
DebugPrint ("k= ", k," arg[k-1]= ",arg[k-1])
Next
DebugPrint (" pars = ", arg.n)
EndFunction
p_test("mypar1","mypar2")
p_test("mypar1","mypar2","mypar3")
WaitEvent
so : arg[0] should be "mypar1" arg[1] should be "mypar2"
then on last function arg[2] should be "mypar3"
I get strange results when the code works. I get error: Error in line 7 (Unnamed1): Table field 0 was not initialized!
can anyone assist ?