Source language: Translate to:

Supress LastError message

NeoBook tips, tricks, code samples and more...

Moderator: Neosoft Support

Supress LastError message

Postby Jim Brammer » Thu Feb 07, 2002 5:22 pm

How can you supress the LastError message with your own message? Would like to capture the LastError durning a file copy with a custom message.



<hr>



Rohlando,

Sorry! This message got buried...

You can go into Book > Book Properties (F6) > Misc

Turn OFF the first checkmark, Display Error Messages. It also says that when it is turned off that error messages will be placed in the [LastError] Global Var.


You could then look at the [LastError] var to determine if there has been an error and decide what to do about it. Something like this...

(Hand Typed - Not Debugged!)

FileCopy "[Source]" "[Destination]"
If "[LastError]" "=" "File not found"
      AlertBox "Error" "The source file was not found"
Else
      If "[LastError]" "<>" ""
              AlertBox "Error" "There was an error during File Copy"
      Else
              AlertBox "Done!" "File Copy Complete"
      EndIf
EndIf




<hr>


Thanks for the info.  
Rohlando
Jim Brammer
 

Return to NeoBook Knowledgebase

Who is online

Users browsing this forum: No registered users and 1 guest