Go to the source code of this file.
Macros | |
#define | _CDECL |
Functions | |
bool | checkForCondition (RexxThreadContext *c, bool clear) |
void | printInterpreterVersion (RexxInstance *) |
int _CDECL | main (int argc, char **argv) |
wholenumber_t | conditionSubCode (RexxCondition *condition) |
void | standardConditionMsg (RexxThreadContext *c, RexxDirectoryObject condObj, RexxCondition *condition) |
#define _CDECL |
A simple example that creates an instance of the interpreter and uses that instance to execute a Rexx program. The program name must be passed in the command line. For example:
runRexxProgram HelloWorld.rex runRexxProgram backward.fnc runRexxProgram tooRecursiveTrapped.rex runRexxProgram tooRecursiveUnhandled.rex
backward.fnc demonstrates how to pass arguments into the called program.
Definition at line 58 of file runRexxProgram.cpp.
bool checkForCondition | ( | RexxThreadContext * | c, |
bool | clear | ||
) |
Given a thread context, checks for a raised condition, and prints out the standard condition message if there is a condition.
c | Thread context we are operating in. |
clear | Whether to clear the condition or not. |
Definition at line 213 of file runRexxProgram.cpp.
References NULLOBJECT, and standardConditionMsg().
Referenced by main().
|
inline |
Given a condition object, extracts and returns as a whole number the subcode of the condition.
Definition at line 157 of file runRexxProgram.cpp.
References RexxCondition::code, and RexxCondition::rc.
Referenced by standardConditionMsg().
int _CDECL main | ( | int | argc, |
char ** | argv | ||
) |
Definition at line 68 of file runRexxProgram.cpp.
References checkForCondition(), NULLOBJECT, printInterpreterVersion(), and RexxCreateInterpreter().
void printInterpreterVersion | ( | RexxInstance * | interpreter | ) |
Below are several helper functions that demonstrate how to use some of the different C++ native APIs. Given an interpreter instance, prints out the interpreter version and language version. The documentation in the ooRexx programming guide explains the byte encoding of the version numbers.
Definition at line 144 of file runRexxProgram.cpp.
Referenced by main().
void standardConditionMsg | ( | RexxThreadContext * | c, |
RexxDirectoryObject | condObj, | ||
RexxCondition * | condition | ||
) |
Outputs the typical condition message. For example:
4 *-* say dt~number
Error 97 running C:\work\qTest.rex line 4: Object method not found Error 97.1: Object "a DateTime" does not understand message "NUMBER"
c | The thread context we are operating in. |
condObj | The condition information object. The object returned from the C++ API GetConditionInfo() |
condition | The RexxCondition struct. The filled in struct from the C++ API DecodeConditionInfo(). |
@assumes There is a condition and that condObj and condition are valid.
Definition at line 178 of file runRexxProgram.cpp.
References conditionSubCode(), RexxCondition::errortext, RexxCondition::message, NULLOBJECT, RexxCondition::position, RexxCondition::program, and RexxCondition::rc.
Referenced by checkForCondition().