DOSin about


I need to work with dos and QB at the same time and I'm not sure how.

I'm running a program for QB using a shell command. I want to then pick up the errorlevel and use it in my program.
Does anyone know how to do it? Would it be easist to pipe the errorlevel into a file and retreave it from there?


The solution to the problem changes the problem


  • I'm sure in QB45(only in qb45) there is a hiden function to retrive and send the error level. It is not documented so you have to search for it on other qbasic messege boards and turorials or you can also ask in assembler programming how to retrieve the error level. You can use an utility like unlib and unlib all qbasic libraries (I thing qb.lib) and search for a strainge module and disasemble it to see what arguments you need to pass.

    I know that qbasic has a function like that from a small help program (writen in qbasic). I had many examples of qb code (like svga libraries, how use long filenames in qb and other)

  • Ok, to get the errorlevel you must use an interrupt
    function GetErrorLevel%()
    dim reg as RegType
    dim temp%, offs% = &h4d00h
    interrupt &h21, reg,reg
    temp% =
    def seg = varseg(temp%)
    def seg
    end function

    Try it and tell me if it works or not

    If this function is called it reset the error level to 0 so store it in variable
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


In this Discussion