I create a simple bar with two buttons: one button calls user function SomeFunc
(without parameters) defined in the same file, another button just displays a
debug message. SomeFunc displays another debug message and closes the bar.
Code:
//file test.powerpro
local C = cl.Create("Simple", 1)
C.Insert(0)
C.SetLabel(0, "Function")
C.AddLeft(0, "[EMAIL PROTECTED]")
C.Insert(0)
C.SetLabel(0, "Command")
C.AddLeft(0, "win.debug(?=Command=)")
C.AddProperties("Format=Vertical")
*Bar Show Simple
quit
Function SomeFunc
win.debug("SomeFunc")
*Bar Close Simple
quit
//end of test.powerpro
Excerpt from the help file:
FName() //Call a function within the same script file with no arguments
I tried all the combinations of
C.AddLeft(0, "SomeFunc")
C.AddLeft(0, "SomeFunc()")
C.AddLeft(0, "@SomeFunc")
C.AddLeft(0, "@SomeFunc()")
and of
Function SomeFunc
Function SomeFunc()
No combination works. Although the code above successfully calls the function.
Why should I indicate the script name if the function is in the same file? What
is the simplest and correct code? What is my mistake?