Try

Top  Previous  Next

Description


The Try command provides recovery from FreeFlyer error messages, such as "Spacecraft has impacted Central Body" or if a Target loop fails to converge. FreeFlyer suppresses any errors that are produced within the scope of the Try/End block of commands.

 

Syntax


Try stepping a Spacecraft for 100 days:

 

mySpacecraft.A = 6478;
String StartEpoch = mySpacecraft.EpochText;
 
Try;
    While(mySpacecraft.ElapsedTime < TIMESPAN(100 days));
          Step mySpacecraft;
    End;
End;
 
Console.Show();
 
Report "Analysis began at the following Spacecraft Epoch: ", StartEpoch to Console;

Report "   Spacecraft impacted Earth at: ", mySpacecraft.EpochText to Console;

 

Try, while incrementing an ErrorCount variable if an error is encountered:

 

While(mySpacecraft.ElapsedTime < TIMESPAN(100 days));
    Try sending ErrorCount to myVariable;
          Step mySpacecraft;
    End;
    If (myVariable> 0);
          Break;
    End;
End;

 

 

Details


If the "Try sending ErrorCount to ..." syntax option is used, FreeFlyer increments the user-specified "counter" Variable every time an error is encountered and suppressed.

oIn the example shown above, if an error is encountered, the current value of myVariable will be incremented; that is, FreeFlyer will perform this change behind the scenes: myVariable += 1.

 

If an error is encountered, FreeFlyer will exit the Try block and execute any remaining commands in the Mission Plan.

 

 

Command Editor


Send error count to

Variable object which will store a counter indicating the number of errors that have been encountered and suppressed

 

Script

Displays the FreeFlyer Script that is generated by the editor

 

Description

Displays descriptions of the editor and its fields

Description text changes as the mouse pointer moves over the different fields within the editor

 

 

 

See Also


For