pb library function of the system and the environment


Clipboard ()
Feature extraction or replace the Windows system clipboard text content.
Syntax Clipboard ({string})
Parameter string: string type, option, specify to the system clipboard to copy text.If you already have the contents of the clipboard, then the text will replace the current contents of the clipboard return value String.Function is executed, if the clipboard contains text data, then the function returns the current contents of the clipboard; if the clipboard contains non-text data (such as bitmaps) or do not contain any data, then the function returns an empty string ("").If the string parameter is NULL, Clipboard () function returns NULL.String usage, whether or not the specified parameters, Clipboard () will return the current contents of the clipboard.When specifying the string parameter, the original contents of the clipboard is replaced by the value string parameter; string parameter is omitted, just get the contents of the clipboard.
--------------------------------------------------------------------------------

CommandParm ()
Function was specified when the application is running the command parameters.
Syntax CommandParm ()
Return value String.Function is executed, return to the application runtime command line parameters, the function execution error or no command-line parameter function returns empty stringUse command-line argument is when the application starts after the name of the application with any parameters, for example, in the Run window, type the following command: MyAppl C: EMPLOYEEEMPLIST.TXT then MyAppl applications using CommandParm () function to get the orderline parameters: C: EMPLOYEEEMPLIST.TXT When the application contains several command line parameters, CommandParm () function returns all parameters as a string.String manipulation functions can be isolated using various parameters.Open event in the application object is not necessary to perform CommandParm () function.At this point, Open event argument parameter contains the command-line parameters.
--------------------------------------------------------------------------------

DoScript ()
Function block implementation of AppleScript, this function is only valid in the Macintosh platform.
Syntax DoScript (script, result)
Parameters of script: string type, designated to run block (script) result: string type, the results returned by AppleScript block information or error message return value Integer.Return result code returned by the AppleScript.If any parameter is NULL, DoScript () function returns NULL.
--------------------------------------------------------------------------------

GetApplication ()
Function to get the current application of object handles, so you can query or set the application object's attributes (often used to write generic code).
Syntax GetApplication ()
Return value Application.Returns a handle to the current application object.
--------------------------------------------------------------------------------

GetEnvironment ()
Functions are operating systems, processors, screen display and system-related information.
Syntax GetEnvironment (environmentinfo)
Parameters environmentinfo: Environment object name, to save the return value of the information system environment Integer.Function returns 1 on success, returns -1 when an error occurs.If the parameter environmentinfo value NULL, GetEnvironment () function returns NULL.Use when developing cross-platform project, the use of GetEnvironment () function, the application can get the current running operating system, using the CPU type, operating system version, screen size and number of colors and other information that the concrete representation, seebook environment object (Environment Object) introduction.
--------------------------------------------------------------------------------

GetFocus ()
Functions which determine the current focus is on control.
Syntax GetFocus ()
Return value GraphicObject.Function is executed, returns the current reference to the control gets focus, returns an invalid reference error occurs.Application usage by IsValid () function can detect GetFocus () controls whether to return a valid reference.Also, use TypeOf () function to determine the type of control.
--------------------------------------------------------------------------------

Post ()
Function message to the specified message queue in a window, the window can be either a window PowerBuilder applications, other applications can also be a window.
Grammar Post (handle, messageno, word, long)
Parameter handle: long type, specifies that the window system handle to the window will send a message messageno: UnsignedInteger type, specify the message number to send the word: long type, specify the word by mail with the message class parameter value.Messageno parameter specifies if the message does not use this parameter, then the value of this parameter is set to 0long: long type or string, specify the long post with the message type parameter value or string return value Boolean.If any parameter is NULL, Post () function returns NULL.
Usage of Post () function is used to send non-PowerBuilder window predefined event news, this window can be a window of PowerBuilder applications, other applications can also be a window.Post () function to send the message be placed in the tail of the specified window message queue, and then return to the application, it does not wait for the appropriate event handler for the implementation of the event.This is with the Send () function is different, Send () function directly trigger the corresponding event specified window, the implementation of event handlers and returned to the calling application.Therefore, we say that Post () function is used in asynchronous mode, Send () function uses a synchronized way.Post () function of the parameter handle handle to the window designated to receive messages on the PowerBuilder window, using Handle () function can get the handle.On the window for other applications, you can call the system API functions to find the window and get the appropriate window handle.If the application to mail PowerBuilder custom events (including the predefined events and user-defined events), then use the PostEvent () function is simple and there are convenient.When the application to specify a location in the long parameter string, Post () function to copy a copy of the string, and then copy the address to send to the specified window.
--------------------------------------------------------------------------------

ProfileInt ()
Function from the initialization file (. Ini) set to read integer value.
Syntax ProfileInt (filename, section, key, default)
Parameters filename: string type, specify the initialization file name can include path, the path is omitted, the function according to the standard operating system, specify the file path search section: string type, specify where to get the value of the section (Section) key: string type, specify the value to get the name, not case-sensitive default: integer type, when the specified file, section name, project name does not exist or can not be converted to an integer, the function returns the value of the parameter specifies the return value of the Integer.Function is executed, the specified file, section name, project name does not exist any errors, the function returns the value of the corresponding items; if the specified file, section name, project name does not exist or can not be converted to an integer, the functionBack to default parameter specifies the default value.If an error occurs, the function returns -1.If any parameter is NULL, ProfileInt () function returns NULL.
--------------------------------------------------------------------------------

ProfileString ()
Function from the initialization file (. Ini) to read a string setting.
Syntax ProfileString (filename, section, key, default)
Parameters filename: string type, specify the initialization file name can include path, the path is omitted, the function according to the standard operating system, specify the file path search section: string type, specify where to get the value of the section (Section) key: string type, specify the value to get the name, not case-sensitive default: string type, when the specified file, section name, project name does not exist, the function returns the value of the parameter specifies the return value of String.Function is executed, the specified file, section name, project name does not exist any errors, the function returns the value of the corresponding items; if the specified file, section name, project name does not exist, function returns the default parameters specified by lack ofProvincial value.If an error occurs, the function returns an empty string.If any parameter is NULL, ProfileString () function returns NULL.
--------------------------------------------------------------------------------

Restart ()
Function block to stop the execution of all, close all windows, commit the transaction, disconnect the connection to the database, and then restart the application.
Syntax Restart ()
Return Value Integer.Function returns 1 on success, returns -1 when an error occurs.
--------------------------------------------------------------------------------

Run ()
Function runs the specified application.
Syntax Run (string {, windowstate})
Parameter string: string type, specify the name of the running application, which can include the path and the corresponding parameters, as in the command line type as windowstate: WindowState enumeration type, options, specify the window when the program is runningstate.Valid values for the: Maximized! - Maximize the window; Minimized! - Minimized window; Normal! - The default value, the normal window to return value Integer.Function returns 1 on success, returns -1 when an error occurs.If any parameter is NULL, Run () function returns NULL.
Usage Run () function, the application can start any program in the operating system.When the Run () parameter specifies the parameters to start the application, the meaning of the parameters, format, number, etc. determined by the specific application.If the Run () function of the string parameter specifies the file name extension, but did not give the time, PowerBuilder that the file extension. EXE.To run the extension is not. EXE application (such as. BAT,. COM, or. PIF), must Run () function parameters specify the file extension.
--------------------------------------------------------------------------------

Send ()
Function sends the specified message to the window and immediately implement the corresponding event handler.
Syntax Send (handle, messageno, word, long)
Parameter handle: long type, specifies that the window system handle to the window will send a message messageno: UnsignedInteger type, specify the number of messages sent word: long type, specify the word sent with the message class parameter value.Messageno parameter specifies if the message does not use this parameter, then the value of this parameter is set to 0long: long type or string, specify the type of message sent with the long string return value parameter value or Long.Function succeeds Windows system call returns SendMessage () return value, return -1 when an error occurs.If any parameter is NULL, Send () function returns NULL.
Use Send () function is used to send to the window the event of non-PowerBuilder predefined message, the window can be a window of PowerBuilder applications, other applications can also be a window.Send () function directly trigger the corresponding event specified window, execute the event handler returns to the calling application, which is with the Post () function is different, Post () function to send the message be placed in the tail of the specified window message queue, and thenreturn to the application, it does not wait for the appropriate implementation of the event event handler.Therefore, we say that Post () function is used in asynchronous mode, Send () function uses a synchronized way.Send () function parameters handle the specified window handle to receive messages on the PowerBuilder window, using Handle () function can get the handle.On the window for other applications, you can call the system API functions to find the window and get the appropriate window handle.In fact, Send () function to the parameters it sent directly to the Windows system calls SendMessage ().In a variety of C + + development tools can be found WINDOWS.H file number of the message.If the PowerBuilder application to send the definition of events (including the predefined events and user-defined events), then use the TriggerEvent () function is simple and there are convenient.When the application to specify a location in the long parameter string, Send () function to copy a copy of the string, and then copy the address to send to the specified window.
--------------------------------------------------------------------------------

SetProfileString ()
Feature set that file entry value.
Syntax SetProfileString (filename, section, key, value)
Parameters filename: string type, specify the initialization file name can include path, the path is omitted, the function according to the standard operating system, specify the file path search section: string type, specify where to set the value of the section (Section) key: string type, specify the name of the value to be set, not case-sensitive default: string type, specify the value of the item to set the return value Integer.Function returns 1 on success, the specified file is not found or file can not access the specified function returns -1.If any parameter is NULL, SetProfileString () function returns NULL.
--------------------------------------------------------------------------------

ShowHelp ()
Feature displays application help, the help with Microsoft Windows help system to operate.
Syntax ShowHelp (helpfile, helpcommand {, typeid})
Parameters helpfile: string type, the name of the specified Help file helpcommand: HelpCommand enumeration type, specify the display format to help.Valid values for the: Index! - Show directory topics do not specify the use of the typeid parameter value; Keyword! - Transferred to the themes identified by the specified keywords; Topic! - Displays the help topic typeid: optional, specifies Helptheme return value Integer.Function returns 1 on success, returns -1 when an error occurs.If any parameter is NULL, ShowHelp () function returns NULL.
--------------------------------------------------------------------------------

SignalError ()
SystemError application object function trigger event, usually for code debugging.
Syntax SignalError ({number}, {text})
Parameter number: integer type, options, its value will be saved to the Error object number attribute text: string type, option, its value will be saved to the text property of the object Error return value Integer.Function returns 1 on success, returns -1 when an error occurs.
--------------------------------------------------------------------------------

Yield ()
Function will transfer control to other graphic objects, including non-PowerBuilder objects.This function detects the message queue, if there is a message, put the message out.Using this function can shorten the time spent in the implementation of the control transfer operations to other applications.
Syntax Yield ()
Return Value Boolean.If the message queue to extract the message, then the function returns TRUE, otherwise returns FALSE.Use under normal circumstances, PowerBuilder application in the implementation of a code (such as function or event handler) in the process does not respond to user actions.A short snippet of time-consuming, this approach is not nothing wrong, but code execution if a longer time-consuming, the application also want to provide users more control, you need toIn this code into the Yield () function to enable users to carry out other operations, in particular, the code in the loop even more it should be.Application execution Yield () function, if there is a message that the message queue, it will allow the object to deal with these messages, processing, continue Yield () function after code execution.Therefore, the code inserted in Yield () function will reduce the efficiency of the application.