forked from cosmonaut/wraith-lang
42 lines
631 B
OpenEdge ABL
42 lines
631 B
OpenEdge ABL
|
struct YourStruct
|
||
|
{
|
||
|
yourInt: int;
|
||
|
}
|
||
|
|
||
|
struct MyStruct
|
||
|
{
|
||
|
myInt: int;
|
||
|
myBool: bool;
|
||
|
yourStructReference: Reference<YourStruct>;
|
||
|
yourStruct: YourStruct;
|
||
|
|
||
|
Increment(): void
|
||
|
{
|
||
|
myInt = myInt + 1;
|
||
|
}
|
||
|
|
||
|
static MyFunction(input: int): int
|
||
|
{
|
||
|
return input * 2;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
struct Program
|
||
|
{
|
||
|
static Main(): int
|
||
|
{
|
||
|
myStruct: MyStruct;
|
||
|
myReference: Reference<MyStruct>;
|
||
|
myInt: int;
|
||
|
|
||
|
myReference = alloc MyStruct;
|
||
|
|
||
|
myInt = MyStruct.MyFunction(2);
|
||
|
|
||
|
myStruct.myInt = myInt;
|
||
|
myStruct.Increment();
|
||
|
|
||
|
return myStruct.myInt;
|
||
|
}
|
||
|
}
|