PB/CC 2.0
What's new in PB/CC 2.0?
Build-in TCP/IP Support
- Serial Communications (COM) Support
-
Regular Expressions
Bin$
DiskFree
DiskSize
ErrApi
Extract$
FileAttr
FileCopy
Filename$
Get$
Hex$
Host Addr
Host Name
Instr
Lbound
Lset
MCase$
Mid$
Oct$
Parse$
ParseCount
Put
Redim
Remain$
Reset
Rset
Sleep
StrDelete$
StrInsert$
StrReverse
Ubound
New Features (General)
Bin$
Converts a long integer to a binary string representation. A new feature is the optional length parameter - it can return a string of up to 32 digits, aligned with leading zeros. If the length is zero or missing, the returned string has the number of digits necessary to accurately represent the number.
Back
DiskFree
Returns the free space on the specified drive. The drive may be a drive letter, a network name, or the default drive.
Back
DiskSize
Returns the total space on the specified drive. The drive may be a drive letter, a network name, or the default drive.
Back
ErrApi
Returns the Windows Error Code number (when it is available), after an exception occurs. It may not always be available (could return zero), and is mainly designed to be used in advanced debugging issues.
Back
Back
FileAttr
Returns the device type (Diskfile, Char device) and connection type (Comm, TCP)
Back
FileCopy
Copies a disk file; Overwrite allowed.
Back
FileName$
Returns the name of an open file handle.
Back
Get$
When GET is used to read a random file to a dynamic string, it normally expects the first two bytes of the record to contain a length word to define the length of the valid data in the record. Optionally, it can now be presumed that no length word exists, and the number of bytes to read is defined by the current length of the dynamic string variable. If the variable length is greater than the file record length, the remainder of the string variable is filled with nulls: chr$(0). This offers greater compatibility with the actual operation of other versions of Basic, such as PowerBASIC for DOS.
Back
Hex$
Converts a long integer to a hexadecimal string representation. A new feature is the optional length parameter - it can return a string of up to 32 digits, aligned with leading zeros. If the length is zero or missing, the returned string has the number of digits necessary to accurately represent the number.
Back
Host Addr
Tranlates a host name into the corresponding ip address. If the hostname is null, or not given, then the ip address of the local computer is returned.
Back
Host Name
Tranlates a host name into the corresponding ip address. If the hostname is null, or not given, then the ip address of the local computer is returned.
Back
Instr
The optional starting position can now be a negative number. If negative, the target string is searched from right to left for the first occurrence of the sub-string. If -1, the search begins at the last position. If -2, the search begins at the second to last position, and so forth. If the position evaluates outside the string on either side, then zero is returned.
Back
Lbound
Lbound of an undimensioned array returns zero.
Back
Lset
Left justifies a string within a string, but leaves the the balance of the string unchanged, not space-filled.
Back
MCase$
Forces the string contents to mixed case. The first letter of each word is upper case, and the remaining characters are forced to lower case.
Back
Mid$
The starting position can now be a negative number. When negative, the starting position is assumed to be n characters from the end of the string. If that parameter evaluates to a position outside of the string on either side, no operation is performed.
Back
Oct$
Converts a long integer to an octal string representation. A new feature is the optional length parameter - it can return a string of up to 32 digits, aligned with leading zeros. If the length is zero or missing, the returned string has the number of digits necessary to accurately represent the number.
Back
Parse$
Returns a delimited field found in a string. If the field if negative, the string is parsed from right to left, so that -1 returns the last sub-string, -2 returns the second to last, and so on. If the field evaluates to zero, or outside of the actual field count, a nul string is returned. The field delimiter can be one, or more characters in length. Optionally, each appearance of any single delimiter character can be considered to be a valid delimiter. If not specified, standard comma-delimited fields are presumed.
Back
ParseCount
Returns a count of the number of delimited fields found in a string. These delimiters can be userdefined - otherwise standard comma-delimited fields are presumed.
Back
Put
When PUT is used to write a dynamic string to a random file, it normally precedes the actual data with a two-byte binary length word to define the number of valid bytes in the record. Now you also can optionally leave out these length words, and only write the actual data, subject to the defined random record length.
This offers greater compatibility with the actual operation of other versions of Basic, such as PowerBASIC for DOS.
Back
Redim
Redim may be used to alter the size of Static and Global arrays.
It can also be used to erase array contents and deallocate its memory, even if the array is Static or Global.
Back
Remain$
Returns the portion of a string which follows the first occurrence of a specified character or sub-string. Remain$ is the natural complement to the Extract$ function.
Back
Reset
Sets a scalar variable or user-defined type to zero/nul.
It can also set all elements of the array to zero or nul, but does not deallocate the memory, leaving it available for re-use.
Back
Rset
Right justifies a sub-string within a string but leaves the the balance of the string unchanged, not space-filled.
Back
Sleep
Pauses the application for the specified number of milliseconds, while allowing other processes to execute.
Back
StrDelete$
Cuts out a sub-string from the middle of an existing string.
Back
StrInsert$
Inserts a sub-string into the middle of an existing string.
Back
StrReverse
Returns a string with the character sequence reversed from that of the original.
Back
Ubound
Ubound of an undimensioned array returns minus one, so that Ubound-Lbound+1 yields zero elements.
Back
New Features (General)
- Array Sort and Scan operations now execute approximately 35% faster than previous versions with floating point data.
- Labels and line numbers are now local to the procedure; that is, a label name may be reused in multiple functions. However, due to syntactical ambiguity regarding global variables, any name used as a label in any procedure is thereafter reserved from use as a variable, sub, or function name.
- MetaStatements may now optionally begin with a pound sign (#) in place of a dollar sign ($). Programmers are urged to use the newer notation, as it is possible that $ may be preempted in a future version of the compilers.
- String equates may be defined with a dollar sign followed by a valid identifier name. They are always global in scope, just as numeric equates, and may only be defined outside of all Subs and Functions. Each string equate may be assigned a literal string value up to 255 characters in length. It is possible that some future version of PowerBASIC will support local equates. In order to simplify references to "non-printing" ascii codes, a number of predefined string equates are now included, which may be referenced directly in your source code: Null String, Backspace, Tab, Line Feed, Vertical Tab, Carriage Return, Carriage Return + Line Feed, End-Of-File, Escape, Double Quotes
- All operations which reference a position in a file (such as Seek, Get, Lof, etc.) may now do so in the range of a 64-bit integer. Files are no longer limited to 2 gigabytes in size.
- #OPTION Version5 may be specified to require operation only under WindowsNT version 5.0 or later.
- #REGISTER may declare global defaults of ALL/NONE/DEFAULT by positioning it before the first Sub/Function in the source code. It may also be positioned within a Sub/Function -- In this case, it declares the method of auto-assignment of register variables for that single procedure, and overrides the global defaults.
Back
The text on this page is (C) PowerBasic Inc.
HTML-conversion by Marc van den Dikkenberg
Last update: 30 May 1999