Author Topic: BCX v7.8.0 is available for download  (Read 587 times)

MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1850
    • View Profile
BCX v7.8.0 is available for download
« on: February 02, 2022, 11:47:21 AM »
Hello Friends,

It's been a while since 7.7.9 was released, and although this is not a huge update,
it does have a few things that should be useful.  See revisions below:

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


REVISIONS

**********************************************************************************************
2022/02/02       Changes in 7.8.0 from 7.7.9
**********************************************************************************************
Robert Wishlaw : Reported $PRJ and $PRJUSE bug  -- Corrected.

Ian Casey      : GetFileName low allocation bug -- Corrected.

Kevin Diggins  : Added LINE INPUT -optional- argument for specifying the memory limit of
                 the receiving variable, including the required null terminator.
                 For example: LINE INPUT FP1, A$, 5000 
                 will read up to but no more than 4999 characters and add a null terminator. 
                 If a default or optional limit is less than the length of any line being
                 read, LINE INPUT will abort the application with a truncation message
                 identifying the program line that detected the truncation, as well as the
                 actual (truncated) line of text that caused the error condition.

Kevin Diggins  : The BCX_RESIZE runtime label was misspelled.  Corrected.

Kevin Diggins  : Renamed internal $BCX_COLORS to BCX_COLORS because $BCX_COLORS is not a
                 formal BCX directive, it is an internal BCX translator constant.

Kevin Diggins  : Added FUNCNAME$ keyword.  This is a case-insensitive keyword that
                 equates to __func__ which is a C99/C++11 macro that returns the name of
                 the FUNCTION or SUB that it is used within.  FUNCNAME$ is intended as one
                 more debugging tool -- useful while you develop your applications. 
                 Below is a simple example:
   
                 CALL Test_Funcname

                 SUB Test_Funcname
                      PRINT "Entering ", FUNCNAME$
                      PRINT "Leaving  ", FUNCNAME$
                 END SUB

Kevin Diggins  : Added compiler-specific header to support the "rdtsc" intrinsic.
                 Tested working with MSVC, Clang, Embarcadero(64-bit only), Mingw, Pelles and Lcc-Win32.
                 Example Below:

                 $BCXVERSION "7.8.0"   ' Requires BCX 7.8.0 or newer
                 PRINT GetCPUSpeed$() 
 
                 FUNCTION GetCPUSpeed$()
                 DIM  STATIC  Start      AS __int64
                 DIM  STATIC  Stop       AS __int64
                 DIM  STATIC  Startticks AS __int64
                 DIM  STATIC  Stopticks  AS __int64
                 DIM  STATIC  StartOld   AS  DWORD
                 DIM  STATIC  StopOld    AS  DWORD
                 DIM  STATIC  Old        AS  BOOL
                 DIM  Buffer$

                 Old = NOT (QueryPerformanceFrequency((LARGE_INTEGER*)&Stop))

                 IF Old THEN
                     StartOld = GetTickCount()
                     WHILE GetTickCount() = StartOld
                        StopOld = StartOld + 1000
                     WEND
                 ELSE
                     QueryPerformanceCounter((LARGE_INTEGER*)&Start)
                     Stop = Stop + Start
                 END IF

                 Startticks = _rdtsc()

                 IF Old THEN
                    WHILE StopOld > StartOld
                       StartOld = GetTickCount()
                    WEND
                 ELSE
                    WHILE Stop > Start
                       QueryPerformanceCounter ((LARGE_INTEGER*)&Start)
                    WEND
                    Stopticks =  _rdtsc()
                    Stopticks =  Stopticks - Startticks
                END IF
                Buffer$ = USING$("#.#",Stopticks/1.0E9) + " Ghz"
                Function = Buffer$
                END FUNCTION

Kevin Diggins  : Added PowerBASIC aliases ACODE$ and UCODE$ to the existing BCX keywords
                 WideToAnsi$ and AnsiToWide$.  W2A$ and A2W$ are secondary aliases to
                 the WideToAnsi$ and AnsiToWide$, if you prefer.

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


MrBcx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1850
    • View Profile
Re: BCX v7.8.0 is available for download
« Reply #1 on: February 02, 2022, 01:45:56 PM »
If you downloaded BCX 7.8.0 before today at 7:30 PM (GMT), you should download it again.

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

The original upload had a minor flaw that has since been corrected.

Sorry for any inconvenience.

-MrBcx-