
ExecuteStaticMethod
ExecuteStaticMethod is the entry point for the TScript. It enables the native C++ code to call the static method within the TScript source.
unsigned int ExecuteStaticMethod( const char* methodName = NULL, TVariable *inputList = NULL, unsigned short inputList_l = 0, TVariable *outputList = NULL, unsigned short outputList_l = 0, TVariable *errorVariable = NULL );
Parameters
| methodName | the name of the static method used to call the sript, if NULL then the default script static method of "main" will be called. |
| inputList | an array of TVariables that have the input method parameters. |
| inputList_l | the length of input parameters. |
| outputList | an array of TVariables in which the returning results of the successful method will be stored. |
| outputList_l | the length of output parameters. |
| errorVariable | if the script generated and error, the error will be copied to this TVariable. |
Return Values
If the method succeeds, the return value is zero else see error codes for more details.
Remarks
Example Use
- C++
#include "TScript.h"
int wmain(int argc, wchar_t* argv[])
{
char16_t *message;
CTScript script();
//allow tscript to query user for security exceptions
script.SetParameter(CTScript::PROMPT_USER_SECURITY_EXCEPTIONS,1);
script.SetParameter(CTScript::SOURCE_FILE,u"D:\\temporary\\mySource.ts");
if(script.ExecuteStaticMethod()){//error
if(script.GetParameter(CTScript::LAST_ERROR,NULL,&message))
message = u"Unknown script error";
MessageBox(message);
}
}Also See
GetParameter, SetParameterListen All
Comments (0)

