Path: utzoo!utgpu!water!watmath!clyde!cbosgd!ihnp4!alberta!sask!lowey From: lowey@sask.UUCP (Kevin Lowey) Newsgroups: comp.lang.pascal Subject: Re: TurboP ErrorLevel return question Summary: Answer, Errorlevel in Turbo Pascal Message-ID: <978@sask.UUCP> Date: 6 Jan 88 22:23:14 GMT References: <23@bbking.PRC.Unisys.COM> Organization: University of Saskatchewan Lines: 33 In article <23@bbking.PRC.Unisys.COM>, rmarks@bbking.PRC.Unisys.COM (richard marks) writes: > In Turbo Pascal 3.0 how does one return an ErrorLevel code? The Turbo Pascal HALT command can take an optional integer argument. This argument is the errorlevel to be returned. > Does anyone know how to do this under 4.0 (I have not gotten my > copy of 4.0 yet). Yes, this does work with 4.0. Here is a sample turbo pascal program (without any error checking): program test; var errorlevel : integer; {or word in TP 4.0} begin {test} write ('Enter the number to be returned: '); readln (errorlevel); halt(errorlevel); write ('This line is never executed because a HALT exits the program'); end. {test} This program was supplied off the top of my head, but I think it works #:-) Kevin Lowey LOWEY@SASK.BITNET (preferred) ...!ihnp4!sask!lowey.uucp Kevin Lowey at 140/43 (fidonet) klowey (BIX)