Dear,A great suggestion. By modifying our tool kixstrip option /debug
we were missing the possibility of resetting the @error value.
The way of setting it by the UDF SetError was briallant and very simple.
We were using it for the creation of an actual list of KiXtart error codes
(the description and not the mnemonics).
Our script is:
code:
$error_file="t:\kix-error.lst"
;
IF RedirectOutput($error_file,1)
ENDIF
? "KixTart "+@kix+" - Summary Error Codes"
?
FOR $i=0 TO 9999
SetError($i)
IF (len(@serror) <> 0) AND (Instr(@serror,"Error retrieving error information for") = 0) AND (Instr(@serror,", 13D)") = 0)
$pos=Instr(@serror,CHR(13)+CHR(10))
IF ($pos <> 0)
? Substr(" ",1,7-len("$i"))+"@error "+substr(@serror,1,$pos-1)+" "+substr(@serror,$pos+2,len(@serror)-$pos-1)
ELSE
? Substr(" ",1,7-len("$i"))+"@error "+@serror
ENDIF
ENDIF
NEXT
EXIT
FUNCTION SetError($error_number) EXIT $error_number ENDFUNCTION
The result of it is:
code:
KixTart 4.00 RC 1 - Summary Error Codes 0 (null) [0/0]
1 Incorrect function.
2 The system cannot find the file specified.
3 The system cannot find the path specified.
4 The system cannot open the file.
5 Access is denied.
6 The handle is invalid.
7 The storage control blocks were destroyed.
8 Not enough storage is available to process this command.
9 The storage control block address is invalid.
10 The environment is incorrect.
11 An attempt was made to load a program with an incorrect format.
12 The access code is invalid.
13 The data is invalid.
14 Not enough storage is available to complete this operation.
15 The system cannot find the drive specified.
16 The directory cannot be removed.
17 The system cannot move the file to a different disk drive.
18 There are no more files.
19 The media is write protected.
20 The system cannot find the device specified.
21 The device is not ready.
22 The device does not recognize the command.
23 Data error (cyclic redundancy check)
24 The program issued a command but the command length is incorrect.
25 The drive cannot locate a specific area or track on the disk.
.....
2000 The pixel format is invalid.
2001 The specified driver is invalid.
2002 The window style or class attribute is invalid for this operation.
2003 The requested metafile operation is not supported.
2004 The requested transformation operation is not supported.
2005 The requested clipping operation is not supported.
2202 The specified username is invalid.
2250 This network connection does not exist.
2401 This network connection has files open or requests pending.
2402 Active connections still exist.
2404 The device is in use by an active process and cannot be disconnected.
3000 The specified print monitor is unknown.
3001 The specified printer driver is currently in use.
3002 The spool file was not found.
3003 A StartDocPrinter call was not issued.
3004 An AddJob call was not issued.
3005 The specified print processor has already been installed.
3006 The specified print monitor has already been installed.
4000 WINS encountered an error while processing the command.
4001 The local WINS can not be deleted.
4002 The importation from the file failed.
4003 The backup Failed. Was a full backup done before ?
4004 The backup Failed. Check the directory that you are backing the database to.
4005 The name does not exist in the WINS database.
4006 Replication with a non-configured partner is not allowed.
A complete list you can find on topic
http://kixtart.org/cgi-bin/ultimatebb.cgi?ubb=get_topic&f=1&t=002663
It is also very easily to translate above error descriptions in other languages
and to use them in your own scripts.
Greetings.