twinBASIC Update: November 7, 2021

Highlights include our first look at a working twinBASIC form, the early makings of inheritance support, and the promise of custom ActiveX control development.

twinBASIC Update: November 7, 2021

On April 23, 2021, I helped Wayne Phillips introduce the world to twinBASIC at the Access DevCon Vienna conference.  I boldly predicted that twinBASIC (along with the Monaco editor) would replace VBA and its outdated development environment by 2025.  With that goal in mind, this weekly update is my attempt to keep the project fresh in the minds of the VBA development community.

Every Sunday, I will be providing updates on the status of the project, linking to new articles discussing twinBASIC, and generally trying to increase engagement with the project.  If you come across items that should be included here, tweet me @NoLongerSet or email me at mike at nolongerset dot com.


GUI Progress Update

Wayne released another sneak peek of twinBASIC forms functionality:

Inheritance Sneak Peek

Wayne is introducing a bit of "pseudo-inheritance" by way of the new Via keyword.

Wayne originally proposed the idea back in April:

So my initial proposal here would be to offer a simple 'Via' keyword on the Implements statement

Class MyClass
   Implements MyBaseClass Via myField	' all methods will be forwarded by the compiler to myField
   Private myField As MyBaseClass = New MyBaseClass

   ' but you can still override implemented members directly...
   Private Sub DoSomething() Implements MyBaseClass.DoSomething
   End Sub
End Class

Granted, this won't expose MyBaseClass privates from MyClass, but the above could be implemented quite easily, and would be a useful step in the right direction I feel.

Wayne posted an animated gif with sample usage (see below).  Note that, as of writing, this feature is not yet live with the latest twinBASIC release.  I assume it will be available sometime this week.

Around the Web

Using twinBASIC to Write Custom ActiveX Controls

In what I think may turn out to be the single biggest benefit to Microsoft Access development from the twinBASIC project, Wayne confirmed that tB will eventually support the creation of custom ActiveX controls.  Thus, I could imagine someone creating something like a custom calendar control in twinBASIC that could be referenced from within MS Access.  

This has the potential to jumpstart the market for third-party Access control development in the near future.

twinBASIC Parser Tidbit

In what later devolved into a rather testy discussion over at VBForums, Wayne waded in with an interesting tidbit about the twinBASIC parser (this in response to another commenter assuming that he was using the ANTLR grammar which is the foundation for the RubberduckVBA project):

Just FYI, twinBASIC has always used a brand new parser, written from scratch in C++.  Nothing is used from RubberDuck, and we don't use ANTLR.

The rest of the thread seems to be off-topic flamethrowing unrelated to tB, but I found the above comment interesting nonetheless.


Here are the updates from the past week.  You can also find this information by installing the twinBASIC VS Code extension and clicking on the Changelog tab of the extension page:

[v0.11.1368, 1st November 2021]

  • improved: reworked the copy/paste context menus for the form designer, should now work more reliably
  • added: 'Duplicate' context menu option when right clicking on a control, or multiple controls, in the form designer
  • fixed: 'Copy {x} To' context menu option in property sheet

All original code samples by Mike Wolfe are licensed under CC BY 4.0