Are there situations where you can NOT override the FA_errno's code?
I have a script that does the following:
- creates an array
- calls a function that populates the array with a list of paragraphs in the FrameMaker document
- executes a while loop that then process this array. The while loops conditional is FA_errno==Constants.FE_Success.
The function returns a FA_errno of -3, which is fine because I was using the ObjectValid method to iterate through the paragraphs so eventually the object will be invalid. My problem is that I cannot override the error code after I exit that funciton. The FA_errno stays set to negative 3. Am I missing something or are there situations that forbid you from overriding the error code?
The relevant code is as follows:
var vDoc=app.ActiveDoc;
var vFlowArray=new Array();
var vFirstPgf=vDoc.MainFlowInDoc.FirstTextFrameInFlow.FirstPgf;
getPgfList (vFirstPgf, vFlowArray);
//due to getPgfList function, the FA_errno is -3 so i am going to overwrite the code
FA_errno=Constants.FE_Success
while (FA_errno==Constants.FE_Success)
//a bunch of stuff occurs in the while condition but i am not showing it because this never evaluates to true
function getPgfList (pPgf,pArray)
{
while (pPgf.ObjectValid())
{
pArray.push (pPgf);
pPgf=pPgf.NextPgfInFlow;
}
}
