Announcement

Collapse
No announcement yet.

pgm-ctr Error

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • pgm-ctr Error

    I am converting several recursively chained QB programs that were
    originally compiled in PDS 7 to PBDos and trying to run them
    in Win2000. I am encountering Error 9 at pgm-ctr with a floating
    memory address-usually within +-10 lines of the same spot. I can't
    find any specifics on this error, other than it is some type of memory
    error. Does anyone know that the error code of 9 refers to. I am
    usually an Access programmer, so I am just learning DOS memory management.
    DRT

  • #2
    Error 9 in both PB and MSft MS-DOS BASICs is "Array Bounds violation": Using an invalid array susbcript (UBOUND(array)< n < LBOUND(Array)).

    i.e., "Programmer Error"

    MCM


    Michael Mattias
    Tal Systems Inc. (retired)
    Racine WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      Thanks. I was assuming that this wasn't a standard Basic error,
      because the existing code has error trapping routines and runs. I
      had never seen a QB error message with "pgm-ctr" followed by
      a memory address. I had to experiment with different .pif
      settings to allow ntvdm to run virtual arrays and was afraid I
      had inadvertently caused other problems.
      DRT

      Comment


      • #4
        Error 9 is Subscript out of bounds.

        To find the line of the program where the error is happening, load the program with the PB DOS compiler, select Compile, then Find Error, put the address and press Enter.


        ------------------

        Comment


        • #5
          Thanks for the help. The three programs compiled successfully. It was the CCUR() function from QB that was being interpreted as an array.
          DRT

          Comment


          • #6
            It was the CCUR() function from QB that was being interpreted as an array.
            #DIM ALL
            OPTION EXPLICIT


            Whichever language you are in (Microsoft or PB DOS-BASIC), use the option which forces you to declare all variables. That way the CCUR() would get flagged at compile time as "Array not dimensioned"

            MCM
            Michael Mattias
            Tal Systems Inc. (retired)
            Racine WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              These programs are SOTP speghetti code, with their roots in the GWBasic days. If I used Option Explicit they would explode
              I suggested PB to my boss because several of routines have been an inch away from the string space limit for years and I thought Virtual Arrays would buy us some time. So far, so good.
              Thanks for the help, I can take it from here.
              DRT

              Comment


              • #8
                These programs are SOTP speghetti code, with their roots in the GWBasic days....I suggested PB to my boss because several of routines have been an inch away from the string space limit for years ..
                For as long as I have been working in and around the software industry, I continue to be amazed at some of the business decisions I see.

                If you buy a company car, you not only maintain it, but you know in 3-6 years you'll have to bite the bullet and buy a new one.

                Same with a copy machine.

                Same with office furniture.

                So why on earth can't bosses recognize that software, no matter how diligently maintained, has a finite useful life, and realize that every so often you just have to 'bite the bullet' and replace it?

                MCM
                Michael Mattias
                Tal Systems Inc. (retired)
                Racine WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  I've recently been maintaining some rather old basic code,
                  which was running on a Unix machine. I moved it to quickbasic,
                  and then to PB. But the codes almost 20 years old... it's time to
                  start over.

                  On the other hand, I disagree about the car thing My car is 24
                  years old, and runs and looks great.

                  ------------------
                  Jonathan Simpson
                  Jonathan Simpson

                  Comment

                  Working...
                  X