Table Of Contents

Creating a Class (G Type)

Version:
Last Modified: August 9, 2019

Define the fields and methods of a class using a Class (G Type).

Make sure you are familiar with the terminology in Classes and Object-Oriented Programming.

Complete the following steps to create a Class (G Type).

  1. From the Project Files tab, use the New menu to create a Class (G Type).
  2. To add a class field, add a control or indicator to the Data view of the Class (G Type).
  3. To add a class method, right-click a class in the Project Files tab and select Add member to select a template to use as a starting point.
    Option Description
    for data member access Create an interface that other parts of your program can use to read or write to a class field.
    spd-note-note
    Note  

    You can only create a method for data member access if a control or indicator is present on the Data view of the Class (G Type).

    from dynamic dispatch template Create a version of a method specific to the class. The program chooses the version of the method to execute at run time based on the object the method input accepts.
    from static dispatch template Create a method that has the same functionality for all class objects it accepts.
    Override Create a method that overrides a method on the Member List of a parent class in your project.
    spd-note-note
    Note  

    The option to create a method for override is available only when the Member List of the ancestor class contains a valid member method to override.

    Blank Create an empty method for the class.
    Class Property Create a property that can use methods you create to access fields on the Data view.

Recently Viewed Topics