[fpc-pascal] DOS find

Adam Naumowicz adamn at math.uwb.edu.pl
Fri Feb 3 09:25:30 CET 2006

On Fri, 3 Feb 2006, DONALD PEDDER wrote:

>     Even when nothing is found I still get return code 0! :-\ I need to
> know how many strings were found (or at a minimum if none were found,
> which should theoretically have a non-zero return code. I know it does
> in NT, but at home in DR-DOS/MS-DOS "echo %errorlevel%" isn't working, so
> I can't see directly what return code it's giving, though I'm pretty
> sure it wouldn't be 0 if nothing was found).

You should try

IF ERRORLEVEL 1 echo blah, blah

In this way you will check if the errorlevel is greater or equal 1.

Hope this helps,

Adam Naumowicz

Department of Applied Logic            fax. +48 (85) 745-7662
Institute of Computer Science          tel. +48 (85) 745-7559 (office)
University of Bialystok                e-mail: adamn at mizar.org
Sosnowa 64, 15-887 Bialystok, Poland   http://math.uwb.edu.pl/~adamn/

More information about the fpc-pascal mailing list