Comments
Patrick Collands wrote: collands (AT) gmail com I'd be very grateful for an invitation. Thank you.
Cloud Computing
Conference & Expo
November 2-4, 2009 NYC
Register Today and SAVE !..

SYS-CON.TV
Today's Top SOA Links


PowerBuilder 11's .NET Interoperability
Creating and consuming .NET resources

PowerBuilder 11 deploys entire applications as .NET Windows Form or Web Form applications and deploys individual components as .NET Assemblies and as .NET Web Services. Version 11 consumes resources of the default .NET framework as well as resources of custom developer-defined .NET resources. Non-PowerBuilder .NET solutions can interoperate with, and take advantage of, the unparalleled productivity of PowerBuilder’s data access and data manipulation capabilities. In short, PowerBuilder 11 creates as well as consumes .NET resources.

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.

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.

In order to post a comment you need to be registered and logged in.

Register | Sign-in

Reader Feedback: Page 1 of 1

Anybody have an example that copies a .NET arraylist to a Powerbuilder datawindow or Listview?


Your Feedback
Jerry wrote: Anybody have an example that copies a .NET arraylist to a Powerbuilder datawindow or Listview?
Subscribe to the World's Most Powerful Newsletters
Subscribe to Our Rss Feeds & Get Your SYS-CON News Live!
Click to Add our RSS Feeds to the Service of Your Choice:
Google Reader or Homepage Add to My Yahoo! Subscribe with Bloglines Subscribe in NewsGator Online
myFeedster Add to My AOL Subscribe in Rojo Add 'Hugg' to Newsburst from CNET News.com Kinja Digest View Additional SYS-CON Feeds
Publish Your Article! Please send it to editorial(at)sys-con.com!

Advertise on this site! Contact advertising(at)sys-con.com! 201 802-3021

SYS-CON Featured Whitepapers
ADS BY GOOGLE