This section discusses some basic concepts and terms you need to be familiar with before you start using PowerBuilder to develop applications and components.
In PowerBuilder, you work with one or more targets in a workspace. You can add as many targets to the workspace as you want, open and edit objects in multiple targets, and build and deploy multiple targets at once.
A PowerBuilder target can be one of several types:
-
Application target
A client/server or multitier executable application. Most of this book is concerned with building application targets. See Working with Targets.
The Application target will use the PowerBuilder's built-in language, PowerScript.
-
C# Projects (Web API, etc.)
SnapDevelop will be opened to create the C# project.
The C# project will use the C# language. For how to create a C# project in SnapDevelop, refer to the SnapDevelop documentation.
You choose targets in the New dialog box. Here are the Target types that are available in PowerBuilder:
For more information about creating a workspace and targets, see Creating and opening workspaces and Creating a target.
Your application is a collection of objects.For most targets, PowerBuilder provides many types of objects, including graphical objects such as windows, menus, and buttons, and nonvisual objects such as datastore, exception, and timing objects.
As you work in your application, you create new objects and open existing objects to continue work on their development.
For more information about creating, opening, and editing objects, see Working with objects.
The applications you build are often centered around your organization's data. With PowerBuilder you can define DataWindow objects to retrieve, display, and manipulate data. For more information about DataWindow objects, see Defining DataWindow Objects.
As you work in an application, component, or .NET target, the objects you create are stored in one or more libraries (PBL files) associated with the application. When you run your application, PowerBuilder retrieves the objects from the library.
PowerBuilder provides a Library painter for managing your libraries. For information about creating a new library and working with libraries in the Library painter, see Working with Libraries.
Some of the editors you use to edit objects are called painters. For example, you build a window in the Window painter. There you define the properties of the window, add controls such as buttons and labels, and code the window and its controls to work as your application requires.
PowerBuilder provides painters for windows, menus, DataWindow objects, visual and nonvisual user-defined objects, functions, structures, databases, data pipelines, and the application itself. For each of these object types, there is also a Source editor in which you can modify code directly. See Working in painters and Using the Source editor.
There is also a file editor you can use to edit any file without leaving the development environment. See Using the file editor.
Applications are event-driven: users control the flow of the application by the actions they take. When a user clicks a button, chooses an item from a menu, or enters data into a text box, an event is triggered. You write scripts that specify the processing that should happen when the event is triggered.
For example, buttons have a Clicked event. You write a script for a button's Clicked event that specifies what happens when the user clicks the button. Similarly, edit controls have a Modified event that is triggered each time the user changes a value in the control.
You write scripts using PowerScript, the PowerBuilder language, in a Script view in the painter for the object you are working on. Scripts consist of PowerScript functions, expressions, and statements that perform processing in response to an event. The script for a button's Clicked event might retrieve and display information from the database; the script for an edit control's Modified event might evaluate the data and perform processing based on the data.
Scripts can also trigger events. For example, the script for a button's Clicked event might open another window, which triggers the Open event in that window.
PowerScript provides a rich assortment of built-in functions you use to act upon the objects and controls in your application. There are functions to open a window, close a window, enable a button, retrieve data, update a database, and so on.
You can also build your own functions to define processing unique to your application.
All the objects and controls in an application or component have properties, many of which you set as you develop your application. For example, you specify a label for a button by setting its text property. You can set these properties in painters or set them and modify them dynamically in scripts.
If you are working with other developers on a large application, you can make sure you are working with the latest version of a component or object by synchronizing the copy of the object you are working on with the last version of the object checked into a source control system. PowerBuilder provides native interface options of SVN and Git for directly performing source control operations and functions in the PowerBuilder IDE. For more information, see Using Source Control.
You can use PowerBuilder extension objects in an application in the same way as you would built-in PowerBuilder objects, with one difference -- you must import the file that contains the definition of the extension into a library in the target. Some extensions are provided with PowerBuilder, but you can also obtain them from third parties or build your own.
For more information about the extensions provided with PowerBuilder, see PowerBuilder Extension Reference. For how to build your own extensions, see PowerBuilder Native Interface Programmers Guide and Reference.