Announcement

Collapse
No announcement yet.

PBWin 9 and Point

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

  • PBWin 9 and Point

    A lot of my applications hold a variable called 'Point'.
    For some reason PB9 seems to object to that, although Point isn't mentioned as a reserved word...
    Did I miss something? (I get: "Duplicate name definition: POINT")

    Code:
    #Compile Exe
    #Dim All
    
    Function PBMain()
      Local Point As Long
    End Function
    Regards,
    Peter

  • #2
    POINT is a built-in structure in the new compilers.
    Forum: http://www.jose.it-berater.org/smfforum/index.php

    Comment


    • #3
      I didn't find that anywhere in the helpfile...
      Regards,
      Peter

      Comment


      • #4
        > didn't find that anywhere in the helpfile...

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

        Comment


        • #5
          A list of reserved words here:
          http://www.powerbasic.com/support/pb...light=reserved
          Rod
          I want not 'not', not Knot, not Knott, not Nott, not knot, not naught, not nought, but aught.

          Comment


          • #6
            Hi Peter;

            FWIW when I run into this problem, my solution is to change the spelling of the word. changing Point to Pointe will, probably, solve the problem. How practical this suggestion depends on how many applications and how often Point is used.

            I agree that you should report this to PB support. Hopefully, the documentation can be updated in time for the release of 9.02.

            Comment


            • #7
              I could not find POINT documented, so I started searching the Win32Api.inc (Thinking that I could SWEAR that I had seen it documented before, but maybe I was thinking of POINTAPI???)

              Anyways while searching I found many references that I also can not find documented such as
              Code:
              aptl(0 TO 0) AS POINTL  ' array size may vary (fake type)
              A variable array size within a TYPE??? huh :confused2:

              I found it in
              Code:
              TYPE EMRPOLYBEZIER16
                pEmr AS emr
                rclBounds AS RECTL      ' Inclusive-inclusive bounds in device units
                cpts AS DWORD
                aptl(0 TO 0) AS POINTL  ' array size may vary (fake type)
              END TYPE
              and many other "Fake Types"
              Still can not find POINT but still looking as I KNOOOOWWWwwww I saw it somewhere????
              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


              • #8
                POINT

                The POINT structure defines the x- and y- coordinates of a point.

                Code:
                TYPE POINT
                   x AS LONG
                   y AS LONG
                END TYPE
                Members

                x Specifies the x-coordinate of the point.

                y Specifies the y-coordinate of the point.
                Forum: http://www.jose.it-berater.org/smfforum/index.php

                Comment


                • #9
                  Anyways while searching I found many references that I also can not find documented such as
                  Code:
                  aptl(0 TO 0) AS POINTL  ' array size may vary (fake type)
                  The help file doesn't document the Windows API. Search in the Microsoft documentation.

                  Code:
                  A variable array size within a TYPE??? huh :confused2:
                  Yes. PB doesn't support it, so you will need to make your own declaration with aptl dimensioned with as many elements you will need.
                  Forum: http://www.jose.it-berater.org/smfforum/index.php

                  Comment


                  • #10
                    >A variable array size within a TYPE??? huh

                    The EMRPOLYLINE16, EMRPOLYBEZIER16, EMRPOLYGON16, EMRPOLYBEZIERTO16, and EMRPOLYLINETO16 structures contain members for the Polyline, PolyBezier, Polygon, PolyBezierTo, and PolylineTo enhanced metafile records.
                    Code:
                    typedef struct tagEMRPOLYLINE {
                      EMR    emr; 
                      RECTL  rclBounds; 
                      DWORD  cpts; 
                      POINTS apts[1]; 
                    } EMRPOLYLINE16,     *PEMRPOLYLINE16,
                      EMRPOLYBEZIER16,   *PEMRPOLYBEZIER16,
                      EMRPOLYGON16,      *PEMRPOLYGON16,
                      EMRPOLYBEZIERTO16, *PEMRPOLYBEZIERTO16,
                      EMRPOLYLINETO16
                    ...
                    apts
                    Array of 16-bit points, in logical units.
                    Michael Mattias
                    Tal Systems Inc. (retired)
                    Racine WI USA
                    [email protected]
                    http://www.talsystems.com

                    Comment


                    • #11
                      Well now that I know a variable array can be used in a type (Although Unsupported) I have yet another thing to test for in a different project I have been working on.

                      Just in the case it is used (Again Although NOT supported, and IMO not to be used until it is supported) it is a check I should perform.

                      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


                      • #12
                        The use of DIMENSIONED arrays in types IS SUPPORTED, what is not supported is the use of dynamic arrays.
                        Forum: http://www.jose.it-berater.org/smfforum/index.php

                        Comment


                        • #13
                          >Well now that I know a variable array can be used in a type

                          A [user-defined] TYPE (upper case, intentional) is simply a source-code level tool provided by the compiler. You can make anything into a "TYPE" of some kind.

                          Heck, you can make a long integer into a type:

                          Code:
                          TYPE MyLong
                             LOWORD  AS WORD
                             HIWORD   AS INTEGER
                          END TYPE
                          You could use this if you had, say, some kind of phobia about using LO(WORD, longVar&) or HI(INTEGER, longVar&)

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

                          Comment

                          Working...
                          X