Topic: File Rename errors with NOERR set (1 of 3), Read 30 times
Conf: VEDIT Macro Language Support
From: Scott Smallbeck
Date: Monday, July 21, 2003 08:05 PM

When using the following command I am getting blown out of WildFile when errors occur renaming the file. I had hoped the NOERR switch would allow the macro to continue even when errors are encountered.

Command: FRen(@1,@2,NOERR)

Errors that will halt Wildfire:
1. Invalid characters in filename
2. Unable to copy over read-only file


Also, I had hoped to use OK and NOERR together with the File_Rename function but this generates and Invalid Parameter error.


Any assistance or workarounds are appreciated.

Scott Smallbeck
ssmallbeck@...

 


Topic: File Rename errors with NOERR set (2 of 3), Read 30 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Tuesday, July 22, 2003 02:59 AM

On 7/21/2003 8:05:18 PM, Scott Smallbeck wrote:
>When using the following command I am getting blown out
>of WildFile when errors occur renaming the file. I had
>hoped the NOERR switch would allow the macro to continue
>even when errors are encountered.
>
>Command: FRen(@1,@2,NOERR)
>
>Errors that will halt Wildfire:
>1. Invalid characters in filename
>2. Unable to copy over read-only file

Confirmed. NOERR seems to fail here.


>Also, I had hoped to use OK and NOERR together with the
>File_Rename function but this generates an Invalid Parameter error.

I'm able to combine OK and NOERR without a "Parameter error". What version of VEDIT do you use?

Christian

 


Topic: File Rename errors with NOERR set (3 of 3), Read 27 times
Conf: VEDIT Macro Language Support
From: Christian Ziemski
Date: Wednesday, July 23, 2003 09:30 AM

On 7/21/2003 8:05:18 PM, Scott Smallbeck wrote:
>
>Command: FRen(@1,@2,NOERR)
>
>Errors that will halt Wildfire:
>1. Invalid characters in filename
>2. Unable to copy over read-only file

Workaround for 2.:

File_Attrib(@2,1,RESET) just before the FRen()


Possible workaround for 1.:

#xx=Buf_Num // xx should be a free numerical register
Buf_Switch(Buf_Free(EXTRA))
Reg_Ins(@2) // the target filename
// check for invalid characters in filename
Search('|{\,/,:,*,?,",<,>,||}', BEGIN+NOERR)
Buf_Quit(OK)
Buf_Switch(#xx)
if (EM) { // if no invalid character found
File_Rename(...)
} else {
// do some error handling
}


Christian