Announcement

Collapse
No announcement yet.

Bug in PB screen output ?

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

  • Bug in PB screen output ?

    I wrote a program in PowerBasic and used it for quite long .
    Suddenly , without making major adaptions to the code i found a strange result :
    Code : Graphic print i ( where i is an integer ) the output on the screen gets something as 922.455461
    Changing the code to Graphic print INT(i) gave the same result .
    As i is a kind of counter the output is running well for some time , suddenly going "crazy" .
    Has anybody an idea what's happening here ?

  • #2
    Certainly, the most likely scenario is that you have a bug in your code. Try using the stepping debugger to isolate it.

    Best regards,

    Bob Zale
    PowerBASIC Inc.

    Comment


    • #3
      Integer printing

      There must be a bug but I don't understand :
      Simtel2 is an integer .
      ......
      GRAPHIC SET POS (0,200 ):GRAPHIC PRINT "number iterations:";INT(simtel2)
      ......

      Gives a non integer output on the screen.
      Curiously other outputted data which are function of simtel2 work correct ...

      Comment


      • #4
        That's why you want to use a debugger to follow the logic.

        Comment


        • #5
          Are you sure the new "INT(simtel2)" completely covered up what was there before?
          Michael Mattias
          Tal Systems (retired)
          Port Washington WI USA
          [email protected]
          http://www.talsystems.com

          Comment


          • #6
            Originally posted by Michael Mattias View Post
            Are you sure the new "INT(simtel2)" completely covered up what was there before?
            yes .
            I did some debug with Trace-on and animation ...
            Where in the Trace-on the value goes like 1,2,3....aso ... as it is expected ..in the Graphic print it is 922 point etcetera ...
            weird .
            Seems as if i overlook something ...

            Comment


            • #7
              Show failing code. Use code tags. Should be compilable.

              Include compiler version number.
              Michael Mattias
              Tal Systems (retired)
              Port Washington WI USA
              [email protected]
              http://www.talsystems.com

              Comment


              • #8
                Print bug

                You suggest I provide the code ? ( it's quite long ) .
                Is it possible that I have a bad memory section ? If yes how can I detect ?
                I use the Windows 8.03 compiler .
                Last edited by Frank Kestens; 2 Feb 2008, 01:31 AM. Reason: addition

                Comment


                • #9
                  Without the code shown we can only guess at what is wrong. As in, is the value of 'simtel2' outside the range for integers?
                  What is wrong may not be where the error is occurring so it would be best to see all the code.

                  Rod
                  Rod
                  In some future era, dark matter and dark energy will only be found in Astronomy's Dark Ages.

                  Comment

                  Working...
                  X