"Script_Parse()" is used to parse a command that use your keyword. This function is called by sliceO when a script command was entered in the program and that command start with the same key word as the one you registered. The same key word can be registered by multiple modules, so if the arguments of this command are not recognized by your module, you should return "0" so that sliceO will try other modules. If you return "1", it signal that you have recognized this command and acted on it.
The function receive 2 arguments: "nb_arg" and "pt_arg".
Syntax
extern "C" __declspec(dllexport) int Script_Parse(
int nb_arg,
char *pt_arg[]
)
Parameters
nb_arg
nb_arg is the number of argument that the parser found for this command.
pt_arg
pt_arg is a pointer to an array of "nb_arg" arguments.
Return value
The function returns "1" if the command was understood, "0" if not and "-1" if an error occurred.
Remarks
This function is optional.
If the number of arguments is "0" or the first argument is either "help" or a question mark (?), then you should print a list of commands recognized by your module.
Frequently, the first or second arguments of a script command will be an action verb telling your parser what it should do. If this verb is the second argument, then usually the first argument is a template matching one or multiple element to witch the action should be applied.
Requirements
Header:
sliceO_include.hpp
Library:
sliceO_Structures.lib
Example
The "snapshot" module use the syntax: "snapshot: [t_window] click [filename]". "snapshot" is the registered key word for the snapshot module, "click" is the desired action, and the optional "t_window" is a template matching one or multiple windows that need to be saved to file. SliceOmatic provide functions to help you transform the templates in list of matched elements.
See also