| By John Strano | Article Rating: |
|
| June 19, 2008 11:00 AM EDT | Reads: |
3,881 |
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,881
Copyright © 2008 SYS-CON Media, Inc. — All Rights Reserved.
Syndicated stories and blog feeds, all rights reserved by the author.
More Stories By 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? |
||||
- SQL Anywhere Server and AJAX
- PowerBuilder Top Feature Picks
- The Difference Between Web Hosting and Cloud Computing
- PowerBuilder 12 and .NET
- Sybase CTO to Speak at 4th International Cloud Computing Expo
- Migrating Legacy Client/Server PowerBuilder Apps
- Why SOA Needs Cloud Computing - Part 1
- PowerDesigner 15: Expanding Data Modeling into Your Enterprise
- Five Reasons to Choose a Private Cloud
- PowerBuilder and .NET: Development Strategy
- SQL Anywhere Server and AJAX
- PowerBuilder Top Feature Picks
- The Difference Between Web Hosting and Cloud Computing
- PowerBuilder 12 and .NET
- Sybase CTO to Speak at 4th International Cloud Computing Expo
- SYS-CON's iPhone Developer Summit Day One ROCKS
- A Review of Key PDF and Font Concepts
- Migrating Legacy Client/Server PowerBuilder Apps
- New Features in PowerBuilder 11.5
- New Features in PowerBuilder 11.5
- Where Are RIA Technologies Headed in 2008?
- PowerBuilder History - How Did It Evolve?
- Custom Common Dialogs Using SetWindowsHookEx
- DDDW Tips and Tricks
- OLE - Extending the Capabilities of PowerBuilder
- DataWindow.NET How To: Data Entry Form
- Book Excerpt: Sybase Adaptive Server Anywhere
- Sybase ASE 12.5 Performance and Tuning
- Working with SOA & Web Services in PowerBuilder
- Office 2003 Toolbar: A New Look For Your Old PowerBuilder App





































