1. Global Variables (Global Variables) can be accessed throughout the application, and its scope is the entire application. Such as the number of the operator, the name, etc. The instance variables of 5 global variables SQLCA (transaction objects) have been preset in PB, which is an object-level variable, defined within the object, only the object or function of the object can use the variable, in the associated The object is created when it is opened, and is canceled. Share variables (Share Variables) A similar variable, open again after it is closed, and the variable still keeps the object when the object is closed. In my opinion, it is different from the global variables in the respective role domains. Local variables only acts on the block. The order of variable search is: Local, Shared, Global, Instance
The 2.ToolBar property is used to quickly and easily generate the Toolbar tool file. In addition to setting Toolbar for the App, you can set Toolbar for the form.
3. The measurement unit PBUs in PowerBuilder is whether the window size set with PBus is approximate regardless of the resolution.
4. The inheritance of the window is used to establish a new window. You can inherit the style, controls, events, functions, functions of the ancestors, etc. # The descendant inherits all the ancestors all scripts, so it is not necessary to reply to ensure consistency in the application in the application.
The only unauthorized operation is to delete the inherited control. Can only set it to not visible (Visibe check box)
There are three objects to do inheritance: windows, menus, user objects
5. Editing Mask Box (EditMask) is similar to the single line edit box, but you can set the format of the input data, such as phone numbers, date, etc. There is also a list view, a treeview, a chart (graph) is a more cool control.
6. Pronouns THIS represents objects for writing event handlers Parent refers to the window where the parent object where the current control is located, represents the window where the runtime menu is located. This pronouns can only be used in the menu event, which is used only when using inheritance, refers to the parent of the object Call Super Super: clicked parent event super: f_cal () parent function
7. The form of the form is actually generated in the library, which is actually generated in the library: the new data type (the same as the window name) and new global variables for new data types (same as the window name) ). Note that the form generated by instance variables cannot be referenced to each other. You can use: MyArray [4] .st_count.text = "3" by creating a window array [5] by arrays: MyArray [4] .st_count.text = "3"
8. Internal Form Type Window
Window newArray [3] string win [3] int = "w_abc2" win [2] = "w_abc3" Win [3] = "w_abc3" for i = 1 to 3open (NEWARRAY [I], WIN [I ]) NEXT
This opens three windows (W_ABC1 W_ABC2 W_ABC3) instances
9. The step of the PB connection database is: Determine the interface (ie, dedicated interface or ODBC), which is a dedicated interface, and the description file and connection database are established. Define the data source is established in the ODBC Data Source Manager (Control Panel) Description File Profile in the tool file of PB DB PROFILE icon
10. Primary key Primary Key can uniquely identify a collections of each row of data, definitely there will be no two recorded primary key value is the same as one or more columns in the table for one or more columns in the table. The correspondence established by the primary key, using foreign key to connect multiple tables, to ensure the reference integrity of the database, where the corresponding rules (three) are set to independently, the data reference integrity between the tables and the tables. It's really excited when you understand this feature. 11. DISPLAY FORMAT, EDIT style, VALIDATION Rules property setting in the Extended Attribute Column, can only be referenced in the property window of the table and cannot be customized. Custom Display Format, Edit Style, and Validation Rules (Validity Rules) in the Extended Attribute (View / Extended Attributes menu item)
12. Extended Attribute System Table With the "PBCAT" prefix table PBCATTBL Each table information, such as displaying font, annotation, etc., all columns in the PBCATCATCATCATFMT system, all display formats defined in the PBCATFMT system in the PBCATRLD system in the PBCATRLD system. Validity rules PBCATEDT All editing style
13. The data window consists of two parts of the data window control and data window object placed in the window. Data window objects are created in the data discipline. It saves in the currently used library. The data window control is a control placed on the window, which is a container of the data window object. # In the Data Window Drawboard, if the Tab value of a control is 0, whether it is pressing the TAB button or click the control, the control will not get the focus. Therefore, in practical applications, the Tab keys of a column can be set to 0. to protect the data of the column is not modified. And in the window picture board is just pressing the Tab button. 14. Structure is a collection of a number of variables that associates the association, and the data type of these variables may be the same or different. The structure of two classes is provided in PB: the whole domain (Global) class and object class, the whole domain is established through the New-Object-Structure on the PB tool file, and only four objects can be established: application objects, window objects, menus Objects, user objects. For example: Enter the window porter, select INSERT-Structure This defines the structure of a window object.
15. Call {Object Name} {Type}} {Type} Name ({Parameter 1, Parameters 2 ...}) Object Name: Define Functions or Event Object Type: Function (Default) Or Event Functions and Event Call Types: Static (Default) and Dynamic Compile Find Functions and Program Runtime Find Functions Call Time: Trigger and POST Implementation and and other program segments are executed
16. Data Saving Data Window Control .update Passage Value 1 or -1 (Successful or Failed) If the execution is successfully made to do commither to the database, failure to do ROLLBACK
IF dw_1.update () ThenCommit Using Sqlca; Elserollback Using Sqlca; MessageBox ("Failure", Data Save Error "Endif
17. In the data window object, set two ways to retrieve data: Rows As Needed and Rows to Diskrows As Needed Refers to the data to display only from the remote database each time you browse the data, so when the user turns pages or single When the scroll bar is hit, the PB retrieves the new data to the data window as needed, Note: If you are sorted, or using a set function such as SUM (), the ROWS AS NEEDED setting will be invalid.
Rows to Disk only retrieves a data window object from a remote database, and bursts the remaining data rows to the temporary file of the disk, only transferring memory only when needed. 18. If the database can always be updated, then when multiple users simultaneously modify the same record in the database, the modification of the record may be overwritten by other users. PB provides three ways to protect data integrity: 1.key columns 2.key and update column 3.key and modified column (recommended) Select the ROWS / UPDATE PROPERTIES menu item in the Data Sheet to select these three ways. To disable the data window from being updated, clear the Allow Update check box.
19.pb Retrieves data according to the following sequence 1. If the data window object itself saves data, PB uses this data without retrieving data from the database 2. If the data buffer (default is open), PB uses buffer Data in the area 3. If the data buffer is not data or no open data buffer, the PB automatically retrieves data from the database.
20. Setting the color You can use the keyword such as [Black] [Blue] [Green] [CYAN] [Red] [White] [Yellow], you can use the value to be represented when a color cannot be expressed. Formula: [256 * 256 * Blue value 256 * green value red value]