December 5, 2020

Powerbuilder Interview Questions Part 5

What is PowerBuilder?

PowerBuilder is a powerful Windows-based professional client/server application development tool, which allows teams of developers to quickly and easily build sophisticated, graphical applications with access to database information stored locally or on networked servers.

Powerbuilder features


Supports interitance, encapsulation and polymorphism.


Power builder supports SQL and Strored Procedures using DataWindow and embedded/dynamic SQL and remote procedure calls.


Data window control is the heart of powerbuilder and is used to display data in a wide variety of presentation styles.



Supports all popular databases like Sybase, MSSQL, Informix, Oracle and DB2 – using ODBC 3.0 drivers.


Data window plugin : used basically to display datawindow reports on the web.



Ms-Window, Macintosh, Sun Solaris, IBM, AIX, HP-UX and ect.


What is the User-defined function?

A user define function is a collection of power script statements that perform some processing.

Two types of user define function :

  • Global function : Accessible any whare in the application.

  • Object Level function :Object Level functions are defined for a window, menu, user object or application object


What are the Passing Arguments?

PassByValue :

When an argument is passed by value the function can accesses the temperory local copy of the arguments and can change the value of the local copy.


When an argument is passed by reference the function can accesses the original value of the argument and can change it directly.


When an argument is passed by read-only we can’t change its value but we can change the value of the argument but we can’t assign another object to that object.


What are the Scope Variables?


Local variable is a temporary variable only declared in the script itself and they are available only in the script where they were declared, when the script is finished execution the local variable is destroyed.


Intance variable that belongs to an object and associated with an instance of object. It allows values to be shared between scripts in the same object.


Shared variable retain their value when an object is closed and opened again.


Global variabl can access anywhere in the application. Can access any object in the application. It has public access level.


What events do you know for the application object?

OPEN – the user starts application.


No mouse or keyboard activity happens in a specified number of seconds SystemError – A serious error occurred during execution.


The user closes the application


In a distributed computing environment, occurs on the server when a client establishes a connection to the server by calling the ConnectToServer function.


In a distributed computing environment, occurs on the server when a client disconnects from the server by calling the DisconnectServer function.


How can you run another application from within PowerBuilder?

We could do it using PB function Run(). Run(string{, WindowState}), where string is a string whose value is the filename of the program we want to execute. Optionally, the string can contain one or more parameters of the program; WindowState (optional) is a value of the WindowState enumerated data type indicating the state in which we want to run the program.

E.g., Run(“c:\windows\notepad.exe”, Maximized!)


How do you avoid MessageBox “Application is already running”?

Use Handle() function. Handle() returns the object’s name if the object exists.


What do you mean Structures and types?

A structure is a collection of one or more related variable of the same or different data types grouped under a single name.


Not associated with any objects.

Object Level:

Associated with particular types of windows, menu or user object.


What are the two structures every application has?

Every PowerBuilder application has the MessageObject and the ErrorObject. ErrorObject is used to report errors during execution. MessageObject to process messages that are not PowerBuilder-defined events, and pass parameters between windows.


What are the ways to close your application?

  • HALT




What is HALT? HALT CLOSE? What is the difference between them?


Halt statement forces the application to terminate immediately. This is most often used to shut down the application after a serious error occurred.


Halt Close does the same thing but triggers the application object’s Close event before terminating.


What is the purpose of the PB.INI files?

INI stands for “initialization”. They are primarily intended to be a standard format that applications can make use of to hold info from one run to the next. Rather than hard-coding the values of transaction properties in scripts, which is too inflexible for most real-world applications, you’ll want your scripts to read some or all of them from an .INI file. You could use PB.INI .INIs are always in the same format:


DBMS = Sybase

Database = Video Store DB

User Id =

DB Password =

Log Password =

Server Name =

Log Id=

Lock =

DBParm=ConnectString=‘DSN=VideoStore DB;UID=dba’


How do you manipulate .INI file through PowerBuilder functions?

Set Profile String()




What is the DataWindowChild?

A DropDownDataWindow behaves a child of the DataWindow Object that contains it.


What do you mean about Data Window?

A datawindow object is an object that you use to retrieve, present and manipulate data from a relational database or other data source(Such as EXCEL worksheet or DBASE file).

Retrieves data from a database and present it to the user in a wide variety of styles.

We can use datawindow objects in client/server, web-bsed and mult-itier applications.

The report we can create in Infomaker and the Datawindow objects. We can create in powerbuilder and the same objects.


Explain types of presentation styles available in Datawindow?

  • Composite

  • Crosstab

  • Freeform

  • Graph

  • Grid

  • Group

  • Label

  • N-up

  • OLE-2.0

  • Richtext

  • Tabular


Define DataWindow buffers?


When data is retrieved from the databse by using retrieve() function, it is retrieved into the Primary Buffer and it is the content of this buffer that are displayed in the datawindow.

Powerbuilder always displays the data in datawindow control from the Primary Buffer. Data from other buffers are not visible to the user.


When user modifies a row in the DataWindow the row in the Primary Buffer is modified and the original value is copied into the Original Buffer from the Primary Buffer. Copies data only when the user modify the row for the first time.


When the user deletes a row with the DeleteRow() function, rows are transferred from Primary Buffer to Deleted Buffer.


When rows are filtered using the SetFilter() function, the filtered rows are display in the DataWindow and don’t match the filterd conditions are moved to the Filtered Buffer.


Edit DataWindow Control has one edit control. It contains the current column’s data. When the user modify the data in a column modify data is copied in Edit Control Buffer. The modify data on the screen and the content of the Edit Control are same. But the value in the Primary Buffer has the old data.


Define Data Store?

DataStore is a non-visual DataWindow control. DataStore used for Background processing, processing Embeded SQL and Distributed objects.

Background Processing:

Sometimes we use multiple DataWindow control on the screen to display one single report. But those DataWindows are not usable for printing. So we use hidden DataWindow control for printing.

Processing Embedded SQL:

Lot of times we need to use embedded SQL to check whether a particular record is existing in the databse or not. So we can check for the existing record using DataStore.

Distrubuted Objects:

We can use DataStore in the server application when we are developing a distributed application.


Which Data Source in the DataWindow painter is itself an object?



When powerbuilder retrieves data from the database what status will be occurred?



Under what circumstances will PowerBuilder automatically join tables that you select in the Select painter?

If we select tables that have one or more columns with identical names, the Select painter automatically displays the join, assuming equality between the two columns.


What Presentation Styles do you know and when do you use them?

The Tabular presentation style presents data with the data columns going across the page and headers above each column. As many rows from the database will display at one time as can fit in the DataWindow object. We can reorganize the Tabular presentation style any way we want by moving columns and text. Tabular style is often used when we want to group data.

The Freeform style presents data with the data columns going down the page and labels next to each column. We can reorganize the default layout any way we want by moving columns and text. Freeform style is often used for data entry form.

The Grid style presents data in a row-and-column format with grid lines separating rows and columns. Everything we place in a grid DataWindow object must fit in one cell in the grid. We cannot move columns and headings around as we can in the Tabular and Freeform styles. But, unlike the others styles, users can reorder and resize columns with the mouse in a grid DataWindow object during execution.

The Label style presents data as labels. We choose this style to create mailing labels or other kinds of labels. If we choose the Label style, we are asked to specify the attributes for the label in the Specify Label Specification.

The N-Up style presents two or more rows of data next to each other. It is similar to the Label style. We can have information from several rows in the database across the page, but the information is not printed on labels. The N-Up presentational style is useful if we have periodic data; we can set it up so each period repeats in a row..

The Group presentation style provides an easy way to create grouped DW objects, where rows are divided into groups, each of which can have statistics calculated for it. It generates a tabular DW that has one group level and some other grouping properties defined. We can customise the DataWindow in the DataWindow painter workspace.

The Composite presentation style allows us to combine multiple DWs in the same object. It is handy if we want to print more than one DataWindow on a page.

The Graph presentation style creates a DataWindow object that is only a graph the underlying data is not displayed. As the data changes, the graph is automatically updated to reflect the new values. We use a graph to enhance the display of information in the DataWindow object such as a tabular or freeform DataWindow.

Crosstab processes all the data and presents the summary information that we have defined for it. We use if we want to analyse data. Crosstab analyses data in a spreadsheet. Instead of seeing a long series of rows and columns, users can look at a Crosstab that summarises the data.

OLE 2.0 presentation style using a process called uniform data transfer; info from PB supported data sources can be sent to an OLE 2.0 server application. The OLE 2-compliant application uses the PB supplied data to formulate a graph, map, a spreadsheet or the like to be displayed in the DW.

RichText presentation style using a RichText DW, you can create letters of other documents by merging info in your DB into a formatted DW. Master word processing oriented features such as headers, footers and multiple fonts are available in an easy-to-use format.


Describe the difference between the grid and tabular presentation styles.

In the Grid presentation style, we cannot move columns and headings around as we can in the Tabular presentation style but in Grid presentation style users can reorder and resize columns with the mouse during execution.


Describe the difference between the labels and N-up presentation styles.

In N-up style, we can also have information from several rows in the database across the page, but the information is not printed on labels.


How often must you set the Transaction object ?

Just once when we define the DW control. If we change the association of a DataWindow object with a DataWindow control in a script, we must re-issue the SetTransObject () before the next retrieval or update.


What function changes the current row?



How would you define validation rules for the DataWindow object?

We can define validation rules in the DataWindow painter. We can use the SetValidate() function in a script to set validation rules dynamically (at run time) in a script for DW.


What is the difference between a DataWindow control and object?

DataWindow control is a container for a DW object and is placed on the window. DW control has attribute and functions. DataWindow object is a PB object which has connection to database and GUI. DW object has attributes. DataWindow object represents the data source. It encapsulates your database access into a high level object that handles the retrieval and manipulation of data use for displaying data and capturing user input. DataWindow object consist of :

data intelligence (perform test validation rules)

user interface (presentation style)

It is used to display data or capture user input. DW is an object that we use to retrieve, present and manipulate data from a relational DB or other data source in an intelligent way. (The DW control is the container for the DW object. The DW object is created using the DW painter; a DW control is placed on the window. A DW object has attributes. A DW control has attributes and functions. A DW object represents the data source. It encapsulates your database access into a high level object that handles the retrieval and manipulation of data. It is used for displaying data and capturing the user input. A DW object consists of data intelligence (performs test validation rules) and user interface (presentation style).


What are the strongest points of using the DataWindow control?

  • Displaying data.

  • Entering data.

  • Scrolling.

  • Reporting.


What is the difference between SQLCA.SQLCode and the value returned by the DBErrorCode() function?

The DBErrorCode() function (not SQLCA.SQLCode) checks the results of Database access performed by a DataWindow. We check SQLCA.SQLCode after explicitly issuing embedded SQL statements, such as Commit.


Which feature of the DataWindow painter greatly simplifies the creation of a report having only one group?

The easiest way to create a report that has a single group is to select the Group presentation style from the New DataWindow dialog box.


Where is a Query stored?

In a .PBL file.


How do you create a DataWindow object dynamically?

We use SyntaxFromSQL() and Create()


SQLCA.SyntaxFromSQL(select string, presentation string, Error string)

dw_1.Create(syntax, Error string)



To create a DataWindow dynamically we have to:

1. build a string to hold a SQL Select statement;

2. build a string to specify the presentation characteristics of the DataWindow object;

3. associate the syntax and description with an existing DataWindow control;

4. associate the DataWindow control with a transaction object, and perform a retrieval.

The DataWindow that is created exists only for the life of the DataWindow control, unless we use the LibraryImport() function to save it in a library. Dynamic DW objects allow us to create and modify DW objects on the fly. To create a DW dynamically, use the Create() function.

Creating takes two arguments: the name of the DataWindow object that will be replaced by the new DW object, and the syntax for creating the new DW object. We can create the DW object syntax in a script, but it is easier to use the SyntaxFromSQL() to generate the syntax from a SELECT statement.


Why must you specify the transaction object for a DataWindow control after creating the DataWindow object?

The Create() function must be followed by SetTransObject() function because Create() destroys any previous association between the DataWindow and a transaction object. Then, we can issue a Retrieve().


Can you dynamically assign a DataWindow object?

Yes, using DataWindow’s control attribute “DataObject”. DataWindow control has the attribute DataObject. If we want to change an associated DataWindow object at runtime we need to put a line in the script that changes the value of the DataObject attribute.

For example:

dw_1.DataObject = “d_name”


Let’s say, you share two DW buffers and the primary DW has some DDDW columns. Will this DDDW be shared automatically as well?

NO. After we have shared 2 DataWindows, we have to share all DropDowns as well. First, we have to get the reference for the Child DataWindow using GetChild() function and then do sharing by using ShareData() function.

DataWindowChild dwc_1, dwc_2

dw_1.getchild(“employee”, dwc_1)



dw_2.getchild(“employee”, dwc_2)



How can you update multiple DataBase tables from one DataWindow?

Using Modify() function. When a DataWindow is based on a join of multiple tables, we can update all of those tables by modifying attributes DataWindow.Table, UpdateTable and column attributes Update and Key using Modify() function. For example, if the data initially came from DEPARTMENT and EMPLOYEE tables, and DEPARTMENT table was specified as an Update Table when we painted the DataWindow, we need to:

1. Update the DEPARTMENT table using the Update() function:

iRet = dw_1.Update (TRUE (AcceptText(), FALSE (ResetBuffer))

2.Modify the Update characteristics of the DataWindow to point to the Employee table:

IF iRet = 1 THEN

dw_1.Modify(“Dep_id.Update = NO”) dw_1.Modify(“Dep_name.Update = NO”)

dw_1.Modify(“Dep_id.Key = NO”)

dw_1.Modify(“DataWindow.Table.Updatetable = ‘employee’”)

dw_1.Modify(“Dep_id.Update = YES”)

dw_1.Modify(“Dep_name.Update = YES”)

dw_1.Modify(“Dep_id.Key = YES”)




What is the method to validate a numeric column in a DataWindow?



In what attribute of the Transaction object are the database-specific error codes for Connect/Update/Retrieve stored?



How can you change a Select statement of the DataWindow at runtime?

We can change the select statement by using functions SetSQLSelect() or by changing the data attributes Table.Select by calling function Modify().

Modify() is preferable because it works faster.

dw_1.Modify(“datawindow.Table.Select = ‘Select * from customer’”)


What is an Update flag?

We use them when we need to update multiple DataBase tables from one DataWindow.


What is the difference between nested and composite reports?

In a Nested report each report has its own data source. Composite report does not have its own data source-it is just a container for other reports.


Descibe DataWindow Item Status?

















When Insert statement applied in DataWindow what status will be occurred?

NEWMODIFIED! When a row is inserted into a DataWindow it is initially has a row status of NEW!, and all columns in a row initially have a column status of NOTMODIFIED!.


When Update statement applied in DataWindow what status will be occurred?



What Data Sources do you know and how do you use them?

The Data Source determines how we select the data that will be used in the DW object. If the data for the DataWindow object is retrieved from a database, we may choose one of the following Data Sources:

Quick Select is a select from one or multiple tables that are joined through foreign keys and may include simple selection criteria which appear on the WHERE clause. We can only choose columns, selection criteria, and sorting. We cannot specify grouping before rows retrieved, include computed columns, or specify retrieval arguments.

SQL Select is an SQL Select statement from one or more tables in a relational database and may include selection criteria that appear on any of the possible Select statement clauses (can include selection criteria (WHERE clause), sorting criteria (ORDER BY clause), grouping criteria (GROUP BY and HAVING clauses), computed columns, one or more arguments to be supplied during execution.

Query is a predefined SQL Select statement, which must be previously constructed and saved as a Query object.

Stored Procedure indicates that the DataWindow will execute a Stored Procedure and display the data in the first result set. This Data Source only appears if the DBMS to which PowerBuilder is connected and which supports Stored Procedures. We can specify that the data for a DataWindow object is retrieved through a stored procedure if our DBMS supports Stored Procedures.

External is used when the data is not in the database and the DataWindow object will be populated from a script or data will be imported from a DDE application. If the data is not in the DB, we select External as the Data Source. This includes the following situations:

If the DataWindow object is populated from a script

If data is imported from a DDE application

If data is imported from an external file, such as a tab-separated text file (.TXT file) or a dBASE file (.DBF file).

Externalindicates that we have coded a script that supplies the DataWindow object with its data. We use this Data Source when the data is in a .TXT or .DBF file or obtained through DDE. We may also use it when we plan to obtain the data by embedding our own SQL Select statement in a script. With this Data Source the DataWindow object does not issue its own SQL statement. We specify the data columns and their types so that PB can build an appropriate

DataWindow object to hold the data. These columns make up the result set. In a script, we will need to tell PowerBuilder how to get data into the DataWindow in our application. Typically, we will import data during execution using a PowerScript Import function (such as ImportFile() and ImportString() or do some data manipulation and use the SetItem() function to populate the DataWindow.


What functions do you use to change the row status?






How do you stop the user from editing data that is displayed in a field of a DataWindow?

Change the tab value of the field to zero in the DataWindow painter.


In order to sort the contents of a DataWindow, two commands must be used. What are they and what does each do?

SetSort() and Sort().

SetSort() defines the sort criteria (primary, secondary sort files – ascending or descending order, etc.).

Sort() performs the actual sort.


What is the difference between computed columns and computed fields in a DataWindow object?

Computed columns are created as a result of a SQL query on the server side.

Computed fieldsas a result of internal processing by DataWindow on the client side.


When you implement incremental search, there is no Current row, so how do you highlight the row you are looking for?


ll_row = Find()

if ll_row > 0 then SelectRow (ll_row)


What are Extended column attributes? How can you change them dynamically?

It’s DataWindow object property (Expressions) which we can change dynamically using Modify() function.


What is a code table?

  • Specifies whether PowerBuilder uses the code table for the column to validate data.

  • Values are Boolean: True–Uses code table to validate data; False–Does not use code table to validate data.

  • The appearance of the text is specified by the edit mask.

  • Each row in the Code Table is a pair of corresponding values: a display value that user sees and data values-those that are saved in the database.

  • Code Tables are used with DropDownListBox and RadioButtons.


How can you modify a code table during execution?

Using GETVALUE() and SETVALUE() functions.


How do you get the name of a DropDownDataWindow?



How do you trap errors from the DataBase in the DataWindow?

Write some code in the DBError Event

For example:



return 1



What two types of computed columns are allowed in a DataWindow?

  • One from the database side

  • One from the client side


How can you print multiple DataWindows?

We should open the print job by calling the PrintOpen() function. After that, we can print DWs by using PrintDataWindow() function. After that, we close the print job by calling PrintClose(). When we use PrintDataWindow() with PrintOpen() and PrintClose(), we can print several DataWindows in one print job. The info in each DataWindow control starts printing on a new page.


long job

job = PrintOpen() //Each DataWindow starts printing on a new page.

PrintDataWindow(job, dw_EmpHeader)

PrintDataWindow(job, dw_EmpDetail)

PrintDataWindow(job, dw_EmpDptSum)



. How many tables can be updated at the same time in a DataWindow?

One is updated by default. If we want to update multiple tables from DW, we have to write a script for this using MODIFY()


What do you use computed fields for?

We use computed fields if we need some calculation based on column data that change for each retrieved row, some summary statistics system information (as current date and time).


How do you assign the transaction object to the DW control?


When we use SETTRANS(), the DW control uses its own Transaction object and automatically performs connect, disconnect, commit and rollback. The SetTransObject() tells the DW control to share the transaction object with other DW controls. We have to control the database processing and we are responsible for managing database transactions. Application performance is better when we use SetTransObject().


How do you stop the retrieval of the DW immediately?



If the source for a DW is a stored procedure and this stored procedure has parameters, where do we have to pass these parameters?

In the RETRIEVE().


What is the BLOB data type?

Unbound data type that stands for binary large object. Usually used to hold pictures in database, window’s wave sound file or MIDI music.


Can you call batch SQL from your DataWindow?



Explain the difference between SetTrans() and SetTransObject()?

SetTransObject() works faster because it doesn’t perform Connect and Disconnect each time we call it. When we specify SetTrans() system Does all transaction Automatically. When we specify SetTransObject() we have to manage all Transaction by ourselves. When we use SetTrans( ) in a script, the DataWindow uses its internal transaction object and automatically connects and disconnects as needed; any errors that occur cause an automatic rollback. Use SetTrans() when we want PowerBuilder to manage the database connections automatically because we have a limited number of available connections or will be used the application from a remote location. SetTrans() is appropriate when we are only retrieving data and do not need to hold database locks on records the user is modifying. However, for better performance, we should use SetTransObject().


When would you use SetTrans()?

We use SetTrans() when only a limited No. of connections to the DB is allowed or we are only retrieving data and do not need to hold DB locks on records the user is modifying.


Define ‘Retrieve Only as Needed’?

PowerBuilder displays the first row on the screen when its complete retrieveing. When we scroll downward additional rows are retrieved.


How PowerBuilder search for a function?

Bottom – to -Top.


How PowerBuilder search for a function?

Top – to – Bottom.


Will it ignore extra retrieve arguments to the Retrieve() function?

YES, it will ignore extra arguments.


Explain AcceptText() function.

AcceptText() function applies the content of the edit control to the PrimaryBuffer after validating the data. We can also specify to the Update() via argument of call AcceptText() internally before applying the changes to the database.

AcceptText() function should no be called from ItemChanged event. This is because AcceptText() function triggers the ItemChanged event.

Return value is .

Return 1 if succeeds and -1 if its fails.


Explain DBERROR() & ERROR() event.

DBERROR() event is fired when a database related error occurs.

ERROR() event at the DataWindow control level is triggered, when a wrong expression is encountered in the object notaiton.


How to load a text file in a DataWindow?

We can use ImportFile() function.


What STATUS occurs When a row is copied from another DataWindow?



What are the buffers will maintain a DataWindow if set to ReadOnly?

All the four buffers. Primary!, Original!, Delete!, Filter!.


Explain Computed Column

Computed clumn is a column that we define as a part of the SELECT statement. This values are calculated by the database and send to the PowerBuilder.


Explain Computed Field?

Computed fields are defined in DataWindow bands and PowerBuilder calculates these values, not the database server.


How many DataWindow can share the data from a DataWindow?

There is no limitation.


What is DDE?

DDE means Dynamic Data Exchange. This technology allows two different applications talk to each other under MS-Windows environment and exchange data between them.


Explain TriggerEvent()?

TriggerEvent() executes the specifed event’s script right way. All pre-defined events are defined as enumerated data types under TriggerEvent().

TriggerEvent() function executes synchronously, the next command after this command will not be executed untill thios command is executed completly.

Return type is :

Return 1 Successfully Executed.

Return -1 Invalid.


Explain PostEvent()?

PostEvent() will be executed after completing the current script execution. PostEvent() executes asychronously. PostEvent() scripts are bending in the message queue.


Explain Diffrent levels of attribute method protections?

Public, Protected, Private, PrivateRead, PrivateWrite, ProtectedRead, ProtectedWrite.


How do you pass a value to a window at opening time?

Use either OpenWithParm() or OpenSheetWithParm().


How to execute the ancestor event’s script from the decendent’s event?



Can we have Global and Local/Instance variable with the same name?


This.var_1 = 100 //Instance Variable.

var_1 = 100 //Local Variable.

::var_1 = 100 //Global Variable.


Explain CloseQuery event?

PowerBuilder triggers CloseQuery event before it triggers Close event. If CloseQuery event’s script not executed successfully close event will nerver trigger.


Which function is used to change a validation rule in DataWindow at runtime?



Which comman/function will blank out a DataWindow?



Explain Transaction Objects?

Transaction object contains the necessery informaiton needed to connect to a database. Like user id , password..


SetTransObject tells the DataWindow to use specified transaciton object.


The DataWindow control connects and disconnects after each Retrieve or Update function while using SetTrans

When we use SetTrans we can’t update multiple DataWindow object.


Explain SQLSA?

Dynamic Staging Area is internally used by PowerBuilder and is the connection between execution of a statement and Transaction object. SQLSA contains no.of parameters and SQL statements.


Explain SQLDA?

Dynamic Description Area stores information about input and output parameters. The two principle of dynamic SQL are PREPARE and EXECUTE.


Explain types of Windows in PB?


A standlone overlaped window that can be independed of all other windows. Used for single window application.


A window that is dependent on a main window and can only exist within the main(PARENT) window. If minimize the main window as well as the child window is minimizsed. A child window cannot beyond the parent window.


MDI window allows to open multiple window as sheet inside it. When a window inside the MDI window it minimize and maximized wheet icon is displayed at the bottom of the MDI window.


MDIHELP window has additional feature of a status bar at the bottom of the MDIHELP window. This status bar used to display help text like run time.


POPUP window depends on it parent window. POPUP window will behave like a main window. IT the parent window is minimized POPUP window will be hidden.


RESPONSE window equalent of a window dialog box. When a response window is opened from another window the response window can’t minimize and maximize untill the user gives response to the window can»t get another window.


Explain HELT CLOSE keyword?

When PB encounters HALT without the keyword CLOSE, it immediately terminates the application.

When PB encouters HALT with the keyword CLOSE, it immediately executed the script for the close event for the application and then terminates the applicaiton.


Explain MDI?

MDI stand for Multiple Document Interface. It is an application style that allows users to open multiple windows(called sheets) in a single window(called MDI Frame) and to move freely among these sheet.

MDI has two PB window styles:

  • MDI Frame

  • MDI Frame with MicroHelp

MDI Frame has three parts:

  • Frame

  • Client Area

  • Sheets


How to open a window with a parameter?

Opening window with a parameter

Stored in









What is the differents between EVENT and FUNCTION in PowerBuilder?




An action in an object or control that can trigger a script.

A program or rutine that performs specific process.


Top-Down approach

Bottom-Up approach


Event has User Event and System or Built-in Event.

Function has System Function, Object Function, User Define Function, Global Function, Local External Function, Global External Function and Remote Procedure call (RPC).


Event has Public default Access Level

Function can declare Public, Private and Protected Access Level.


Event has PassByVal, PassByRef and ReadOnly.

Function has PassByVal, PassByRef and ReadOnly.


Event can call Object Events Dynamically or Statically.

Function can call Object Level Function Dynamically or Statically.


We can POST or TRIGGER an Event call.

We can POST or TRIGGER a Function call


Events are associated only with objects.

Function can be Global or part of an object’s definition.


Call an undefined event does not trigger an error.

Call an undefined function triggers an error.


Event cannot be Overloaded

Object-Level Function can be OverLoaded.


Events either return a value or do not have a return value.

Function always has return value.


When do you need to use .PBD?

We use .PBD when the number and size of the objects in our application would otherwise make a very large .EXE (1.2 to 1.5 megabytes). we need to share components among several applications. distribute application components selectively, for example, to upgrade an application or fix a bug.


When do you need to use a .PBR?

We create .PBR if we have any dynamically assigned objects, bitmaps or icons and to reduce the number of files we need to distribute with the .EXE. We typically use a .PBR when we have scripts in our application in which we dynamically assign resources to attributes of objects or controls in the application. If we do not use a .PBR, we must distribute various .BMP, .RLE, .ICO files with the application. We must place in .PBD’s any objects that we reference dynamically in scripts in the application.


Why do we create PBR, PBD files?

We create .PBR if we have any dynamically assigned objects, bitmaps or icons to reduce the number of files we need to distribute with the .EXE. We have to create .PBD if we have more than one PBL. It allows us to break the application into smaller units that are easier to manage and makes the executable file smaller, and at execution time we can load any objects that are not contained in the application’s executable file. It makes sense to use PBD when our application is really large.


How many .PBDs can you have for one application?

As many as we need and depending on available memory.


How many .PBRs can you have for one application?



What is .PBR file?

PBR file is an ASCII File in which we list resource names or DW object names that were referenced dynamically in the script.


What types of Menus available in PowerBuilder?

  • DropDown

  • Cascading

  • Pop-up


What is Regenerate option in the Library painter? When is it most useful?

It compiles all codes of an object(s). Regeneration is important during the development of our PB application. Regeneration is useful :

  • when we have an error message with no reason for it;

  • When we upgrade to a new version of PB, the new version should regenerate all its source code to update it;

  • When we make a change to an ancestor window that has many descendants, the changes can be immediately rippled throughout all child window through regeneration. Regenerating could be called “recompiling”. When you regenerate an entry, PowerBuilder recompiles the source form stored in the library and replaces the existing compiled form with the recompiled form.


What are Non-Visual User Objects?

Non-visual user object is an object that encapsulates attributes and functions but is not visible to the user. NVO is a collection of business user functions. They can be Custom Class and Standard Class. NVOs are useful because they allow you to encapsulate application operations into objects making them easier to develop, manage and maintain and also to encapsulate all security management for an application into a single object.


Explain the purpose of a non-visual user objects?

The purpose of non-visual user objects is to define business rules and other processing (which are checked in different windows in your application) that act as a unit. We implement them in PowerBuilder using Class User Objects.


What are facilities of the User Objects?

We define a component once, then reuse it many times as we need without any additional work.


What does OpenUserObject() do?

OpenUserObject() adds a user object to the specified window and makes all its properties and controls available to scripts. windowname.OpenUserObject ( userobjectvar, userobjecttype {, x, y } ) This function is used when you want dynamically, at runtime place some user objects on a window. This function displays this user object, makes all its attributes available to scripts. You must open a user object before you can access the attributes of the user object. If you access the user object’s attributes before you open it, it will cause an execution error.


How can you dynamically place an User Object on the window?

By using functions : OpenUserObject( ), OpenUserObjectWithParm( )


What Events does the Custom Class have?

Constructor and Destructor


What events are available to a standard class User Object?

Constructor and Destructor.


How is a custom visual UserObject different from a standard UserObject?

A custom visual user object is an object that has several controls that work as a unit. A standard visual user object inherits its definition from a standard control. We modify the definition to make the control specific to our applications.

Get From The Internet

Good Luck!

Notify of
Inline Feedbacks
View all comments
Would love your thoughts, please comment.x