Page 1 of 1 1
Topic Options
#17543 - 2002-02-15 06:57 PM Error Handling?
Tommy Offline
Fresh Scripter

Registered: 2002-02-06
Posts: 5
Is there anything similar to "On Error Resume Next" within KiXtart where it does not throw an error and exit the script?

Thanks,
Tommy

Top
#17544 - 2002-02-15 11:56 PM Re: Error Handling?
bleonard Offline
Seasoned Scripter
*****

Registered: 2001-01-19
Posts: 581
Loc: Chicago, IL
Tommy -
Encountering an error condition will not cause your script to terminate. Scripts improperly formatted (missing closing quotations, incomplete IF/ENDIF or SELECT/CASE/ENDSELECT statements etc.) will cause the script to terminate.

KiX has extensive error codes that are returned (@ERROR/@SERROR), to provide complex scripting possibilities when a condition does not return the 'expected' return value.

So, if your script is aborting, your script needs to be checked. Suggest obtaining the standard for KiX script checking programs created by MCA, kixstrip, available at http://home.wanadoo.nl/scripting

Bill

Top
#17545 - 2002-02-16 08:00 PM Re: Error Handling?
Tommy Offline
Fresh Scripter

Registered: 2002-02-06
Posts: 5
Bill thanks for the reply.

The problem I am having is when I instantiate a custom COM+ Server. If the correct registry keys for the COM object do not exist on the client, the script will terminate. I know I can check to make sure each of the keys/values exist in the registry before instantiating the COM object, but that seams excessive to me. I would like the script to continue if it can’t run the COM object.

Any suggestions appreciated.

Thanks,
Tommy

Top
#17546 - 2002-02-16 08:26 PM Re: Error Handling?
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Hi Tommy,

You can check for successfull object creation like this. This example tries to create script.filesystemobject.22, which doesn't exist ...


break on


$object = createobject("scripting.filesystemobject.22")


if not $object
?"Error instantiating object. taking appropriate steps ..."
else
?"All is well with wsh ..."
endif


exit 1

My assumption here is that failure to instantiate a COM+ object (for whatever reason) will still return back a NULL (not) pointer.

-Shawn

Top
#17547 - 2002-02-17 04:08 AM Re: Error Handling?
MCA Offline
KiX Supporter
*****

Registered: 2000-04-28
Posts: 5152
Loc: Netherlands, EU
Dear,

At this moment nothing with capability is available in KiXtart language.
On the suggestion forum you can find all kind of new wishes.
Shawns reaction is only for specific location in your script. Sometime
necessary to prevent unexpected results.
greetings.

_________________________
email scripting@wanadoo.nl homepage scripting@wanadoo.nl | Links | Summary of Site Site KiXforms FAQ kixtart.org library collection mirror MCA | FAQ & UDF help file UDF kixtart.org library collection mirror MCA | mirror USA | mirror europe UDF scriptlogic library collection UDFs | mirror MCA

Top
#17548 - 2002-02-18 06:19 PM Re: Error Handling?
Tommy Offline
Fresh Scripter

Registered: 2002-02-06
Posts: 5
Thanks for the replies. Shawn's suggestion worked great for this instance. This site and its members are a great resource.

Thanks,
Tommy

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 329 anonymous users online.
Newest Members
gespanntleuchten, DaveatAdvanced, Paulo_Alves, UsTaaa, xxJJxx
17864 Registered Users

Generated in 0.054 seconds in which 0.023 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