Author Topic: BCX v7.8.9 is available for download  (Read 205 times)

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1431
    • View Profile
BCX v7.8.9 is available for download
« on: June 10, 2022, 12:59:09 PM »
Hello Friends,

This is a much improved version of BCX.  See Revisions.

https://bcxbasiccoders.com/archives/YahooGroups/Bcx_Files_New/Bcx789.zip


REVISIONS
**********************************************************************************************
2022/06/10       Changes in 7.8.9 from 7.8.8
**********************************************************************************************
Robert Wishlaw : Reported bug assigning to underscore-leading string variable names.  (Fixed)

Robert Wishlaw : Provided RTL updates to quiet MINGW indentation warnings. (Yes, that's a thing)

Kevin Diggins  : When BCX translates a UDT, it has always generated a UDT pointer variable
                 using the upper-case of the UDT name and prepended with *LP. You may not
                 always need it but it is automatically created and ready to be used if you
                 do. For example:  given TYPE Foo, BCX will generate: *LPFOO.  Now, BCX 789
                 adds a second UDT pointer, for example, *FOO_PTR, for the same purpose but
                 using a different spelling that some users might prefer instead of *LPFOO.
                 For example:

                 TYPE Foo
                     a AS DOUBLE
                     b AS INTEGER
                     c AS STRING
                 END TYPE

                is translated to:

                typedef struct _FOO
                {
                   double   a;
                   int      b;
                   char     c[BCXSTRSIZE];
                }FOO, *LPFOO, *FOO_PTR;

Kevin Diggins  : Improved user's scalar variable type detection and translation when not using
                 the type-identifying sigils. The changes primarily affect the INPUT, FINPUT,
                 and PRINT commands and expression parsing during translation.  For Example:

                TYPE FOO
                   a AS DOUBLE
                   b AS INT
                   c AS STRING
                END TYPE

                DIM F AS FOO

                F.a = 1.123456789
                F.b = 2
                F.c = "Hello World"

                PRINT "These are our initial values:"
                PRINT F.a
                PRINT F.b
                PRINT F.c
                PRINT

                CALL TestUDT (ADDRESSOF(F))

                PRINT
                PRINT "These were passed back from the SUB:"
                PRINT F.a
                PRINT F.b
                PRINT F.c
                PRINT

                SUB TestUDT (z AS FOO_PTR)
                   DIM K AS FOO
                   COPY_UDT(z, ADDRESSOF(K), SIZEOF(FOO)) ' Copy z contents to K
                   PRINT "These were passed to this SUB"
                   PRINT K.a
                   PRINT K.b
                   PRINT K.c
                   PRINT
                   INPUT "Enter a DOUBLE:  ", K.a
                   INPUT "Enter a INTEGER: ", K.b
                   INPUT "Enter a STRING:  ", K.c
                   COPY_UDT(ADDRESSOF(K), z, SIZEOF(FOO)) ' Copy K contents to z
                END SUB

                SUB COPY_UDT (Source AS PVOID, Destination AS PVOID, Count AS INT)
                   POKE(Destination, PEEK$(Source, Count), Count)
                END SUB

Kevin Diggins  : Created internal functions that makes it easier to identify when a member of
                 a UDT is a SINGLE, DOUBLE, or STRING variable.  These enabled me to improve
                 BCX so that the following correctly translates, compiles and runs:

                 TYPE FOO
                     MYNAME AS STRING
                     a AS SINGLE
                     b AS DOUBLE
                 END TYPE

                 DIM A AS FOO

                 A.MYNAME = "MrBcx"
                 A.a = 1.234567
                 A.b = 1.2345678912345

                 PRINT A.MYNAME               ' OUTPUT: MrBcx
                 PRINT A.a                    ' OUTPUT:  1.234567
                 PRINT A.b                    ' OUTPUT:  1.2345678912345

                 INPUT "Name? "  , A.MYNAME   ' INPUT:  MrBcx
                 INPUT "SINGLE? ", A.a        ' INPUT:  1.234567
                 INPUT "DOUBLE? ", A.b        ' INPUT:  1.2345678912345

                 PRINT A.MYNAME               ' OUTPUT: MrBcx
                 PRINT A.a                    ' OUTPUT:  1.234567
                 PRINT A.b                    ' OUTPUT:  1.2345678912345

Kevin Diggins  : Ongoing formatting improvements to the source, output and runtime code