Syntax to Support Inheritance from a .NET Class

PowerScript allows you to create nonvisual objects that override all virtual and abstract methods, properties, indexers, and events defined in .NET base classes and interfaces.

This example defines a PowerScript nonvisual object that inherits from a .NET class:
         global type NVO from DotNetClass1, ISub1
         end type
You can use the same syntax for calling PowerScript functions and events to call the functions and events of a .NET class:
        { objectname.} { type } { calltype } { when } name ( { argumentlist } )
This table describes the arguments used in function or event calls. All arguments except the function or event name are optional.
Argument Description
objectname

The name of the object where the function or event is defined, followed by a period or the descendant of that object, or the name of the ancestor class of the object followed by two colons.

type
A keyword specifying the method type you are calling. Values are:
  • FUNCTION (default)
  • EVENT
calltype
A keyword specifying when PowerBuilder looks for the function or event. Values are:
  • STATIC (default)
  • DYNAMIC
when
A keyword specifying when the function or event should execute. Values are:
  • TRIGGER (default) – execute immediately.
  • POST – put in the object's queue and execute after other pending messages have been handled.
name The name of the function or event to call.
argumentlist The values to pass to the function or event. Each value must have a datatype that corresponds to the declared datatype in the function or event definition or declaration.