Archive: The error flag is not set when using CopyFiles command?


The error flag is not set when using CopyFiles command?
Hi Everyone,

I am using the CopyFiles command, when displaying the copying dialog, I click on the Cancel button to cancel the copy procress. I pop the value but it is empty.

CopyFiles $LocationSetup\* $PROFILE\KCEditTemp

Pop $R8
MessageBox MB_OK "Value2 = $R8"

"The result of this messaage is: "Value2 = "

It seam that the CopyFiles command does not set the flag error when I click the Cancel button.

Everyone who know about this please help!
(I want to get the error flag when the Cancel button is clicked)

Thanks
Hien


Hi Hien,

Why are you popping a value, exactly?

When the manual says that CopyFiles will set 'the error flag', it is referring to the internal error flag. There is a specialized if-test for it:
"IfErrors goto_if_true goto_if_false"

Make sure you call "ClearErrors" before the CopyFiles command - just in case something else before it has already set the flag.


Thanks for your reply,

I use IfErrors to check if the error is set instead of use pop as previously and it works.