New Features in Classic PB/CC Version 5

     
  • #ALIGN metastatement aligns the next instruction to a boundary.
  • #BREAK ON metastatement enables "Control-Break" as a means of terminating the program.
  • #BREAK OFF metastatement disables "Control-Break" as a means of terminating the program.
  • #DEBUG CODE ON metastatement activates generation of debug code.
  • #DEBUG CODE OFF metastatement suppresses generation of debug code, from that line, until a subsequent #DEBUG CODE ON (or the end of the Sub/Function/Method/Property) is reached.
  • #DEBUG DISPLAY ON metastatement enables error display mode when an untrapped run-time error occurs within a compiled PowerBASIC program.
  • #DEBUG DISPLAY OFF metastatement suppresses displaying of untrapped error messages.
  • #INCLUDE ONCE metastatement includes a file only one time during compilation, regardless of how many times it appears in the program
  • #OPTIMIZE metastatement chooses between faster execution or smaller code size.
  • #UTILITY metastatement. Compiler directive to allow external utility programs to read text inserted on the #UTILITY line.
  • ACODE$ function may now contain an optional code page parameter. The code page parameter represents the code page to be used for the conversion process.
  • ARRAY SORT statement now offers a custom array sorting option. A custom array may be user-defined types, fixed-length strings, or ASCIIZ strings. With a custom array sort, you can write your own simple function to tell PowerBASIC the correct sequence for any two array elements.
  • ASM statement has been expanded to support the full range of SIMD opcodes. ASM statements may now contain a label - ASM Label: or ! Label:. Support for returning METHOD and PROPERTY return value assignments have been added.
  • BITSE function compares Integer class values for equivalent bits regardless of sign.
  • BGR function now accepts individual red, green, and blue values or a single RGB value.
  • BUILD$ function concatenates multiple strings with high efficiency.
  • CLASS / END CLASS Block creates the code and data for an object.
  • CLIPBOARD GET ITEM statement retrieves a data item from the Windows ClipBoard.
  • CLIPBOARD GET TEXT statement retrieves a string from the Windows ClipBoard.
  • CLIPBOARD RESET statement deletes the contents of the Windows ClipBoard.
  • CLIPBOARD SET ITEM statement stores a new data item in the Windows ClipBoard.
  • CLIPBOARD SET TEXT statement stores a string in the Windows ClipBoard.
  • COMM function has been enhanced to retrieve the Clear-To-Send (CTS) and Data-Set-Ready (DSR) states.
  • COMMAND$ function has been improved with an option to either return the complete trailer, or any one of the arguments.
  • DECLARE statements now support declarations of THREAD FUNCTIONS.
  • DIR$ function has been expanded with an optional ONLY keyword to return only files that match the specified attribute. For example: DIR$(mask$, ONLY %SUBDIR ) just the directory entries which match mask$ are returned. The DIR$ function may optionally assign the complete directory data structure that receives information about the found file or subdirectory. to an appropriate UDT variable if you include the TO clause as a parameter.
  • EOF function now supports an optional # symbol preceding the file number parameter.
  • ERL$ function returns the last label, line number, or procedure name executed prior to the most recent error.
  • EVENTS statement attaches or detaches an event handler to/from an event source.
  • EXE.EXTN$ read-only user defined type returns the extension (with a leading period) of the program which is currently executing.
  • EXE.FULL$ read-only user defined type returns the complete drive, path, and file name of the program which is currently executing.
  • EXE.NAME$ read-only user defined returns just the file name of the program which is currently executing.
  • EXE.NAMEX$ read-only user defined returns the file name and the extension of the program which is currently executing.
  • EXE.PATH$ read-only user defined returns the complete drive and path of the program which is currently executing.
  • EXIT METHOD transfers program execution out of a METHOD structure.
  • EXIT PROPERTY transfers program execution out of a PRPOPERTY structure.
  • FIELD statement has been updated with two new options. FIELD STRING converts a field string to a dynamic string, assigns the current sub-section data to it. FIELD RESET converts a field string to a nul (zero-length) dynamic string.
  • FONT END statement destroys a font when it is no longer needed.
  • FONT NEW statement creates a new font for use with GRAPHIC PRINT, XPRINT, etc.
  • FOR/NEXT statements have been optimized. In certain situations, previous versions of PowerBASIC optimized FOR/NEXT loops to count down instead of up for improved execution speed. This optimization could cause the counter variable to contain a value which was not expected when execution of the loop was complete. This optimization has been improved so that the counter variable value is always correct upon loop completion, even if EXIT FOR was used to force an early termination.
  • FUNCTION/END FUNCTION statements may now be prepended with the word THREAD for clarity and self-documentation.
  • GLOBALMEM ALLOC statement allocates a moveable memory block.
  • GLOBALMEM FREE statement de-allocates a memory block.
  • GLOBALMEM LOCK statement lock a moveable memory block at a specific memory location.
  • GLOBALMEM SIZE statement returns the size of memory block.
  • GLOBALMEM UNLOCK statement unlocks a moveable memory block.
  • GRAPHIC BITMAP LOAD statement has been improved with an optional stretch mode parameter to enhance the quality of bitmaps which are changed in size.
  • GRAPHIC DETACH statement detaches a graphic target (Window or Bitmap) which may be currently attached to the process.
  • GRAPHIC GET LINES statement retrieves the number of lines that can be printed on the graphic target.
  • GRAPHIC GET SCALE statement retrieves the current coordinate limits for the graphic target.
  • GRAPHIC FONT statement has been enhanced to allow the points and style attributes to be optional parameters.
  • GRAPHIC INKEY$ statement reads a keyboard character if one is ready.
  • GRAPHIC INPUT statement reads data from the keyboard from within a Graphic Window.
  • GRAPHIC INPUT FLUSH statement removes all buffered keyboard data.
  • GRAPHIC INSTAT statement determines whether a keyboard character is ready.
  • GRAPHIC LINE INPUT statement reads an entire line from the keyboard from within a Graphic Window or a Graphic Control.
  • GRAPHIC SCALE PIXELS statement sets or resets the graphic coordinate system to pixel coordinates.
  • GRAPHIC SET FONT statement selects a font for the GRAPHIC PRINT, GRAPHIC INPUT, and GRAPHIC LINE INPUT statements.
  • GRAPHIC STRETCH statement has been improved with an optional stretch mode parameter to enhance the quality of resized bitmaps.
  • GRAPHIC WAITKEY$ statement reads a keyboard character, waiting until one is ready.
  • GRAPHIC WINDOW CLICK statement checks whether a GRAPHIC WINDOW has been clicked with the mouse.
  • IDISPINFO.CODE pseudo-object. When OBJRESULT is %DISP_E_EXCEPTION, this Get Property returns a long integer value which represents a more specific error code.
  • IDISPINFO.CONTEXT pseudo-object. When OBJRESULT is %DISP_E_EXCEPTION, this Get Property returns a long integer value which is the context of the topic within the help file (IDISPINFO.HELP$).
  • IDISPINFO.DESC$ pseudo-object. When OBJRESULT is %DISP_E_EXCEPTION, this Get Property returns a string containing a textual, human-readable description of the status.
  • IDISPINFO.HELP$ pseudo-object. When OBJRESULT is %DISP_E_EXCEPTION, this Get Property returns a string containing drive, path, and filename of a Help File with more information about this particular status code.
  • IDISPINFO.PARAM pseudo-object. When OBJRESULT is either %DISP_E_PARAMNOTFOUND or %DISP_E_TYPEMISMATCH, this Get Property returns a long integer value which represents the parameter number of the first parameter which failed to match the requirements needed.
  • IDISPINFO.SOURCE$ pseudo-object. When OBJRESULT is %DISP_E_EXCEPTION, this Get Property returns a string containing a textual, human-readable description of the source of the exception.
  • IDISPINFO.CLEAR pseudo-object. Clears all properties which may have been set by prior execution of IDISPINFO.SET in this thread.
  • IDISPINFO.SET pseudo-object. Sets the properties which for future execution of IDISPINFO.
  • INSTANCE statement declares an INSTANCE variable which is unique to each object.
  • INTERFACE / END INTERFACE Block (Direct) declares a direct object interface and its member Methods/Properties.
  • ISFILE function determines whether or not a file exists.
  • ISINTERFACE function determines whether an object supports a particular interface.
  • ISMISSING function determines whether an optional parameter was passed by the calling code.
  • LET statement has been improved to support compound assignments (+=, -=, *=, /=. \=, &=, AND=, OR=, XOR=, EQV=, IMP=, and MOD=).
  • ME pseudo-variable. A pseudo object variable to reference the current object.
  • METHOD / END METHOD statements defines a Method procedure within a class.
  • MYBASE pseudo-variable. A pseudo object variable to reference the inherited parent object.
  • OBJRESULT$ function returns a string which describes an OBJRESULT (hResult) code.
  • PATHNAME$ function parses a path/file name to extract its component parts.
  • PATHSCAN$ function finds a file on disk and returns the path and/or file name parts.
  • PRINT# statement, when used without any parameters outputs a blank line to the file (i.e. a CR/LF only).
  • PROCESS GET PRIORITY retrieves the Priority Value for the current process.
  • PROCESS SET PRIORITY sets the Priority Value for the current process.
  • PROGID$ function, has been enhanced to accept ProgIDs up to 99 characters, even though COM rules indicate that a ProgID cannot contain more than 39 characters.
  • PROPERTY GET statement retrieves a data value from an object.
  • PROPERTY SET statement assigns a data value to an object.
  • RAISEEVENT statement calls an Event Handler code.
  • RGB function now accepts individual red, green, and blue values or single BGR value.
  • SHELL statement now supports an optional EXIT TO clause. If specified, the exit code of the child process (the value returned by the WinMain function) is retrieved.
  • THREAD CREATE statement now supports an optional stack size parameter to specify the requested size of the stack for this newly created thread.
  • TIX statement measures elapsed CPU cycles.
  • UCODE$ function may now contain an optional code page parameter. The code page parameter represents the code page to be used for the conversion process.
  • UCODEPAGE statement sets the default codepage used for ANSI / UNICODE conversions.
  • THREAD GET PRIORITY retrieves the Priority Value for a thread.
  • THREAD SET PRIORITY sets the Priority Value for a thread
  • WRITE# statement, when used without any parameters outputs a blank line to the file (i.e. a CR/LF only). WRITE# has been extended to allow a trailing comma or semicolon, the final carriage return / line feed is suppressed and replaced with a comma delimiter.
  • XPRINT GET COLLATE statement retrieves the XPRINT collate status.
  • XPRINT GET COLORMODE statement retrieves the XPRINT colormode status.
  • XPRINT GET COPIES statement retrieves the XPRINT copy count.
  • XPRINT GET DUPLEX statement retrieves the XPRINT duplex status.
  • XPRINT FONT statement has been enhanced to allow the points and style attributes to be optional parameters.
  • XPRINT GET PAPER statement retrieves the current paper size/type.
  • XPRINT GET PAPERS statement retrieves a list of supported paper types.
  • XPRINT GET SCALE statement retrieves the current coordinate limits for the host printer page.
  • XPRINT GET TRAY statement retrieves the active printer tray.
  • XPRINT GET TRAYS statement retrieves a list of supported paper trays.
  • XPRINT SCALE PIXELS resets the coordinate system to the original default pixel coordinates.
  • XPRINT SET COLLATE statement changes the XPRINT collate status.
  • XPRINT SET COLORMODE statement changes the XPRINT colormode status.
  • XPRINT SET COPIES statement changes the XPRINT copy count.
  • XPRINT SET DUPLEX statement changes the XPRINT duplex status.
  • XPRINT SET FONT statement selects a font for the XPRINT statement.
  • XPRINT SET PAPER statement sets a new paper size/type.
  • XPRINT SET TRAY statement sets a new active printer tray.

 

Special features of Classic PowerBASIC Console Compiler

  • #STACK sets the program stack size
  • ACODE$() translates unicode strings to ansi
  • ARRAY SORT, SCAN, INSERT, DELETE
  • ARRAYATTR() returns status, data type, subscripts, etc.
  • ASCIIZ strings supported for Windows compatibility
  • Assembler is built-in for opcodes through Pentium class
  • BIN$() allows optional leading zeros to a fixed field size
  • BIT CALC set/reset a bit based upon a dynamic calculation
  • BIT SHIFT, ROTATE, TEST, SET, RESET and TOGGLE
  • BITS() function for bit pattern conversion between signed/unsigned
  • CALLSTK captures the entire stack frame
  • CHOOSE(index&, choice1, choice2...) chooses one of several values
  • CHR$() function may take multiple or a range of parameters
  • Client/Server Network communications using TCP and UDP
  • CLSID$(program_id$) returns the associated CLSID
  • Code pointer variables particularly suitable for callbacks
  • Compile to true machine code for maximum performance
  • Conditional compilation (#IF/#ELSEIF/#ELSE/#ENDIF)
  • CONSHNDL returns the handle of the Console Window
  • Create client COM applications using Dispatch, Direct, Automation, or Dual interfaces.
  • CSET centers data within a string with optional padding character
  • Currency variables with choice of two or four decimal digits
  • Data pointer variables with multiple levels of indirection
  • DECR statement for optimized execution
  • DISKFREE function returns the free space
  • DISKSIZE function returns the disk size
  • Extended-precision (80-bit) floating point variables
  • EXTRACT$() returns characters up to a delimiter
  • FILECOPY Statement supports overwrite of a previous version
  • FILENAME$() function returns the name of an open file
  • FILESCAN obtains the number of strings in a file
  • FLUSH statement ensures file data buffers are written to disk
  • FUNCNAME$ returns the name of the current Sub/Function
  • GUID variables are supported for COM Objects.
  • HEX$() allows optional leading zeros to a fixed field size
  • Huge file sizes greater than 2 Gigabytes are supported
  • IIF(expr, truepart, falsepart) returns one of two values
  • INCR statement for optimized execution
  • ISFALSE and ISTRUE operators
  • ITERATE statement restarts loop structures
  • JOIN$() packs a string array into a dynamic string
  • LINE INPUT #1, x$() reads an entire sequential file
  • MACRO defines a single-line, multi-line, or function Macro
  • MACROTEMP defines Temporary identifiers
  • MAT statement provides optimized Matrix operations
  • MAX() and MAX$() functions take an unlimited number of arguments
  • MIN() and MIN$() functions take an unlimited number of arguments
  • Native support for I/O redirection (STDOUT, STDIN and STDERR)
  • OCT$() allows optional leading zeros to a fixed field size
  • PAGEACTIVE returns the current active page number
  • PAGEVISIBLE returns the current visible page number
  • PARSE$() function extracts a delimited field from a string
  • PARSE assigns each delimited string to an array element
  • PARSECOUNT returns the count of delimited fields in a string
  • PEEK/POKE, PEEK$/POKE$ for memory access
  • PRINT #1, x$() writes an entire array to a sequential file
  • PROFILE creates a complete profile of program execution
  • PUT #1,, x$() writes an entire array to a binary file
  • Quad-word 64-bit integer variables
  • READ$(n) function returns a specific DATA item
  • Register variables for both integer and floating point optimization
  • Regular Expression Search and Replace
  • REMAIN$() returns the remainder of a string after extraction
  • REMOVE$() returns a string with certain characters removed
  • REPEAT$() repeats an entire string expression
  • REPLACE statement replaces characters or expressions
  • RESET var sets a variable or array to zero or null
  • RND(x,y) returns a random integer between x and y
  • ROUND() function rounds a number to n decimal digits
  • SERIAL port communication is directly supported at all speeds
  • SETEOF statement sets the end-file position
  • Short-Circuit expression evaluation optimizes execution speed
  • STRDELETE$() deletes a portion of a string
  • String functions support ANY operator to operate on character basis
  • String functions support negative position to count from string end
  • STRINSERT$() inserts a string into another string
  • STRREVERSE$() reverses the character sequence in a string
  • SUB/FUNCTION may take up to 32 parameters
  • SWITCH(expr1, value1, expr2, value2...) returns one of a series
  • TAB$() expands tab characters to a specified tabstop
  • TALLY() counts the occurrences of a sub-string expression
  • Threads are supported as an intrinsic part of the language
  • THREADCOUNT returns the number of active threads
  • THREADID function returns the thread identifier
  • TRACE creates a trace log of complete program execution
  • TRY, CATCH, FINALLY, END TRY offers structured error handling
  • UCODE$() translates ansi strings to the unicode equivalent
  • User-Defined Types and Unions with optional alignment
  • Unsigned byte, word, and double word variables
  • USING$() function formats one or more expressions
  • Variant variables are supported for COM Objects.
  • VARIANTVT() returns the internal VT data type code
  • VERIFY() validates that all characters in string1 occur in string2
  • Win32 API may be easily accessed, including ODBC and TAPI