De verschillen tussen PB/DLL 6.0 en 5.0
* HEX$(x[,y]) function converts a long integer to a hexadecimal string representation of the value of x. If the optional format parameter y is included, then a string of y digits (up to a maximum of eight) is returned, filled with leading zeros. If y is zero or missing, the returned string has the number of digits necessary to accurately represent the number. * HOST ADDR [host$] TO ip& tranlates a host name into the corresponding ip address. If the host$ is null, or not given, then the ip address of the local computer is assigned to ip&. * HOST NAME [ip&] TO host$ tranlates an ip address into the corresponding host name. If the ip address is zero, or not given, then the name of the local computer is assigned to host$. * INSTR() Function allows the first parameter (the optional starting position) to 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. The function INSTR(-2,"efcdef",any "ef") returns the value 5. * LSET ABS x$ = y$ left justifies y$ within x$, but leaves the the balance of the string unchanged, not space-filled. * MCASE$($exp) function 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. * MID$ Function allows the second parameter (the starting position) to be a negative number. If negative, the starting position is assumed to be n characters from the end of the string. MID$("abcde",-3,2) returns "cd" the function MID$("abcde",-3) returns "cde". If that parameter evaluates to a position outside of the string on either side, a null string is returned. * MID$ Statement allows the second parameter (the starting position) to be a negative number. If negative, the starting position is assumed to be n characters from the end of the string. MID$("abcde",-3,2) = "123" yields "ab12e", while the statement MID$("abcde",-3) = "123" yields "ab123". If that parameter evaluates to a position outside of the string on either side, no operation is performed. * OCT$(x[,y]) function converts a long integer to an octal string representation of the value of x. If the optional format parameter y is included, then a string of y digits (up to a maximum of eleven) is returned, filled with leading zeros. If y is zero or missing, the returned string has the number of digits necessary to accurately represent the number. * PARSE$(x$ [,[ANY]delim$], field&) returns the delimited field, specified by field&, found in x$. If 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 field& evaluates to zero, or outside of the actual field count, a nul string is returned. The field delimiter is defined by delim$, which may be one or more characters long. To be valid, the entire delimiter must match exactly, but the delimiter itself is never returned as a part of the delimited field. If the ANY option is chosen, then each appearance of any single character comprising delim$ is considered a valid delimiter. If delim$ is not specified or nul, then standard comma-delimited (optionally quoted) fields are presumed. In this case only, the following parsing rules apply. If a standard field is enclosed in optional quotes, they are removed. If any characters appear between a quoted field and the next comma delimiter, they are discarded. If no leading quote is found, then any leading or trailing blank spaces are trimmed before the field is returned. * PARSECOUNT(x$ [,[ANY]delim$]) returns a count of the number of delimited fields found in x$. The field delimiter is defined by delim$. If delim$ is not specified or nul, then standard comma-delimited (optionally quoted) fields are presumed. * PUT statement adds an optional ABS option. 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. If you precede the variable name with ABS (PUT #1,,ABS x$), no length word is written, only 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. * REDIM may be used to alter the size of Static and Global arrays. * REDIM xyz&(), used without dimensions, erases the array contents and deallocates its memory, even if the array is Static or Global. * REGEXPR mask$ IN main$ [AT start&] TO posvar&, lenvar& evaluates a regular expression to determine whether the "wild card" string specified by mask$ can be found within target$. The search begins at the position stated by the optional parameter start&, or else defaults to position one. If found, the variable posvar& contains the position of the match (indexed to one), and the variable lenvar& contains the length of the match. If no match is found, both variables are set to zero. The regular expression specified by mask$ may contain any combination of standard text characters and/or any of the listed special operators. * REGREPL mask$ IN main$ WITH new$ [AT start&] TO posvar&, newmain$ evaluates a regular expression, just as with REGEXPR, but the matched text in main$ is replaced by new$ and the entire text is assigned to newmain$. Main$ remains unchanged and posvar& reflects the position immediately after the replaced text, so the operation can be repeated, if desired. If no text is replaced, then posvar& returns zero. The expression new$ may contain any text, as well as the tags specified by \##. Each tag from \01 through \99 is replaced by the text actually matched for that tag. \00 is replaced by the entire matched text. The only way to specify a literal backslash is with \\. * REMAIN$([pos,] main$, [ANY] match$) function returns the portion of main$ which follows the first occurrence of a specified character or string. REMAIN$() is the natural complement to the EXTRACT$() function. * RESET var sets a scalar variable or user-defined type to zero/nul. * RESET array() sets all elements of the array to zero or nul, but does not deallocate the memory, leaving it available for re-use. * RSET ABS x$ = y$ right justifies y$ within x$, but leaves the the balance of the string unchanged, not space-filled. * SLEEP ms& pauses the application for the specified number of milliseconds, while allowing other processes to execute. * STRDELETE$(x$,y,z) returns the string expression x$, with z characters deleted starting at position y. * STRINSERT$(x$,y$,z) returns a string consisting of the string expression x$, with the string expression y$ inserted at position z. STRINSERT$("1234567890","ab",3) returns "12ab34567890". If z > len(x$), y$ is appended to x$. * STRREVERSE$($exp) returns a string with the character sequence reversed from that of the original. * TCP Statement offers TCP/IP Support: pnum is a long integer expression to specify the host port. "srvc" is a string expr specifying smtp,pop,nntp... "host" is a string expr specifying site (powerbasic.com...) TCP Print sends a text line, followed by a cr/lf (which can be suppressed with a trailing semi-colon). TCP Line Input reads a text line, delimited by a cr/lf. TCP Send and Recv read/write undelimited binary data. TCP is invalid with Open Handle. TCP files can be terminated either with the TCP CLOSE statement, or the standard file CLOSE statement. TCP OPEN SERVER creates a socket on the local server at the specified port and listens for connection requests. TCP NOTIFY specifies which requests should send a message to your WndProc callback. TCP ACCEPT accepts a connection request and creates a new socket to handle communication. The timeout option must be specified in whole seconds -- if zero, the function will wait indefinitely -- if not specified, the default is 60. * UDP Statement offers UDP Communications support: ** DDT Overview ** * CALLBACK FUNCTION cbname() defines a special, simplified form of user function which is used exclusively for your callback procedures. Callback Functions are automatically executed in response to certain events which occur in your program. When a Callback Function is listed in a DIALOG SHOW statement, it is executed whenever any message related to any part of the dialog is received by PowerBASIC. When a Callback function is listed in a CONTROL ADD statement, it is executed whenever a wm_CallBack message for that specific control is received by PowerBASIC. These procedures are loosely defined as Dialog Callbacks and Control Callbacks elsewhere in this documentation. When a Callback Function is executed, Windows passes four long integer parameters to define the nature of the event which has occurred. These four parameters are known as hWnd (the handle of the Window or Dialog involved), wMsg (the message number which defines the event), wParam and lParam (additional message dependent data). These four parameters are retrieved from within your Callback Functions by using the PowerBASIC Functions CBHndl, CBMsg, CBLParam, and CBWParam. Two additional functions, CBCtl and CBCtlMsg, return the low and high halves of wParam automatically. Since callback params are easily referenced with built-in functions, your Callback Functions will never declare any parameters, nor will they include options like EXPORT or STATIC. They imply a function return type of Long Integer, even if you do not include the "&" type identifier, or the "As Long" specifier. A typical Callback Function will simply look like... Callback Function ClickYes() If your Callback Function processes a Callback Event fully, then the function must return logical true (non-zero). If not, it must return logical false (zero), so that PowerBASIC or Windows will process it in the default manner for that message. Callback Functions are only executed by PowerBASIC internals or Windows. You should never execute a Callback Function from your application code. * CBCTL function returns the LoWrd of wParam. It is only valid within a callback function. * CBCTLMSG function returns the HiWrd of wParam in a dialog callback function. It is only valid within a callback function. * CBHNDL function returns the hWnd param in a callback function. It is only valid within a callback function. * CBLPARAM function returns the lParam parameter in a callback * CBMSG function returns the wMsg parameter in a callback function. It is only valid within a callback function. * CBWPARAM function returns the wParam parameter in a callback function. It is only valid within a callback function. * COMBOBOX ADD hDlg&, id&, text$ Add a string to a combobox specified by hDlg& and id&. * COMBOBOX GET TEXT hDlg&, id& TO textvar$ Get the text of the currently selected item in a combobox specified by hDlg& and id&. * COMBOBOX DELETE hDlg&, id&, pos& Delete the string at position pos& within a combobox specified by hDlg& and id&. * COMBOBOX RESET hDlg&, id& Remove all of the contents of a combobox box specified by hDlg& and id&. * COMBOBOX SELECT hDlg&, id&, pos& Copy the specified listbox item at pos& into the editbox portion of a combobox specified by hDlg& and id&. * CONTROL ADD
{ctrl},hDlg&,id&,txt$,x&,y&,wide&,high&[,style&,stylex&
[CALL callbackfunction] * CONTROL ADD
COMBOBOX|LISTBOX,hDlg&,id&,[txt$()],x&,y&,wide&,high&[,style,stylex&]
[CALL CallBack] * CONTROL ADD
"Name",hDlg&,id&,txt$,x&,y&,wide&,high&[,style&,stylex&
[CALL callback] * CONTROL DISABLE hDlg&, id& disables mouse and keyboard input from reaching the specified control. Most standard controls are automatically "grayed" to give the user a visual indication that it is not available for interaction. * CONTROL ENABLE hDlg&, id& enables mouse and keyboard input to the specified control. This is the default condition upon initial "show" of a dialog. * CONTROL GET CHECK hDlg&, id& TO retvar& the "check state" of an option button, checkbox, or check3state is assigned to the long integer variable designated in "TO retvar&". 0=unchecked, 1=checked, 2=grayed (only if a 3state). * CONTROL GET LOC hDlg&, id& TO x&, y& retrieves the location of the specified control (in dialog units, relative to the client area of the dialog), and assigns it to the long integer variables. * CONTROL GET SIZE hDlg&, id& TO x&, y& retrieves the size of the specified control (in dialog units), and assigns it to the long integer variables. * CONTROL GET TEXT hDlg&, id& TO textvar$ the text of the control (or dialog/window title) specified & is copied to the string variable designated in "TO textvar$". * CONTROL HANDLE hDlg&, id& TO hndl& retrieves the windows handle of a control, given the handle of the parent dialog and the id used to create it, and assigns it to the long integer variable specified by hndl&. If the requested control cannot be found, a value of zero is returned. This control handle may be needed to successfully execute certain PowerBASIC statements, as well as some Windows API functions. * CONTROL KILL hDlg&, id& destroys the specified control. * CONTROL SEND hDlg&, id&, msg&, wparam&, lparam& [TO result&] sends a windows message to the specified control, which is identified by the parent dialog handle and control id combination. It optionally assigns the result to the long integer variable indicated by TO result&. * CONTROL SET CHECK hDlg&, id&, check& the "check state" of an option button, checkbox, or check3state is set based upon the value of check&. 0=unchecked, 1=checked, 2=grayed (only if a 3state). * CONTROL SET FOCUS hDlg&, id& the specified control receives the focus -- keyboard entry is directed to it. * CONTROL SET IMAGE|X|IMGBUTTON|X hDlg&, id&, $exp a new bitmap or icon image is displayed on the specified control. However, bitmaps and icons cannot be interchanged. A bitmap can only be changed to another bitmap, likewise with icons. * CONTROL SET LOC hDlg&, id&, x&, y& moves the specified control to the location (in dialog units, relative to the client area of the dialog) indicated by x&, y&. * CONTROL SET SIZE hDlg&, id&, x&, y& changes the size of the specified control (in dialog units), to the values indicated by x&, y&. * CONTROL SET TEXT hDlg&, id&, $exp the text of the control (or dialog/window title) specified by hndl& is changed to that specified by the string expression $exp. * DECLARE CALLBACK FUNCTION cbname() declares a special Callback Function prior to its full definition. It must be declared as returning a long integer value, or if ambiguous, it defaults to long integer. It must include no parameters. * DIALOG DISABLE hDlg& disables mouse and keyboard input from reaching any control in the specified dialog. Controls within the dialog are not automatically "grayed", so it is necessary to use CONTROL DISABLE with each, if you wish to provide a visual indication they are not available for interaction. * DIALOG DOEVENTS [TO countvar&] statement processes a pending window or dialog message and releases the remainder of the timeslice to Windows if there are no active dialogs. If the optional TO clause is included, then a value equal to the number of currently active dialogs is assigned to the variable countvar&. It should only be utilized in conjunction with the D.D.T. Dialog SubSystem. * DIALOG ENABLE hDlg& enables mouse and keyboard input to the specified control. This is the default condition upon initial "show" of a dialog. * DIALOG END hDlg& [, retvalue&] The dialog specified by hDlg& is destroyed. If ",retvalue&" is included, that value is immediately assigned to the long integer variable specified in the associated DIALOG SHOW statement. * DIALOG GET CLIENT hDlg& TO x&, y& retrieves the size of the client area of the specified dialog (in dialog units), and assigns it to the long integer variables. * DIALOG GET LOC hDlg& TO x&, y& retrieves the location of the specified dialog (in dialog units, relative to the client area of the parent dialog or if none, the screen), and assigns it to the long integer variables. * DIALOG GET SIZE hDlg& TO x&, y& retrieves the total size of the specified dialog (in dialog units), and assigns it to the long integer variables. * DIALOG NEW
prnt&,title$,[xpos&],[ypos&],wide&,high&[,style&,stylex&]TO
hDlg& * DIALOG PIXELS hDlg&, x&, y& TO UNITS xx&, yy& converts pixels to dialog units, based upon the appropriate ratios for the specified dialog. * DIALOG SEND hndl&, msg&, wparam&, lparam& [TO result&] sends a windows message to the specified control/window/dialog, and optionally assigns the result to the long integer variable indicated by TO result&. * DIALOG SET LOC hDlg&, x&, y& moves the specified dialog to the location (in dialog units, relative to the client area of the parent dialog or if none, the screen), indicated by x&, y&. * DIALOG SET SIZE hDlg&, x&, y& changes the size of the specified dialog (in dialog units), to the values specified by x&, y&. * DIALOG SHOW MODAL hDlg& [,CALL CallBack] [TO retvar&] The modal dialog specified by hDlg& is made visible. The Callback function is executed each time any message for this dialog occurs. * DIALOG SHOW MODELESS hDlg& [,CALL CallBack] [TO retvar&] The modeless dialog specified by hDlg& is made visible. The Callback function is executed each time any message for this dialog occurs. * DIALOG SHOW STATE hDlg&, showbits& [TO retvar&] is used to change the state/appearance of the dialog specified by hDlg&. The showbits& parameter is a value from 0 to 10, defined in the win32 API as %sw_hide, %sw_shownormal, %sw_showminimized, %sw_showmaximized... If the optional TO clause is included, the retvar& variable is assigned the value zero if the dialog was previously not visible, or non-zero if it was previously visible. * DIALOG UNITS hDlg&, x&, y& TO PIXELS xx&, yy& converts dialog units to pixels, based upon the appropriate ratios for the specified dialog. * LISTBOX ADD hDlg&, id&, text$ Add a string to the listbox specified by hDlg& and id&. * LISTBOX GET TEXT hDlg&, id& TO textvar$ Get the text of the currently selected item in a listbox specified by hDlg& and id&. * LISTBOX DELETE hDlg&, id&, pos& Delete the string at position pos& in the listbox specified by hDlg& and id&. * LISTBOX RESET hDlg&, id& Remove all contents of the listbox specified by hDlg& and id&. * LISTBOX SELECT hDlg&, id&, pos& Select the item at position pos& in the listbox specified by hDlg& and id&. * MENU NEW BAR|POPUP TO hMenu& creates a new blank menu. * MENU ADD STRING, hMenu&, text$, id&, state& [,AT [BYCMD] pos&] [,CALL
callback] * MENU ADD POPUP, hMenu&, text$, pop&, state& [, AT [BYCMD] pos&] A popup menu, previously defined, is added to the menu specified by Windows handle hMenu&. The popup menu to use is specified by including its Windows handle as the parameter pop&. An optional position may be specified in the AT clause, using a numeric value indexed to one. If the position is not given, the popup is appended as the last item. If the BYCMD option is used, the string is added at the position immediately preceding the item whose ID& is given by pos&. If the item text string in a popup menu is a single character hyphen (-), then that item is displayed as a horizontal line. It acts as a separator, or grouping device, which cannot be selected by the user. In the menu string, an ampersand (&) in the text causes the letter that follows to be underlined, adding a keyboard interface "Hot-Key" to direct focus to that item. * MENU ATTACH hMenu&, hDlg& the menu previously defined as handle hMenu& is attached to the dialog defined as handle hDlg&. The menu is displayed immediately, or when the Dialog is made visible with DIALOG Show. * MENU DELETE hMenu&, [BYCMD] pos& deletes an item from the menu specified by the handle hMenu&. If the BYCMD option is used, the item to be deleted is specified by its user-assigned identifier. Otherwise, pos& specifies its position in the menu, indexed to one. * MENU DRAW BAR hDlg& causes the main menu bar in the Dialog specified to be redrawn. This statement must be executed any time the menu bar changes after the dialog has been created/displayed with DIALOG SHOW. * MENU GET STATE hMenu&, [BYCMD] pos& TO statevar& the state of the menu item specified is copied to the long integer variable statevar&. * MENU GET TEXT hMenu&, [BYCMD] pos& TO text$ the text of the menu item specified is copied to the string variable text$. * MENU SET STATE hMenu&, [BYCMD] pos&, newstate& the state of the menu item specified changed to the new long integer value. * MENU SET TEXT hMenu&, [BYCMD] pos&, newtext$ the text of the the menu item specified is changed to the new string expression. * MOUSEPTR style& changes the mouse pointer to a new shape. 0=default, 1=arrow, 2=cross, 3=ibeam, 4=arrow, 5=sizeall, 6=sizenesw, 7=sizens, 8=sizenwse, 9=sizewe, 10=uparrow, 11=wait 12=no, 13=appstarting. |
|