Announcement

Collapse
No announcement yet.

PB 9.00.0085 Compiler GPF with Win XP Serv Pack 3

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

  • PB 9.00.0085 Compiler GPF with Win XP Serv Pack 3

    Does anyone else get a compiler GPF with this code ?


    Code:
    #COMPILE EXE
    #DIM ALL
    
    TYPE PAMatrix                                        
       Compensation       (1 TO 2)  AS CURRENCY
       SickPay            (1 TO 2)  AS CURRENCY
       Interest           (1 TO 2)  AS CURRENCY
       Dividends          (1 TO 2)  AS CURRENCY
       EstateTrust        (1 TO 2)  AS CURRENCY
    END TYPE
                  
    FUNCTION PBMAIN () AS LONG
    
       LOCAL   A1 AS CURRENCY
       LOCAL   I, J  AS LONG
       
       DIM PAU  AS PAMATRIX
       
       FOR J=1 TO 2
          FOR I=1 TO 100
            PAU.COMPENSATION(J)+=I         'THIS LINE CAUSES A COMPILER GPF
          ' PAU.COMPENSATION(J)=PAU.COMPENSATION(J)+I  'THIS LINE WORKS
          NEXT
       NEXT
          
       ? "PAU.COMPENSATION(1)="+STR$(PAU.COMPENSATION(1))
       ? "PAU.COMPENSATION(2)="+STR$(PAU.COMPENSATION(2))
        
    END FUNCTION
    Nathan Maddox

  • #2
    It GPF's for me in 9.01 as well.
    Paul Squires
    FireFly Visual Designer (for PowerBASIC Windows 10+)
    Version 3 now available.
    http://www.planetsquires.com

    Comment


    • #3
      Send it to [email protected]
      Scott Slater
      Summit Computer Networks, Inc.
      www.summitcn.com

      Comment


      • #4
        It looks like a bug.
        Both

        c = PAU.COMPENSATION(J)
        c += I
        PAU.COMPENSATION(J) = c

        or

        PAU.COMPENSATION(J) = PAU.COMPENSATION(J) + I

        work instead of PAU.COMPENSATION(J)+=I


        Peter Redei

        Comment


        • #5
          Thank You Paul Squires and others

          I have sent the code to [email protected]

          When I dumbed down the code for posting (so Michael wouldn't ask for it), I inadvertently changed it to "auto-incrementing" a long to a currency.

          In my original code, I was adding currency to currency.

          The GPF seems to be related to the UDT not the data types that
          are added.

          Thanks
          Nathan Maddox

          Comment


          • #6
            Just for

            I went back to PB 8.04 and tried a compile and this is what I got instead of a GPF. (Maybe it can help)

            PowerBASIC for Windows
            PB/Win Version 8.04
            Copyright (c) 1996-2007 PowerBasic Inc.
            Venice, Florida USA
            All Rights Reserved

            Error 415 in O:\POWERB~4\HELPOT~1\NATHAN~1\GPF.bas(27:028): "=" expectedÿÿÿ
            Line 27: PAU.COMPENSATION(J)+=I 'THIS LINE CAUSES A COMPILER GPF
            ==============================
            Compile failed at 10:43:38 AM on 7/2/2009
            Engineer's Motto: If it aint broke take it apart and fix it

            "If at 1st you don't succeed... call it version 1.0"

            "Half of Programming is coding"....."The other 90% is DEBUGGING"

            "Document my code????" .... "WHYYY??? do you think they call it CODE? "

            Comment


            • #7
              Of course you got an error. Compound assignments like += aren't supported in version 8.04.
              Forum: http://www.jose.it-berater.org/smfforum/index.php

              Comment


              • #8
                Code:
                PAU.COMPENSATION(J)+=I         'THIS LINE CAUSES A COMPILER GPF
                ' PAU.COMPENSATION(J)=PAU.COMPENSATION(J)+I  'THIS LINE WORKS
                If line B works and line A don't... call me naive but it sure seems to me there is clearly a problem with the "+=" operator and you done good by sending in the code.
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment

                Working...
                X