Announcement

Collapse
No announcement yet.

Not Compiling in the IDE

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

  • Not Compiling in the IDE

    Greetings All!

    I've recently changed a core SUB in my program and now the program won't run completely from within the IDE. PowerBASIC gives me the error "Error 6: Overflow".

    The calculation for that line is still correct; but, that's where the IDE stops at. When I compile to an EXE and then run the program, everything is fine and seems to work as it did before the SUB change.

    Any comments or ideas?

    ------------------
    Don Ewald
    mailto:[email protected][email protected]</A>
    Donnie Ewald
    [email protected]

  • #2
    Sounds like you've got an overflow! Show us the line in question.

    ------------------
    Tom Hanlin
    PowerBASIC Staff

    Comment


    • #3
      It runs without a run-time error as an EXE file, but not in the IDE? That suggests the two were compiled with different $ERROR settings.

      Add <U>$ERROR ALL ON</U> to your program. Once you can identify the line that the error is occurring, then as Tom says, you can show it (and possibly the surrounding code) to us and we may be able to spot something.


      ------------------
      Lance
      PowerBASIC Support
      mailto:[email protected][email protected]</A>
      Lance
      mailto:[email protected]

      Comment


      • #4
        Greetings!

        I've taken a piece of code I found by Randall L. Glass in the ABC Archives and implemented it into my RPGSort program. I use a lightly edited version of his Encode/Decode routine to encrypt and decrypt my accompanying database.

        Lance:
        It runs without a run-time error as an EXE file, but not in the IDE? That suggests the two were compiled with different $ERROR settings.
        Nope. I simply hit F9 to run from within the IDE and Alt-F9 to compile to an EXE file. F9 doesn't work and the compiled program did.

        Lance:
        Add $ERROR ALL ON to your program.
        This was interesting. It stopped with an Overflow error at a totally different piece of code than before. I then added that line into Mr. Glass' original program and surprisingly the error was found there as well.

        Tom:
        Sounds like you've got an overflow! Show us the line in question.
        Here is a link to Mr. Glass' code with the added $ERROR ALL ON line at the beginning. I would be much obliged if you fine folks could correct the slightly faulty code.


        ------------------
        Don Ewald
        mailto:[email protected]indless.com[email protected]</A>
        Donnie Ewald
        [email protected]

        Comment


        • #5
          The July, 1996 BASICally Speaking contains an article, "Debugging PowerBASIC Programs" which may be of some use to you. It is strictly for PB/DOS and contains a bunch of techniques.

          While you can get paper archive copies from IMS (www.infoms.com) for $4.00 US, tell you what I'll do:

          If someone has a web site where I can post it, I'll release the text to the public for download. (The sample code is alredy available as public domain. The text will remain copyright but free for personal use).

          Drop me a note at the email address below if you are willing to provide "web space". (The text is all of about 12Kb).




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

          Comment


          • #6
            In the future, you can make it easier for us by pointing out the line in question:

            EncodeNo? = rnd*256 +LineAsc?

            The problem is clear to see. The "?" suffix means a BYTE variable, which may have a value of 0 to 255. However, RND*256 may be greater than 255 itself, and then another byte value is added to it... overflow! I'm guessing that the program works anyway if you ignore the error, because the code intends to ignore the parts that overflow. A cleaner solution would be to use integers, so:

            EncodeNo% = (rnd * 256 + LineAsc%) AND 255

            The decoder would need a similar modification.

            ------------------
            Tom Hanlin
            PowerBASIC Staff

            Comment


            • #7
              Greetings!

              I took Mr. Hanlin's direction and applied it to Mr. Glass' source code with one other modification to the decode routine as it was only decoding the first seventy-four characters. Fortunately, it works quite nicely now.

              I edited the code in RPGSort and thankfully, it did take care of the Overflow problem. With $ERROR ALL ON, it now discovers a problem with running out of string space and I'll tackle that after work tonight.


              ------------------
              Don Ewald
              mailto:[email protected][email protected]</A>
              Donnie Ewald
              [email protected]

              Comment


              • #8
                Greetings Michael!

                I sent an email to "[email protected]" and it was bounced back as "Nondeliverable."

                Feel free to email me the article and I'd be willing to post it on the internet. My most updated site is at:
                http://reonis.d2g.com

                ...though it doesn't accept uploads yet. I can give you FTP access to upload it if you'd prefer.


                ------------------
                Don Ewald
                mailto:[email protected][email protected]</A>
                Donnie Ewald
                [email protected]

                Comment

                Working...
                X