Description: Check for an If One Condition. This function checks for a race condition in an action script and returns the value of the location.
Returns: Module
Usage: Script or Steady State
Format: IfOne()
Parameters: None
Comments: This function is used for debugging VTS applications and returns the module, state or statement value of the last script that did not switch states, and had a true action trigger after executing its script.
Example:
If ! Valid(cureIfOne);
[
cureIfOne = IfOne() { Find possible problems };
badMod = PickValid(
Cast(Cast(cureIfOne, 11), 4) { Module name (text) },
"N/A" { If not module, say so });
badState = PickValid(
StateName(cureIfOne) { State name as text },
"N/A" { If not state, say so });
badStmnt = PickValid(
Cast(GetStatementNum(
GetInstance(cureIfOne, 0), cureIfOne), 4)
{ Statement name as text },
"N/A" { If not statement, say so });
]
This script will find a possible problem area (a script that may have a race condition) and set the variables badMod, badState or badStmnt to indicate its location in the application. There would probably be several statements following this script that printed out the aforementioned variables; the ones that were not valid would simply hold the text "N/A".