Using Keywords in Identifiers

Problem Description

Connecting various assemblies developed in third-party development environments may cause a situation when a Fore.NET code needs to use types or type members, which names match keywords of the Fore.NET language.

Solution

To use keywords in identifiers, put the @ character before them. When types or type members are imported from linked assemblies, this character is automatically added before all names that match Fore.NET keywords.

Example

Imports TestLibrary;
Imports System.Windows.Forms;

Public Class MyTextBox: TextBox
    //Redefine the Readonly property
    New Public Property @Readonly: boolean
    Get
    Begin
        Return Inherited @Readonly;
    End Get
    Set
    Begin
        //Additional code before setting value
        Inherited @Readonly :=;
    End Set
    End Property;
    //Description of custom method, which name
    //matches the Case keyword
    Public Sub @Case();
    Begin
        //...Procedure code...
        //Call static method, which name
        //matches the Shared keyword
        TestClass.@Shared();
    End Sub;
End Class;

The specified class is the TextBox component. The class has the Readonly property redefined and the Case method implemented. An assembly that includes the TestLibrary namespace should be connected to the .NET assembly. This namespace should describe the TestClass class that has the Shared static procedure.

The description includes the @ character to specify all identifiers matching keywords in the Fore.NET language.

See also:

Fore.NET Language Features