• Pascal Help

    From stizzed@21:4/156 to All on Sat Jun 27 16:52:44 2020
    All,

    Im trying to terminate a pascal program with a specific errorlevel I can
    check for in a 32-bit DOS batch. Ive tried Halt(<errorlevel>) but the batch doesnt pick it up.

    Thoughts?

    Here are my batch lines:

    program.exe
    if errorlevel 99 echo ERRORLEVEL 99
    if errorlevel 98 echo ERRORLEVEL 98
    ...etc to 0

    When I run this with a coded Halt(333) it prints every ERRORLEVEL xx line
    in the batch...

    Thanks in advance!

    .\\ichael Batts
    a.k.a. stizzed (because, why not?)
    SysOp, The ROCK BBS III

    --- Mystic BBS v1.12 A46 2020/06/11 (Windows/32)
    * Origin: The ROCK III - therockbbs.net - TELNET:10023 (21:4/156)
  • From alterego@21:2/116 to stizzed on Sun Jun 28 10:37:03 2020
    Re: Pascal Help
    By: stizzed to All on Sat Jun 27 2020 04:52 pm

    program.exe
    if errorlevel 99 echo ERRORLEVEL 99
    if errorlevel 98 echo ERRORLEVEL 98
    When I run this with a coded Halt(333) it prints every ERRORLEVEL xx line in the batch...

    My DOS memory is rusty, but IIRC, "if errorlevel x", means catch every error level that is x "or greater".

    So if you have your tests in ascending order, it will trip on every one.

    Perhaps you want "if errorlevel <x> goto <label>"?

    ...лоеп

    ... The four stages of man are: infancy, childhood, adolescence and obsolescen --- SBBSecho 3.11-Linux
    * Origin: I'm playing with ANSI+videotex - wanna play too? (21:2/116)
  • From stizzed@21:4/156 to alterego on Sat Jun 27 22:39:19 2020
    On |1528 Jun 2020|08, |15alterego |08said the following...

    Re: Pascal Help
    By: stizzed to All on Sat Jun 27 2020 04:52 pm

    program.exe
    if errorlevel 99 echo ERRORLEVEL 99
    if errorlevel 98 echo ERRORLEVEL 98
    When I run this with a coded Halt(333) it prints every ERRORLEVEL xx in the batch...

    My DOS memory is rusty, but IIRC, "if errorlevel x", means catch every error level that is x "or greater".

    So if you have your tests in ascending order, it will trip on every one.

    Perhaps you want "if errorlevel <x> goto <label>"?

    ...лоеп


    You Sir, are correct! I had the program code right but the batch logic backwards. All fixed now!

    Thanks!!!!!

    .\\ichael Batts
    a.k.a. stizzed (because, why not?)
    SysOp, The ROCK BBS III

    --- Mystic BBS v1.12 A46 2020/06/11 (Windows/32)
    * Origin: The ROCK III - therockbbs.net - TELNET:10023 (21:4/156)