Jump to content
Sign in to follow this  
igneous01

Checking whether a script successfully ran (call, spawn, execVM)

Recommended Posts

Im in the process of adding some debug code in the rpt for a majority of my scripts to help make it easier to figure out what script is causing the problem. Some scripts are calling other scripts and some variables are being used in multiple scripts (although this is moderated). I dont have any issues now, but I might later on when I make changes to certain things, and the default errors arma gives you are sometimes completely inaccurate (or none at all).

Is there a way to check if a call to a script or function was successful? I read that under isNil from the biki:

Tests whether the variable defined by the String argument is undefined, or whether an expression result passed as Code is undefined. The function returns true if the variable is undefined or the expression result undefined (i.e. the expression result is Void), and false in all other cases.

Ie. Spawn returns a handle, as well as execVM, but what if your calling via (0 = execVm "blah.sqf") or dont have a return for a script/function? will this still evaluate as void/undefined? Can this work with call as well?

Share this post


Link to post
Share on other sites

add a hint to the script with your variables

IE

hint str(["BLAH.sqf",_var1,_var2,_var3]);

or

diag_log str(["BLAH.sqf",_var1,_var2,_var3]); to send it to the rpt

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×