TScript Error Handling

Error handling in many other languages is done through the use of exceptions. TScript uses a similar process of error handling, although slightly different. TScript has a global error variable similar to the traditional errno in C, although the error variable in TScript is capable to holding both an error code and a detailed error message.

In many languages that use the try{...}catch(...){...} the error is returned via the catch statement and this can make the operational flow of the code awkward in situations where some errors are recoverable. TScript uses the if(...){...} else{...} notation that allows calling code to filter the error, potentially recovering from the error and returning to normal operation, or returning the error to the its own calling function.

Example of Error Handling
function(){
   return error = -1;
}

public main(){
   if(!function()){
      if(error != -1) return error;
   }
   System::MessageBox(L"function executed correctly");
}
Comments (0)Listen All
Characters left: 2500
 

Contact Ekky Software

Thank you for your time and interest.
Ekky Software Customer Support Team.

Ekky Software Product Range
Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript Ekky Software Homepage Ekky Software Homepage ObjectDatabase++ TScript