Lasso Soft Inc. > Home

[File_CurrentError]

[File_CurrentError] reports the last error reported by a file tag. This tag can only be used within [File_Control] ... [/File_Control] tags. Accepts an optional keyword -ErrorCode that returns the error code rather than the error message.

  • Syntax
  • Parameters
[File_Control]
  ... File Tags ...
  [File_CurrentError] 
  [File_CurrentError: -ErrorCode]
[/File_Control]

<?LassoScript
  File_Control;
    ... File Tags ...
    File_CurrentError;
    File_CurrentError: -ErrorCode;
  /File_Control;
?>
Optional Parameters
-ErrorCode If specified, the current error code is returned rather than the current error message.
Examples

To check whether an error occured after performing a file tag:

Use the [Error_CurrentError] tag. This tag is only defined within the [File_Control] ... [/File_Control] tags. In the following example, the error status is returned after a [File_Copy] operation is performed.

<?LassoScript
  File_Control;
    File_Copy: '/myfile.txt', '/LogFiles/myfile.txt';
    Output: (File_CurrentError: -ErrorCode) + ': ' + (File_CurrentError);
  /File_Control;
?>
Result:
0: No Error
Tag Link [File_CurrentError] Category File
Type Substitution Data Source Any
Support Preferred Version 3.0
Output Type String or Integer Security Tag,File
Implementation Sets Lasso 5.0,LDML3x

Please note that periodically LassoSoft will go through the notes and may incorporate information from them into the documentation. Any submission here gives LassoSoft a non-exclusive license and will be made available in various formats to the Lasso community.

LassoSoft Inc. > Home

 

 

©LassoSoft Inc 2015 | Web Development by Treefrog Inc | PrivacyLegal terms and Shipping | Contact LassoSoft