| By John Strano | Article Rating: |
|
| June 19, 2008 11:00 AM EDT | Reads: |
3,358 |
Once PowerBuilder 11 has deployed an application or a
component as .NET, the developer can begin taking advantage of external .NET
resources on a scripted basis through PowerScript enhancements. The scripted
.NET interoperability in PowerBuilder 11 is predicated on a new conditional
compilation feature. Conditional compilation allows declarations, references
and calls, etc. that are meant for .NET interop to be declared within
preprocessor blocks of code. These preprocessor blocks are constructs similar
to IF statements. If the developer specifies that these #IF/THEN/#ELSE/#ELSEIF
blocks are only for .NET runtime execution, they’re ignored by PowerBuilder’s Win32 compiler.
Conditional Compilation
The developer doesn’t need to commit the syntax of the new
constructs to memory or lose his or her train of thought switching from the IDE
to a help file. A productive addition to the PowerScript editor enables the
developer to quickly paste in the desired flavor of .NET #IF statement (see
Figure 1).
The preprocessor variants allow the developer to provide for a blanket .NET deployment condition and, if they wish, to drill down to specific flavors of that deployment like WinForms, WebForm, Web Services, etc. (see Table 1).
Establishing a Reference to the .NET Assembly
Once the developer has identified a .NET resource of which
they wish to take advantage, the .NET Assembly in question needs to be brought
into the scope of the PowerBuilder .NET target so that script references to it
may be made. Whether your PowerBuilder .NET target is for WinForm, WebForm, a
.NET Assembly, or a .NET Web Service, right-mouse button-click on that target
in the PowerBuilder System Tree and choose “Properties...” from the popup menu (see Figure 2). In the Target Properties window, select the “.NET Assemblies” tab page and click on the button that will allow you to browse for your Assembly. Select your Assembly, then click OK to close the Target Properties
window.
For the purposes of this tutorial, I’ve chosen an Assembly that is part of the default .NET framework, MSCORLIB.DLL (see Figure 3). If you wish, expand the Assembly’s node in the System Tree to browse what’s available in the Assembly’s public interface.
Published June 19, 2008 Reads 3,358
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
About John Strano
John Strano is a Sybase Technology Evangelist and is a charter member of TeamSybase. He has been using PowerBuilder since 1991 and has authored articles for multiple industry periodicals. John has been a Sybase Certified Instructor and has presented Sybase tools on an international basis since 1997. Over the last 17 years John has developed a variety of PowerBuilder applications from single-user scaling up to enterprise-class, web-based projects.
![]() |
Jerry 07/01/08 11:03:10 AM EDT | |||
Anybody have an example that copies a .NET arraylist to a Powerbuilder datawindow or Listview? |
||||
- Ulitzer vs. Ning - a Quick Review
- First Time with AJAX.NET
- Make Your Design Ideas Speak: Using UML in PowerBuilder Projects
- A Review of Key PDF and Font Concepts
- New Features in PowerBuilder 11.5
- PowerBuilder 12 CTP Launch and Code Camp
- PowerBuilder 11.5 Top Feature Picks
- Sybase iAnywhere Broadens Support of Mobile Device Management Solution
- Consuming a SQL Anywhere Native Web Service Using a .NET Client
- PowerBuilder Developer's Journal: Legacy Isn't a Dirty Word
- Sybase to Present at Virtualization Conference & Expo
- How to Circumvent the Seven Deadly Biases
- iPhone Able to Be Adopted by Enterprise Businesses
- SAP & Sybase: Transforming Today's Mobile Workforce
- Ulitzer vs. Ning - a Quick Review
- SYS-CON Launches "PBDJ 2009" Website for PowerBuilder Developer's Journal
- First Time with AJAX.NET
- Make Your Design Ideas Speak: Using UML in PowerBuilder Projects
- Sybase Reports All-Time Best Ever Quarter and Year
- Sybase's Mission to Mobilize the Enterprise is Moving Full Speed Ahead
- PowerBuilder History - How Did It Evolve?
- Custom Common Dialogs Using SetWindowsHookEx
- Book Excerpt: Sybase Adaptive Server Anywhere
- OLE - Extending the Capabilities of PowerBuilder
- DataWindow.NET How To: Data Entry Form
- Sybase ASE 12.5 Performance and Tuning
- DDDW Tips and Tricks
- Working with SOA & Web Services in PowerBuilder
- Office 2003 Toolbar: A New Look For Your Old PowerBuilder App
- Dynamically Creating DataWindow Objects








































