Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

1. Library(.pbl)- is a container for pb objects. We need atleast one pb library.

We can have more


than one power builder lib.

2. Application object(Events, ini File , Profilestring)- main function like C. There are 6 events-

i) Open- When the user runs the application.


ii) Close- When the user closes the application.
iii) SystemErrorEvent- Whenever any exception occurs this event occurs. If there is no
script for this event, PowerBuilder displays a message box with the PowerBuilder error
number and error message text.
iv) ConnectionBegin- When a client application attempts to establish a connection to a
distributed PowerBuilder server application.
This event is triggered only in a distributed PowerBuilder server application. It is not
triggered when a client accesses a PowerBuilder component running in a Jaguar server.
The event returns the connect privilege status of the client.
v) ConnectionEnd- When a client application's connection is terminated. This event is
triggered only in a distributed PowerBuilder server application. It is not triggered when a
client disconnects from a Jaguar server.
vi) Idle- When the Idle function has been called in an Application object script and the
specified number of seconds have elapsed with no mouse or keyboard activity.

This object is used for d/b connectivity also.

iniFile-name, section, leftname. IniFile generally contains server name.


ProfileString is used to read the information from iniFile
SetProfileString is used to set the information in iniFile

3. Window Painter- allows you to paint and save window objects. On a window we can paint
various controls such as Commandbuttons, ListBoxes etc.
- Properties
- Window Type-
 Main- A standalone window that can be independent of all other windows.
 Mdi- Multiple Document Interface. A window in which users work within a frame
window that lets them perform activities on multiple sheets of information. This is
useful in applications where users require the ability to do several different things
at a time.
  Mdihelp-
 Child- A window that is dependent on a main (parent) window and can exist only
within the parent window. When you move the parent window, the child moves
with the parent and maintains the same position relative to the parent.
When you minimize a child window, the icon displays within the parent.
 Response- The window that displays to request information from the user and to
which the user must respond. Response window is use to take response from the
user, we cannot do anything in that particular window.
When we open a response window with open sheet it behaves like a main window.
 Popup- A window that displays only in response to an event within a window but
can exist outside the window and, in some cases, after the window that opened it is
closed. The popup window may or may not have a parent window. When it has a
parent window, it is dependent.
- Window Functions-
Close- Close a window.
CloseWithReturn- Close a window and store a return value in the Message object.
Open- Open a window.
OpenSheet- Open a sheet in a MDI frame.
OpenSheetWithParm- Open a sheet in a MDI frame and store a value in the Message object
that is accessible to the opened sheet.
OpenWithParm- Open a window and store a value in the Message object that is accessible
to the opened window.
- Events(Open,Close,Closequery)

 Message object-The Message object is used to process events that are not
PowerBuilder-defined events, to communicate parameters between windows when you
open and close them, and to specify whether optional parameters are used in
TriggerEvent or PostEvent. is a non visual object. Msg.StringParam, msg.DoubleParam,
Msg.PowerObjectParam.
 Error Object- The Error object is used to record execution-time errors. You can access
the Error object in a script to learn which error occurred and where it occurred.
You can also customize your own version of the Error object by defining a class user
object inherited from the built-in Error object.

4. Controls- SingleLineEdit, MultiLineEdit, EditMask, CommandButton, PictureButton, CheckBox,


GroupBox, RadioButton, DataWindowControl, UserObject, etc.

5. Menus- 3 types

 Cascading- Another menu that appears when an item on a dropdown menu is


selected. A cascading menu can be nested, so that a menu selection on the
cascading menu displays yet another cascading menu.
 Popup- A menu that displays only after a specified event occurs. To display a popup
menu, you must create a script to display the menu and use the PopMenu function
to specify where the menu will display on the screen.
 Drop Down-A list of commands or options under a menu item in the menu bar that
appears when the user clicks the menu item.

Locked and Unlocked property

6. Transaction object (SQLCA)- is used to connect with the d/b. Will execute our SQL.
 Property-
1. SQLCode(0,-1,100) return -1 in case there is an error
0 if successfully executed
100 if no data found.
2. SQLErrorText

7. Data Window Control(Itemchanged, EditChanged,ItemError,DBErrorEvent,Error,SQLPreview)


8. Data Window Objects
a. Presentation Style
b. Data Source
c. Edit Properties:
- DropDown Listbox
- DropDown DW (Data Window)
- Edit Mask
- etc.(3 more properties are also there)

9. Variables:
- Local- Scope n life is valid/stored only at script level.
- Instance- is valid at object level.
- Global- is valid throughout the application. Get stored at application object level.
- Shared- scope is as instance variable and life is as global variable. Stored at object
level.

10. Buffers – (Primary, Original, Delete and Filter)


How to get value of original buffer?
There is a function in pb i.e. GetItemString(row,column,buffer,True/False)
Example- dw_1.GetItemString(1,’emp_name’,Primary!,False)- will give the primary buffer value.
dw_1.GetItemString(1,’emp_name’,Primary!,True)- will give the original buffer value.

a. Row Status (Update Properties + Filters + Sorting)


Update properties is used to
Yes we can update more than one table.

When we retrieve the information

11. Functions:
- Open()
- OpenSheet()
- OpensheetwithParm()
- OpenwithParm()
- InsertRow()
- DeleteRow()
- Retrieve()
- Update()
- Reset()
- AcceptText()
- MessageBox()
- Trigger Event()
- PostEevent()
- RowCount()
- SaveAs()
- Print()
- SetSQLSelect()
- SyntaxFromSQL()
12. Datawindow Events
- itemchagned()
- Item Error
- clicked()
- open()
- etc (other events)
13. Computed fields and Computed Columns.
14. Error Object
15. Enumerated Datatype
16. Function Painter

What is the use of close query event?


Set Trans- is for one transaction.
SetTransObject- is for continuous connection

17. Shared Data method

Select e_name, count(*) from employees


Where count(*) >1
Group by e_name;

You might also like