This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.
For more information, see this announcement post . Click the X in the top right-corner of this box to dismiss this message.
Old posts that have not been replied to for several years.
T
TeDDyBeeR
Post
by TeDDyBeeR » Wed Nov 27, 2002 7:29 am
Hello Can someone help me out...
I try to copy a file (i know that command) but i want to catch the error message of it... but if there is now errormessage then the bot zefl will give an error
Code: Select all
proc { ... } {
....
catch {[file copy -force ${rtmemomem} ${rtmemotmp}]} errMsg
putlog "Result: $errMsg"
if {$errMsg == ""} {
.....
} else {
......
}
}
if there is an error 'errMsg' wil be text else the bot will generate this error:
This error will generate when 'errMsg' is noting ot is not set
already thx for thous hwo can hel pme out
greets TeDDyBeeR
ppslim
Revered One
Posts: 3914 Joined: Sun Sep 23, 2001 8:00 pm
Location: Liverpool, England
Post
by ppslim » Wed Nov 27, 2002 7:54 am
Note your use of the catch command
Code: Select all
catch {[file copy -force ${rtmemomem} ${rtmemotmp}]} errMsg
You have enclosed the file command within [].
You should use it without this.
Think of the catch command, as a wrapper
Code: Select all
file copy -force ${rtmemomem} ${rtmemotmp}
You wrap this command with catch.
T
TeDDyBeeR
Post
by TeDDyBeeR » Wed Nov 27, 2002 8:30 am
oke so i must user this code :
Code: Select all
catch {file copy -force ${rtmemomem} ${rtmemotmp}} errMsg
i will try it
thx PPSlim
T
TeDDyBeeR
Post
by TeDDyBeeR » Wed Nov 27, 2002 8:36 am
It works great
Thx agian PPSlim
Problem is solved. No other solutions need
Greetz TeDDyBeeR