Hello Charles, i would like to create a static class (or a global class that is initialized AFTER its definition).
class THECLASS
method constructor(int a)
end method
end class
FUNCTION THESUB(byref THECLASS *v) AS INT
' nothing
END FUNCTION
' This works fine.
NEW THECLASS a(1)
THESUB(a)
' This raises compile-time error.
NEW STATIC THECLASS a2(2)
THESUB(a2)
The Static portion reports:
ERROR: ERROR: nesting error `endif` (no beginning)
WORD: endif
LINE: 209
FILE: "main source
It almost works if i do this:
dim static THECLASS a2 : a2.constructor(2)
THESUB(a2)
I can use the class a2 as normal... but then THESUB doesnt recognize it's datatype and rejects it as a parameter...
ERROR: ERROR: parameters mismatch for procedure thesub
params given : #theclass@1
OPTIONS:
thesub(theclass) returns int
WORD: a3
LINE: 210
FILE: "main source