Phantom Documentation

[Help Home] [Phantom Home]
Set

void exception.Set(int,string)

Return Type: void
Parameters: int iState, string sMessage

Description:
The Set function defines a user-defined exception type. The iState parameter can be any integer used to define the type of exception. The sMessage parameter defines the message associated with the exception.

Note that the iState can also be any of the pre-defined state types (Error, Warning, etc...) as defined in exception.

Example Code

exception user;
user.Set(8, "String Length Exception");
string s = "Hello";
try{
  if(GetLength(s) < 10){
    user.throw();
  }
}catch(exception e){
  disp("User exception caught: " + e.GetMessage());
}


See exception for additional examples.

See Also: exception


Copyright 2000-2011 Phantom Automated Solutions