Page 1 of 1 1
Topic Options
#116048 - 2004-03-12 01:35 PM What does EXIT 87 do?
GSUK Offline
Starting to like KiXtart

Registered: 2004-03-10
Posts: 125
Hi there,

I've just imported the ARRAYENUMKEY UDF and I was wondering what EXIT 87 does? (and EXIT 0) Is 87 a specific exit code? Where would I find a list of these codes? I've only been using Kix for about a week so please forgive me if the answer is blatantly obvious!

******CODE********


function arrayenumkey($regsubkey)
dim $retcode, $subkeycounter, $currentsubkey, $subkeyarray

if not keyexist($regsubkey)
exit 87
endif

$subkeycounter=0
do
$currentsubkey=enumkey($regsubkey,$subkeycounter)
if not @ERROR
redim preserve $subkeyarray[$subkeycounter]
$subkeyarray[$subkeycounter]=$currentsubkey
$subkeycounter=$subkeycounter+1
endif
until @ERROR

$arrayenumkey=$subkeyarray
exit 0
endfunction


****END CODE*******

Thanks in advance!

Glenn

Top
#116049 - 2004-03-12 01:56 PM Re: What does EXIT 87 do?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
These are error codes. See the @ERROR and @SERROR macros and the erro code seciton of the Kixtart Manual. Win32 error codes are also listed under http://msdn.microsoft.com/library/default.asp?url=/library/en-us/debug/base/system_error_codes.asp.

Error 87 = The parameter is incorrect. ERROR_INVALID_PARAMETER

Also, how are we supposed to help you debug your code if you don't even post the code but just the UDF itself? See also the FAQ Forum on how to use UDFs.


Edited by sealeopard (2004-03-13 03:17 AM)
_________________________
There are two types of vessels, submarines and targets.

Top
#116050 - 2004-03-12 02:07 PM Re: What does EXIT 87 do?
GSUK Offline
Starting to like KiXtart

Registered: 2004-03-10
Posts: 125
(how are we supposed to help you debug your code if you don't even post the code but just the UDF itself?)

I haven't got that far yet mate! I was jumt importing the UDF and wondered what EXIT 87 does. If I do have problems debugging I will let you know.

Top
#116051 - 2004-03-12 03:53 PM Re: What does EXIT 87 do?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Jens:

50 wet-noodle lashes to you for mis-spelling KiXtart!

GSUK:

The error messages are pretty standard, and you can find lists online - as Jens pointed out. They are not really specific to Kix - most programs return them of some kind. An error of 0 (zero) means Success - no error occurred. This is handy, as you can
Code:
 
$Answer = Function()
If @ERROR
'Failed!' ?
' Error was - @SERROR' ?
EndIf


Simple test of @ERROR being true means some kind of error occured - then you can potentially figure out what kind of error and perform an alternate or corrective action.

Many people simply return 0 on success and 1 (Incorrect Function) on failure. Jens is returning a more descriptive and appropriate error message - "Incorrect Parameter".

If you want an exercise that will show you the error messages and how they are returned & interpreted, try something like this:
Code:

For $X = 0 to 50
DoTest($X)
@SERROR ?
Next

Function DoTest($EC)
Exit $EC
EndFunction



Armed with an error code list, you can return an appropriate exit code from a UDF you've written.

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#116052 - 2004-03-12 06:49 PM Re: What does EXIT 87 do?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Glenn:

I had my type-ahead optimizer activated. This causes me to sometimes type characters faster than they're supposed to be typed, thus an 'and' might turn into an 'nad'. ;-)

GSUK:

Just running the UDF code itself should not create any error code at all.
_________________________
There are two types of vessels, submarines and targets.

Top
#116053 - 2004-03-12 10:50 PM Re: What does EXIT 87 do?
Allen Administrator Offline
KiX Supporter
*****

Registered: 2003-04-19
Posts: 4567
Loc: USA
Jens... just trying to use the link you provided... it has a period on the end that keeps it from working... thanks for the link though.
Top
#116054 - 2004-03-13 12:57 AM Re: What does EXIT 87 do?
Glenn Barnas Administrator Offline
KiX Supporter
*****

Registered: 2003-01-28
Posts: 4402
Loc: New Jersey
Well then, it's a pretty strange concept of "optimizing"!

Glenn
_________________________
Actually I am a Rocket Scientist! \:D

Top
#116055 - 2004-03-13 01:39 AM Re: What does EXIT 87 do?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Tihs is so ture
Aoccdrnig to a rscheearch at Cmabrigde Uinervtisy, it deosn't mttaer in waht oredr the ltteers in a wrod are, the olny iprmoetnt tihng is taht the frist and lsat ltteer be at the rghit pclae. The rset can be a total mses and you can sitll raed it wouthit porbelm. Tihs is bcuseae the huamn mnid deos not raed ervey lteter by istlef, but the wrod as a wlohe.
Amzanig huh?
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
#116056 - 2004-03-13 03:13 AM Re: What does EXIT 87 do?
NTDOC Administrator Offline
Administrator
*****

Registered: 2000-07-28
Posts: 11631
Loc: CA
Huh!!

Dude think you need a new keyboard or spell checker there.

Top
#116057 - 2004-03-13 03:19 AM Re: What does EXIT 87 do?
Sealeopard Offline
KiX Master
*****

Registered: 2001-04-25
Posts: 11165
Loc: Boston, MA, USA
Yeah, teh barin hsa icnreidble pattren-macthing capbaliiteis.
_________________________
There are two types of vessels, submarines and targets.

Top
#116058 - 2004-03-13 03:33 AM Re: What does EXIT 87 do?
Kdyer Offline
KiX Supporter
*****

Registered: 2001-01-03
Posts: 6241
Loc: Tigard, OR
What? You have not heard of IESpellcheck?

http://www.iespell.com/

Kent
_________________________
Utilize these resources:
UDFs (Full List)
KiXtart FAQ & How to's

Top
#116059 - 2004-03-13 03:34 AM Re: What does EXIT 87 do?
Les Offline
KiX Master
*****

Registered: 2001-06-11
Posts: 12734
Loc: fortfrances.on.ca
Lkoos liek Botosn Uinervtisy is donig teh saem stduy.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 764 anonymous users online.
Newest Members
ManuvdWielNL, Sir_Barrington, batdk82, StuTheCoder, M_Moore
17887 Registered Users

Generated in 0.037 seconds in which 0.014 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org