Things that are extentions to QB, PDS or QBasic:

Added 07/15/04:
BCET now has the ability to compile GUI programs.  Two new metacommands were added to support this. 

  • REM $OPTION: WinGUI    BCET compiles a GUI program. 

  • REM $OPTION: WinCON   This is the default and BCET compiles a Console program. 

  • A change was made to handle some special cases when calling the API.  Some API calls have the ability to accept either an integer in the low order word of a long or a pointer to a string. 
    For Example: 
    Declare Function LoadIcon StdCall Lib "user32" Alias "LoadIconA"
                 (ByVal hInstance As Long, ByVal lpIconName As ANY) As Long 

    If 'lpIconName' is any kind of number, it it passed as a BYVAL LONG, and if it is any kind of string, it it passed as a BYVAL STRING. 

    In order to facilitate API callback where you have to provide the address of a call back routine, I have redefined the meaning of 'SEG' when used as a function to return the address of a FUNCTION or SUB. 
    The declare would look like: DECLARE FUNCTION SEG& (FUNCTION or SUB name), if a declare were needed.  An example of this usage is in the 'generic' sample. 

    It is now possible to create a FUNTION or SUB with other than Basic calling conventions.  The only calling convention tested has been 'StdCall', in the 'generic' sample. 

    In a GUI program, any attempt to perform normal screen operations, such as, PRINT, LOCATE, COLOR, CLS, ... will result in an error of some kind. 

    Added 10/04/03:
    It now possible to use a variable length string in a TYPE.  HOWEVER, any attempt to read or write a variable DIMmed from such a type will NOT work.  On output, what will be written is the VARPTR to the string descriptor, and reading it back and trying to use it would cause a string pool error of some kind.  A variable DIMmed from a TYPE containing a variable length string is only really useful for passing a large number of strings to a sub or function in the case you don't wish to make them COMMON or SHARED. 

    Because BCET uses a common source for both the 16-bit development version and the 32-bit release version, it became necessary to add a few extra MetaCommands: 

    • REM $IGNORE:#
      BCET ignores this line and the following # lines. 

    • REM $PROCESS: (a basic statment - has to fit all on 1 line)
      BCET processes the line (PDS sees a comment). 

    • REM $INC: 'filenanme'
      BCET processes an include file (PDS doesn't). 

    • REM $STRINGPOOL:#[k|m] 
      This was added to allow the user to specify the string pool size, which is allocated during runtime intialization, and can not be changed.  (This will be ignored in the Beta version - you get whatever the runtime has been hard coded for).  Set minimum string pool size - max is 2^32-1, however windows will usually run out of memory far below that size. 

      This was added because I think that it is useful: It forces the compiler to complain about the first occurance of any variable that has no declare.  Undeclared variables sometimes causes the compiler to mess up - badly.  This can also be enabled with a command line option. 

    • The DECLARE statement has been expanded to allow calling windows API's. 
      DECLARE {FUNCTION | SUB } name [LIB "libname"] [STDCALL | SYSCALL | CDECL | BASIC | FORTRAN | PASCAL] [ALIAS "real name"] [([parameterlist])] [AS type]
      Most windows API's are STDCALL, but a few are CDECL.  VARARGS is not supported. 

    Some other helper routines that have been added to the runtime: (DECLARES are in 'Helper.Dec') 

    • DECLARE FUNCTION LastShellReturnCode& ()
      Gets the return code from the last SHELL statement. 

    • DECLARE FUNCTION GetMouseFlag& (FlagPtr AS LONG)
      DECLARE FUNCTION GetMouse& ()
      DECLARE FUNCTION GetKeyFlag& (FlagPtr AS LONG)
      DECLARE FUNCTION GetInput& ()
      DECLARE FUNCTION GetInputFlag& (FlagPtr AS LONG)
      These functions allow you to get keystrokes, mouse cursor movememt, and mouse clicks.  Refer to the sample program 'GetIn.Bas' for more info.  They are not yet documented any futher as the return information may change somewhat in the future. 

      ' used to copy a char * * to a array of longs. 

      ' used to copy a char * to a Basic string. 

    • DECLARE SUB GetCharPP (BYVAL charPP AS LONG, BYVAL OptionalElementLength AS LONG, Array() AS STRING)
      ' used to copy a char * * to a string array. 

      ' used to copy a struc to a TYPE.  (watch for padding headaches). 

    • GetLongPP, GetCharP$, GetCharPP, and GetStruc are used to get data returned from a windows API call into a form that can be used in Basic.  They will be documented more fully at a later time. 

    Other extentions will be listed here as they get added or as I remember them. 

    Copyright © 2003-2004 by John L Wright, Jr    Last Modified: 07/15/2004