Difference between revisions of "QAS getCallStack"
Nguyenduyan (talk | contribs) (→QAS_getCallStack) |
Nguyenduyan (talk | contribs) (→QAS_getCallStack) |
||
Line 84: | Line 84: | ||
| bgcolor="#C0C0C0" width="200" style="border:1px solid #010101;" | | | bgcolor="#C0C0C0" width="200" style="border:1px solid #010101;" | | ||
'''Data type''' | '''Data type''' | ||
− | |||
− | |||
− | |||
|- align="left" valign="top" | |- align="left" valign="top" | ||
Line 98: | Line 95: | ||
<span class="normalise">array</span> | <span class="normalise">array</span> | ||
− | |||
− | |||
|- align="left" valign="top" | |- align="left" valign="top" | ||
Line 111: | Line 106: | ||
<span class="normalise">array</span> | <span class="normalise">array</span> | ||
− | |||
− | |||
|} | |} |
Revision as of 06:06, 11 April 2012
QAS_getCallStack
This function makes it possible for the script writer to peek into the current answer sheet call stack. The function requires an answer sheet context to be present which only exists for CG Scripts executed in dummy questions.
Syntax
QAS_getCallStack()
Arguments
No
Return type
array. The array returned from QAS_getCallStack has the following structure:
Index |
Property name |
Data type |
Description |
0 |
QAS_CALL_STACK_ANSWER_SHEET_CONTEXT_ID |
number |
The answer sheet id for the initial answer sheet, this id is also known as the answer sheet context id. |
1 |
QAS_CALL_STACK_ANSWER_SHEET_IDS |
array |
All the answer sheet ids currently on the answer sheet call stack, where the first answer sheet id in the array correspond to the caller answer sheet at the bottom of the call stack. This array always contains minimum one element, which is the initial answer sheet id. |
2 |
QAS_CALL_STACK_FRAMES |
array |
This array contains an array for each stack frame on the call stack, including information about caller and callee, where the stack frame in the array correspond to the stack frame at the bottom of the call stack. |
The property QAS_CALL_STACK_FRAMES consists of arrays which we refer to as call stack frames, each call stack frame consists of two arrays; one for the caller and one for the callee in the following way:
Index |
Property name |
Data type |
0 |
QAS_STACK_FRAME_CALLER |
array
|
1 |
QAS_STACK_FRAME_CALLEE |
array
|
Example
QAS_getCallStack();
Availability
Version 5.9.5