Hi Shef, Script Units can only access variables of other Script Units if a USEUNIT is included.
In Script Unit ErrorReported.sj, you do not have a USEUNIT for Unit1.sj, which has the global Array, therefore it cannot access it.
The problem you will have though is that JScript does not allow circular references, i.e. because Unit1.sj contains //USEUNIT ErrorReporter, ErrorReporter,sj CANNOT contain //USEUNIT Unit1
In your case, the only option is to move var vectErrMsgs = new Array(); into ErrorReporter.sj
ErrorReporter.sj
var vectErrMsgs = new Array();
function ReportError(strErrCategory, strErrText, strErrOrigin, bCapDesktop)
{
var myDesktopPic = null;
if ((bCapDesktop ==null) || (bCapDesktop!= false))
myDesktopPic = Sys.Desktop.Picture(); //Take picture of the desktop
var strMessageText = strErrCategory + " - " + strErrText + "\n\n" + strErrOrigin;
vectErrMsgs.push([myDesktopPic, strMessageText]); //push err message text into an array.
return true;
}
but this may not be what you are wanting to acheive.
Regards,
Phil Baird