Page 1 of 1 1
Topic Options
#160010 - 2006-03-30 02:02 AM What's better? Exit or Quit
dataspike Offline
Getting the hang of it

Registered: 2005-03-09
Posts: 89
Loc: San Diego, CA
What's better to call Exit or Quit?

Does one exit a Function and one exits a entire script?

Just a little confused.

Top
#160011 - 2006-03-30 02:13 AM Re: What's better? Exit or Quit
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
QUIT tells Kixtart to end processing, no matter where in the script you are. EXIT exits the current "context", which to my knowledge is:

mainline script - exit terminates processing
called script - exit leaves the called script
udf - exit leaves the udf

A function (UDF) or called script should (theoretically) never use QUIT.

Top
#160012 - 2006-03-30 10:00 AM Re: What's better? Exit or Quit
Richard H. Administrator Offline
Administrator
*****

Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
Quote:

A function (UDF) or called script should (theoretically) never use QUIT




One obvious exception is something like an ABORT() udf, which logs an exception, tidies up the environment and then exits KiXtart. But generally it is true, it is up to the calling script to decide to exit on a fatal error, not the udf.

Another context which "Exit" exits is the Execute() context. This is most often used to set a return value in the executed code.

A simple view is that Exit works exactly like a Return from the context, whereas Quit is used to exit KiXtart.

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

Generated in 0.052 seconds in which 0.024 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