I am trying to build a script library but unlike the online documentation, the “intellisense” code completion does not seem to be able to resolve my function calls to handlers even within the current suite, let alone trying to import from another suite.
I have a script called Utils that contains a handler like this:
to SomeFunction param1, param2, param3
--// do suff
end SomeFunction
I have also tried with the function keyword but the handler / function does not appear. If I create a single script per function then i can reference them fine but this is impractical from a functional grouping perspective (and very messy with many distinct files).
Can you suggest where i might be going wrong, and if there is a minimum eggplant version that this is dependent upon (we are using 18.1.2-Windows-64 2031422a).
So we have now upgraded to v22 but while functions are now resolving as handlers in the “intellisense”, the required parameters are not being broadcast. Is this something that eggplant simply does not do, or am i missing something on how to construct the function interfaces?
The following function is in a script called “TestUtils”
After the first time that I used it, I selected it and used the context-sensitive menu to “Create Suite Snippet.” I swapped my literals for placeholders bounded by [ ]. Here is the end product:
Yea, that is about the only way I can see of doing it too - I guess that is exactly the same way we have insight onto the eggplant functions, only is is less transparent on how this was achieved.
When you call Function1 from Script3, are you using dot notation to indicate where SenseTalk can find that function? The call in Script3 should look like this log Script2.Function1 (parameter)
Hope this helps,
Dave
Slight amendment to the example structure, just for clarity:
Suite1
MainScript1
Subscript
Function1(p1)
Suite2
Script2
Function1(p1)
Function2(p1)
Script3(p1)
All calls are in the context of MainScript1.
Subscript.Function(p1) - succeeds
Script3(p1) - succeeds (calling hte entire script, NOT a function)
Script2.Function1(p1) - fails with the listed error
I have tried pulling a copy of “Script2” into “Suite1” to validate there is not an issue with reserved words; when in the local suite, the functions resolve correctly.