Surrounding Code in a .NET Block
Because the main PowerBuilder
compiler does not recognize the classes imported from .NET assemblies,
you must surround the code referencing those classes in a conditional
compilation block for a .NET application.
For example, to reference
the .NET message box Show function, you must
surround the function call with preprocessor statements that hide
the code from the main PowerBuilder compiler:
the .NET message box Show function, you must
surround the function call with preprocessor statements that hide
the code from the main PowerBuilder compiler:
1 |
#IF Defined PBDOTNET Then |
1 |
System.Windows.Forms.MessageBox.Show ("This "& |
1 |
+ "message box is from .NET, not "& |
1 |
+ "PowerBuilder.") |
1 |
#END IF |
The PBDOTNET symbol can be used for all types of .NET targets
supported by PowerBuilder. You can also use the following symbols
for specific types of .NET targets: PBWEBFORM, PBWINFORM, and PBWEBSERVICE.
You can paste preprocessor statements into the Script view.
Select Edit > Paste Special > Preprocessor and select the statement
you need.
Parent topic: Conditional Compilation
Document get from Powerbuilder help
Thank you for watching.
Subscribe
Login
0 Comments
Oldest