I can build walls if I have cement and bricks.
First I wrote classes to implement data types not natively supported by FB.
Then, thanks to the flexibility provided by CVAR (Variants) I could write classes such CDispInvoke, to support COM Automation:
' // Create an instance of the RegExp object
DIM pDisp AS CDispInvoke = "VBScript.RegExp"
' // Set some properties
pDisp.Put("Pattern") = ".is"
pDisp.Put("IgnoreCase") = VARIANT_TRUE
pDisp.Put("Global") = VARIANT_TRUE
' // Execute a search
DIM pMatches AS CDispInvoke = pDisp.Invoke("Execute", "IS1 is2 IS3 is4")
' // Parse the collection of matches
IF pMatches.DispPtr THEN
' // Get the number of matches
DIM nCount AS LONG = VAL(pMatches.Get("Count"))
FOR i AS LONG = 0 TO nCount -1
DIM pMatch AS CDIspInvoke = pMatches.Get("Item", i)
print pMatch.Get("Value")
NEXT
END IF
Without the funky syntaxes used by other wrappers.
It works with any COM server that returns an IDispatch pointer, for example with WMI:
' // Connect with WMI in the local computer and get the properties of the specified printer
DIM pDisp AS CDispInvoke = CWmiServices( _
$"winmgmts:{impersonationLevel=impersonate}!\\.\root\cimv2:" & _
"Win32_Printer.DeviceID='OKI B410'").ServicesObj
' // Set the printer as the default printer
pDisp.Invoke("SetDefaultPrinter")
As I don't like Automation, I have classes for the servers that I'm more interested, e.g. ADO, Regular Expressions, Web Browser, Dictionary Object, WMI, but I always can use CDispInvoke if I need to use an Automation COM server for which I have not written wrappers or that don't have a dual interface.
If FB doesn't fully support unicode with files, no problem: I wrote several classes to work with unicode with both binary and text files.
See the documentation for the WinFBX framework (yes, I not only write it, but I also document it):
https://github.com/JoseRoca/WinFBX/tree/master/docsThe problem is that I can't do the same with O2.
If the goal of O2 is to have an efficient compiler to work with OpenGL and assembler, that's fine with me, but it is not what I need.