twinBASIC Update: October 9, 2022

Highlights include support for control and menu arrays, a Type Library Viewer (Object Browser equivalent), and a video interview with twinBASIC creator Wayne Phillips.

twinBASIC Update: October 9, 2022

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.

Here are some links to get involved with the project:


Highlights

Control and Menu Arrays Now Supported

From Wayne,

{ALL_CONTROLS}.Index property is now implemented in BETA 141 (giving controls array support)

This includes support for menu arrays.

Type Library Viewer

There's a new Type Library Viewer available.  Think of it as a more transparent–and, thus, lower-level–version of the VBx Object Browser utility.  

The VBx Object Browser shows classes, properties, methods, and events using a custom interface with a pair of combo boxes and a pair of list boxes.  The interface is simpler than a typical code window.  There is a very high signal-to-noise ratio.

The twinBASIC Type Library Viewer shows interfaces, classes (via CoClass, aka the component class statement), properties, methods, and events using the familiar coding environment.  For advanced programmers, staying in the coding environment requires less "context-switching," which should make it easier to remain in one's programming flow.  

The Type Library Viewer also displays enum values in both decimal and hexadecimal form.  Unique identifiers are shown for interfaces, coclasses, and the library itself.  The Type Library Viewer also shows the dispatch identifiers (DispId) and vtable offsets for interface properties and methods.

The twinBASIC Type Library Viewer provides all the same information as the VBx Object Library (plus loads more low-level info) but does so in a way that may be overwhelming to beginning programmers.

VBA Version

twinBASIC Version

My Thoughts

I don't think the Type Library Viewer is a good replacement for the VBx Object Browser.  

I think it would overwhelm beginning programmers.  The Object Browser is a much more user-friendly tool, especially for non-programmers.  I think twinBASIC should/will eventually have something more similar to the VBx Object Browser.  

That said, the Type Library Viewer is an awesome tool for those programmers who are comfortable working at the lowest levels of COM.

In fact, this is exactly the sort of feature I had in mind when I wrote the following on the topic page for the twinBASIC Guiding Principles discussion:


When @bclothier first opened this discussion, I had thought about suggesting something like the following:

Easy to learn, but with no artificial limits.

The idea is that the language should very much be approachable to beginning programmers, but it should not put child safety locks on all the cabinets that hold the useful (but potentially harmful) chemicals.

I think to Ben's point about nurturing the ecosystem of tB, there definitely needs to be support for very advanced tB developers to be able to build the tools necessary for the rest of us to not have to think about some of those more advanced concepts.  I'm thinking about implementing high-performing data structures, for example.

With the recent introduction of the twinBASIC package manager, this further cements the need for allowing some small subset of tB developers to be able to do very low level things within the language.  However, the new tB developer should not have to worry about those things.  In fact, most tB developers should be able to make a full career producing useful software without those low-level tools.  But they absolutely should be there!


Around the Web

Karl Donaubauer Interviews Wayne Phillips

In case you missed it, Karl Donaubauer interviewed twinBASIC creator Wayne Phillips on Episode 4 of his Microsoft Access NewsCast:

I covered the entire episode in an article last week, including this quote from Wayne regarding the future of twinBASIC with regard to Microsoft Access (and Office VBA more generally):

"I would be surprised if we were here next year at this point and we didn't have at least some level of integration into Office VBA.  I envisage in some way probably code editing inside of things initially. But there will be further integration which is planned, too. Obviously, time frame is always difficult to judge, but I would think in a year's time we should be having a glimpse of where we're going with Access."

Changelog

Here are the updates from the past week.  You can also find this information by visiting the GitHub twinBASIC Releases page.

Releases · WaynePhillipsEA/twinbasic
Contribute to WaynePhillipsEA/twinbasic development by creating an account on GitHub.

BETA 136

  • added: EXPERIMENTAL type library viewer (text/source) via References nodes [ https://github.com//discussions/1212 ]

BETA 137

  • improved: lots of improvements and changes to the type library viewer (inc F12 goto definition support) [ https://github.com//discussions/1212 ]
  • fixed: IDE panel filter was duplicating each key entry [ wqweto, discord ]
  • fixed: Global.LoadRes* and LoadPicture arguments corrected from ByRef to ByVal [ wqweto, discord ]

BETA 138

  • fixed: restricted the special handling of IDispatch root interfaces to just the stdole defined one [ wqweto, discord ]

BETA 139

  • added: {ALL_CONTROLS}.MouseIcon is now implemented [ https://github.com//issues/1188 ]
  • added: {ALL_CONTROLS}.ToolTipText is now implemented [ https://github.com//issues/1188 ]
  • fixed: extra double quotes around some Descriptions in the type library viewer, and syntax highlighting not right in MSMXL [ https://github.com//issues/1217 ]
  • improved: VBA.ConvertIconToBitmap now takes an optional BackColor (Variant/OLE_COLOR) argument [ https://github.com//issues/1215 ]
  • fixed: WinNativeForms.TreeView SelectedItem is now a get/let/set property [ https://github.com//issues/1214 ]
  • fixed: WinNativeForms.TreeView DropHighlight is now a get/let/set property [ https://github.com//issues/1214 ]
  • improved: form designer property sheet does not clear when starting a drag selection area to prevent unnecessary flicker [ https://github.com//issues/1204 ]
  • improved: form designer property sheet scroll position is retained when the selected control type is not changed [ https://github.com//issues/1204 ]
  • improved: event caret position improved when double-clicking on a control [ AlienSoft, discord ]

BETA 140

  • improved: SHIFT+F2 now triggers the goto-definition action
  • fixed: constant vs enums resolving order issue [ https://github.com//issues/1181 ]

BETA 141

  • improved: Control arrays are now supported [ https://github.com//issues/1188 ]
  • fixed: MsgBox/InputBox now using the ActiveForm hwnd as parent [ AlienSoft, discord ]
  • fixed: all ToolTipText property changes now get reflected live if the value changes whilst the tooltip is being displayed
  • fixed: red flashing container control indicator had been lost in recent builds when adding controls into a container in the form designer
  • fixed: crash on error reporting for one particular error case [ nextKast, discord ]
  • fixed: ambiguous 6660 message box error in case of bad form names [ https://github.com//issues/1221 ]

BETA 142

  • improved: cryptic error number messages now at least include an error message alongside them
  • fixed: (regression) BETA 141 was unable to build custom control forms (e.g. Sample 6/8) [ https://github.com//issues/1227 ]

BETA 143

  • fixed potential crash when parsing a source file on line ~32768 due to bad encoding of symbol position [ fafalone, discord ]
  • improved: ComboBox with Dropdown-List style now shows the control name inside the control (IDE only) to match VBx designer [ fafalone, discord ]
  • fixed: controls that are hidden due to container clipping are no longer selectable in the IDE from outside of the container [ https://github.com//issues/1228 ]
  • fixed: can't pass control array to a Byref argument [ https://github.com//issues/1231 ]

BETA 144

  • fixed: Index parameter of control array events was incorrect when the event was defined in the classic VBx style [ https://github.com//issues/1188#issuecomment-1272310616 ]
  • fixed: syntax highlighting was broken after line 32767 in a source file
  • fixed: TLB-based unrestricted IUnknown definition not allowing access to IUnknown members due to internal substitution [ https://github.com//issues/1237     ]
  • fixed: refined the control array/collection support [ https://github.com//issues/1239     ]

BETA 145

  • fixed: some issues with form designer Events list due to internal changes to control arrays

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