Application Techniques

Appeon PowerBuilder® 2019 R3

FOR WINDOWS

DOCUMENT ID: DC37774-01-1900-01

LAST REVISED: April 16, 2021

Copyright © Appeon. All rights reserved.

This publication pertains to Appeon software and to any subsequent release until otherwise indicated in new editions or technical notes. Information in this document is subject to change without notice. The software described herein is furnished under a license agreement, and it may be used or copied only in accordance with the terms of that agreement.

Upgrades are provided only at regularly scheduled software release dates. No part of this publication may be reproduced, transmitted, or translated in any form or by any means, electronic, mechanical, manual, optical, or otherwise, without the prior written permission of Appeon Inc.

Appeon and other Appeon products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Appeon Inc.

SAP and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP and SAP affiliate company.

Java and all Java-based marks are trademarks or registered trademarks of Oracle and/or its affiliates in the U.S. and other countries.

Unicode and the Unicode Logo are registered trademarks of Unicode, Inc.

All other company and product names mentioned may be trademarks of the respective companies with which they are associated.

Use, duplication, or disclosure by the government is subject to the restrictions set forth in subparagraph (c)(1)(ii) of DFARS 52.227-7013 for the DOD and as set forth in FAR 52.227-19(a)-(d) for civilian agencies.

Appeon Inc., 1/F, Shell Industrial Building, 12 Lee Chung Street, Chai Wan District, Hong Kong

Table of Contents

Sample Applications
Using Sample Applications
About the sample applications
Installing the sample applications
Opening the sample applications
Using the Code Examples application
Language Techniques
Selected Object-Oriented Programming Topics
Terminology review
PowerBuilder techniques
Other techniques
Selected PowerScript Topics
Dot notation
Constant declarations
Controlling access for instance variables
Resolving naming conflicts
Return values from ancestor scripts
Types of arguments for functions and events
Ancestor and descendant variables
Optimizing expressions for DataWindow and external objects
Exception handling in PowerBuilder
Garbage collection and memory management
Efficient compiling and performance
Reading and writing text or binary files
Getting Information About PowerBuilder Class Definitions
Overview of class definition information
Examining a class definition
User Interface Techniques
Building an MDI Application
About MDI
Building an MDI frame window
Using sheets
Providing MicroHelp
Using toolbars in MDI applications
Sizing the client area
About keyboard support in MDI applications
Managing Window Instances
About window instances
Declaring instances of windows
Using window arrays
Referencing entities in descendants
Using Tab Controls in a Window
About Tab controls
Defining and managing tab pages
Customizing the Tab control
Using Tab controls in scripts
Using TreeView Controls
About TreeView controls
Populating TreeViews
Managing TreeView items
Managing TreeView pictures
Using DataWindow information to populate a TreeView
Using Lists in a Window
About presenting lists
Using lists
Using drop-down lists
Using ListView controls
Using Drag and Drop in a Window
About drag and drop
Drag-and-drop properties, events, and functions
Identifying the dragged control
Providing Online Help for an Application
Creating help files
Providing online help for developers
Providing online help for users
Data Access Techniques
Using Transaction Objects
About Transaction objects
Working with Transaction objects
Using Transaction objects to call stored procedures
Supported DBMS features when calling stored procedures
Using MobiLink Synchronization
About MobiLink synchronization
How the synchronization works
Working with PowerBuilder synchronization objects
Preparing consolidated databases
Creating remote databases
Synchronization techniques
Using PowerBuilder XML Services
About XML and PowerBuilder
About PBDOM
PBDOM object hierarchy
PBDOM node objects
Adding pbdom.pbx to your application
Using PBDOM
Handling PBDOM exceptions
XML namespaces
Manipulating Graphs
Using graphs
Populating a graph with data
Modifying graph properties
Accessing data properties
Using point and click
Implementing Rich Text
Using rich text in an application
Using a RichText DataWindow object
Using a RichTextEdit control
Rich text and the end user
Piping Data Between Data Sources
About data pipelines
Building the objects you need
Performing some initial housekeeping
Starting the pipeline
Handling row errors
Performing some final housekeeping
Using RESTFul Web Services with JSON
Supported JSON formats
Importing JSON data
Compressing and extracting data
Supporting OAuth 2.0 Authorization Server
OAuth Grant Types
Program Access Techniques
Calling .NET Assembly in an Application
About .NET assembly
C# language vs. PowerScript language
Adding an adapter for unsupported features
Importing the adapter
Deploying .NET assembly
Debugging .NET assembly
Using DDE in an Application
About DDE
DDE functions and events
Using OLE in an Application
OLE support in PowerBuilder
OLE controls in a window
OLE controls and insertable objects
OLE custom controls
Programmable OLE Objects
OLE objects in scripts
OLE information in the Browser
Advanced ways to manipulate OLE objects
Building a Mail-Enabled Application
About MAPI
Using MAPI
Using External Functions and Other Processing Extensions
Using external functions
Using utility functions to manage information
Sending Windows messages
The Message object
Context information
Developing Distributed Applications
Distributed Application Development with PowerBuilder
Distributed application architecture
Server support
Building a COM or COM+ Client
About building a COM or COM+ client
Connecting to a COM server
Interacting with the COM component
Controlling transactions from a client
Building an EJB client (obsolete)
Developing Web Applications
Web Application Development with PowerBuilder
Building Web applications
.NET Web components (obsolete)
Web services (obsolete)
Web DataWindow (obsolete)
DataWindow Web control for ActiveX (obsolete)
Building a Web Services Client (Obsolete)
General Techniques
Internationalizing an Application
Developing international applications
Using Unicode
Internationalizing the user interface
Localizing the product
Building Accessible Applications
Understanding accessibility challenges
Accessibility requirements for software and Web applications
Creating accessible software applications with PowerBuilder
About VPATs
Testing product accessibility
Printing from an Application
Printing functions
Printing basics
Printing a job
Using tabs
Stopping a print job
Advanced printing techniques
Managing Initialization Files and the Windows Registry
About preferences and default settings
Managing information in initialization files
Managing information in the Windows registry
Building InfoMaker Styles and Actions
About form styles
Naming the DataWindow controls in a form style
Building and using a form style
Modifying an existing style
Building a style from scratch
Completing the style
Using the style
Deployment Techniques
Packaging an Application for Deployment
About deploying applications
Creating an executable version of your application
Delivering your application to end users
Deploying Applications and Components
Deploying applications, components, and supporting files
PowerBuilder Runtime Packager
Third-party components and deployment
PowerBuilder runtime files
Database connections
Java support
PowerBuilder extensions
PDF and XSL-FO export
Deploying 64-Bit Windows Applications
Deploying 64-Bit Windows Applications