mdlIDataMember GetErrorCode
Gets the code of the last error which occurred.
Syntax
mdlIDataMember_handle GetErrorCode
Application
MotionView Tcl Query
Description
This command returns information for the last error which occurred. If there were no previous errors, a "No Error" message will be returned.
Example
To get the code for the last error which
occurred:
hwi GetSessionHandle sess1
sess1 GetProjectHandle pro1
pro1 GetPageHandle pa1 [pro1 GetActivePage]
pa1 GetWindowHandle win1 [pa1 GetActiveWindow]
win1 GetClientHandle mcl
mcl GetModelHandle mod1
mod1 InterpretEntity temp "Body" b_0 "\"BodyLabel\""
mod1 BeginFlatListFastGet Body
set num_body [mod1 GetNumberOfChildren]
set idx [mod1 GetChildHandleByIdx ch_b1 2]
mod1 GetChildHandle bchld [ch_b1 GetVarname]
bchld GetChildHandle bms mass
set body_mass [bms GetEvaluatedValue];
set new_mass [expr $body_mass + 10];
bms SetRawExpression $new_mass
bms Evaluate;
bms GetErrorCode;
bms SetRawExpression "Test"
bms Evaluate;
bms GetErrorCode
ch_b1 ReleaseHandle;
mod1 EndChildFastGet
temp ReleaseHandle;
bms ReleaseHandle;
bchld ReleaseHandle;
mod1 ReleaseHandle
mcl ReleaseHandle;
win1 ReleaseHandle;
pa1 ReleaseHandle;
pro1 ReleaseHandle;
sess1 ReleaseHandle;
Errors
Returns the last error code. If there is an error, an error code will be returned.