The following is a complete list of those built-in classes which can be redeclared using the Class statement.
String, [Fixed List], Regional Settings, Class.
This class is primarily described here. For reference, it can be defined like any other class as follows:
Class String:
Public:
Function Length(): Integer;
Function LCase(): String;
Function UCase(): String;
Function Trim(List...: Char): String;
Function LTrim(List...: Char): String;
Function RTrim(List...: Char): String;
Function Left(Count: Integer): String;
Function Right(Count: Integer): String;
Function Mid(Start: Integer; Length: Integer(N)): String;
// Where N is a constant equal to the largest number of
// characters a string can contain.
Function IsInteger(): Boolean;
Enum AllowIntegerSpec {
OrInteger, NotInteger
};
Function IsReal(AllowInt: AllowIntegerSpec(OrInteger)): Boolean;
Function IsBoolean(AllowInt: AllowIntegerSpec(OrInteger)): Boolean;
Enum CaseSensitiveSpec {
CaseSensitive, CaseInsensitive
};
Function InStr (SearchString: String @; Start: Integer; CSS: CaseSensitiveSpec (CaseSensitive)): Integer;
Function InStrRev (SearchString: String @; Start: Integer; CSS: CaseSensitiveSpec (CaseSensitive)): Integer;
Enum FormatTypes {
Decimal, Hex, Octal, Binary
};
Enum TrimmedSpec {
NotTrimmed, Trimmed
};
TypeCast (): Integer;
TypeCast (): UInteger;
TypeCast (): Int8;
TypeCast (): Int16;
TypeCast (): Int32;
TypeCast (): Int64;
TypeCast (): UInt8;
TypeCast (): UInt16;
TypeCast (): UInt32;
TypeCast (): UInt64;
TypeCast (): Char;
TypeCast (): Char8;
TypeCast (): Char16;
TypeCast (): Boolean;
TypeCast (): Single;
TypeCast (): Double;
Operator = (What: String @): String @;
Operator += (What: String @): String @;
Operator + (What: String @): String;
Operator = (What: Integer): String @;
Operator += (What: Integer): String @;
Operator + (What: Integer): String;
// There are similar operator =/+=/+ functions for the other numerical types:
// Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Single, Double
Operator = (What: Char): String @;
Operator += (What: Char): String @;
Operator + (What: Char): String;
// When these operators are applied to character types, the character is
// treated as a string with a length of one.
// There are similar operator =/+=/+ functions for the other Char types:
// Char8, Char16
Private:
// This section differs from one implementation to another but
// probably contains a reference such as this one and a length:
Chars: Char[] @;
UsedLength, AllocLength: UInt16;
End Class;
TypeCast (What: Integer; Format: String::FormatTypes(Decimal)): String;
TypeCast (What: Integer "Bare" Format: String::FormatTypes): String;
TypeCast (What: Integer "Fancy Decimal"): String;
TypeCast (What: Integer "Base" B: Integer;
T: String::TrimmedSpec (NotTrimmed)): String;
// There are similar type casts for the other numerical types:
// Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Single, Double
// To save room, they are not listed here. The last shown type cast applies only
// to integer types; for Single and Double, the type cast is modified as follows:
TypeCast (What: Integer "Base" B: Integer; "Precision" P: Integer;
T: String::TrimmedSpec (NotTrimmed)): String;
TypeCast (What: Char): String;
TypeCast (What: Char; Format: String::FormatTypes): String;
TypeCast (What: Char "Bare" Format: String::FormatTypes): String;
TypeCast (What: Char "Fancy Decimal"): String;
Operator + (lhs: Integer; rhs: String @): String;
// There are similar Operator + functions with the following as lhs:
// Int8, Int16, Int32, Int64, UInt8, UInt16, UInt32, UInt64, Single, Double,
// Char, Char8, Char16
This class, which cannot be instantiated because it has a private constructor, is the data type of:
It contains a variable-size list of items, but the list size cannot be changed.
Class [Fixed Dynamic]: Class Spec: Function Destructor; End Class; Template Spec: Spec; Public: Const Function Size() Returns Integer; Function Destructor(); Abstract Const Operator [] (Index: Integer) Returns @ Spec; Private: Function Constructor(); // Other private member(s) implementation-dependant. End Class;
The Regional Settings class, of which there is one built-in instance called RegionalSettings, tells the String class how to interpret numbers and convert a numeric value to a string.
Class Regional Settings: Public: Function GetSystemSettings();
Class Numbers:
MagnitudeChar: Char(',');
DecimalChar: Char('.');
NegativeChar: Char('-');
PositiveChar: Char('+');
CurrencyChar: Char('$');
Enum Currency Char Positions {
Before, After, Before, After
}
CurrencyPosition: Currency Char Positions(Before);
Enum Negative Formats {
Inherits Currency Char Positions;
Brackets = 4
}
SignPosition: Negative Formats(Before);
IncludePositive: Boolean(False); // Ignored if SignFormat == Brackets
IncludeRedundantZero: Boolean(True); // 0.4
DigitsAfterDecimal: Int8(2); // .dd
DigitsPerGroup: Int8(3); // dd,ddd,ddd
End Class;
Numbers: Numbers;
Operator . Returns Numbers;
// Times
Class Time:
Enum Time Formats { // Flags
// Bit 0: 24-hour if set; Bit 1: Two-digit hour if set
TwentyFourHour = 1, HMMSS = 0, HHMMSS = 2,
}
Format: Time Formats (HHMMSS);
AMString: String ("AM");
PMString: String ("PM");
End Class;
Time: Time;
// Dates
Class Date:
Separator: Char ('/');
Enum Short Date Formats: // Flags
// Bit 0: 2dig day; Bit 1: 2dig month; Bit 2: 4dig year
// Bit 3: use abbreviated month
DMYY, DDMYY, DMMYY, DDMMYY,
DMYYYY, DDMYYYY, DMMYYYY, DDMMYYYY,
DMMMYY, DDMMMYY, DMMMMYY, DDMMMMYY,
DMMMYYYY, DDMMMYYYY, DMMMMYYYY, DDMMMMYYYY,
End Enum;
ShortFormat: Short Date Formats (DDMMYY);
Enum Date Ordering:
DMY, MDY, YMD, YDM
End Enum;
ShortOrder: Date Ordering (DMY);
LongOrder: Date Ordering (MDY);
LongWeekday: Boolean (True);
End Class;
Date: Date;
End Class;
section incomplete
The Class class cannot be redeclared because its name is a reserved word. The declaration below shows the members of Class, but it cannot actually be used in code.
The Class class is used to access information about a class. It must contain the following members:
Class Class: Size: Integer; // Size of class Name: String; // Name of class Namespace: String; // Namespace name BaseClasses: [Fixed List] @ Class; PublishedData: @ Published Data; TagList: @ Tags; Function Is (Other: @ Class): Boolean; Function HasTag (TagName: String @): Boolean; Operator . Returns @ Published Data; Class Tags: Function HasTag (TagName: String): Boolean; Function Count (); Operator [] (Index: Integer): Const String @; Private: // Varies according to implementation End Class; Class Published Data: // The BaseClassData list contains all the base classes, // not just immediate base classes. Class BaseClassData: BaseClassOffset End Class; BaseClassData: [Fixed List] @ Published Data; Private: // Varies according to implementation End Class; Private: // Varies according to implementation End Class;
A pre-initialized instance of Class is created every time you define a class.
When instantiating Template Classes, a new Class instance is created for each set of template argument(s).
| Table of Contents | Qwertie's Site/Mirror |