twinBASIC Update: June 4, 2023
Highlights include a search option to match whole words only, some handy ways to generate GUIDs, and a clever way to deploy and register custom ActiveX controls.
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:
- Custom twinBASIC IDE Installation Guide (NOTE: the twinBASIC VSCode extension is under a feature freeze until 2023)
- GitHub Issue Tracker (report bugs)
- twinBASIC Discord Server (chat about the project)
- twinBASIC/VBx LinkedIn Group
Highlights
Find Whole Word Only
This additional search option has been added to both the Find and Find in Project dialogs.
Edit > Find...
Edit > Find in Project...
Insert GUID CodeLens
BETA 323 added a new CodeLens–insert a randomly generated GUID–that will appear when an empty string literal is passed to ClassId/InterfaceId/EventInterfaceId:
Upon clicking the "insert a randomly generated GUID" link, the ClassID line gets autocompleted with a random GUID. This is an important feature because the entire COM ecosystem works via these "globally unique identifiers."
You can also generate GUID's directly via the CreateGuid function. This is mainly intended to be used via the Debug Console:
GitHub Case Cleanup
Wayne appears to have done some spring cleaning in the GitHub repository, having closed 81 cases over the past week with a variety of resolutions. The closed cases generally fell into one of the following buckets:
- The feature/bug was implemented/fixed but the GitHub issue never got closed
- The issue was related to the now-defunct VS Code twinBASIC extension
- The requested feature will not be implemented
- There are no recent reports of a months-old bug (so assumed resolved)
- The issue is a duplicate or otherwise covered by another open issue
Around the Web
VBA Runtime Registration of a twinBASIC ActiveX Control
Over in GitHub, Ben Clothier posted an algorithm to register an ActiveX control at runtime without requiring a custom installer. The opening paragraph of his GitHub issue sums up the algorithm:
To enable a xcopy deployment and not depend on a custom installer, we may have routines that will ensure the the dependent DLLs are extracted at runtime and in the case of an ActiveX control, regsvr32
is invoked to register it. During the startup of an Access application, we will run code necessary to check whether the DLL are installed and registered. if it's not, it will perform the setup required and continue with the rest of startup.
If I understand it correctly, the existing algorithm already works to perform the automatic ActiveX control registration. It appears he posted it as a bug report because it currently requires the user to close and reopen Access after the initial run.
Under Expected Behavior, Ben provides the following note:
Hopefully, it should be possible to start using the ActiveX controls that was just registered in the same session without requiring a restart of Access.
In the meantime, though, Ben's sample code to register an ActiveX control at runtime–even with the added requirement of restarting Access–simplifies deployments of custom ActiveX controls.
Changelog
Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.
WARNING: The following issue is present in BETA builds 202 - 324 (the latest build as of publication):
- there are known memory leaks in these versions, so memory usage will be higher than normal
BETA 318
- fixed: stutter when moving controls around in the form designer on some systems [ HyperPixels, private ]
- fixed: F1 (help) could cause crash on some systems, when no help file is set
BETA 319
- fixed: 'statement too large' error in some circumstances involving large UDT assignments [ baka, discord ]
BETA 320
- fixed:
Get
/Put
statements issue involving simple UDTs inside arrays that have padding in memory but not on disk [ baka, discord ] - improved: Find-In-Files results list now gives a visual indicator of the last clicked entry [ Tecman, discord ]
- added: 'Match whole word only' option to the Find-In-Files dialog [ Tecman, discord ]
- fixed: 'PtrSafe' was shown in hover tooltips on x64, even if the PtrSafe attribute was missing [ Tecman, discord ]
BETA 321
- improved: Find-In-Files 'Match whole word only' algorithm [ Tecman, discord ]
- fixed: (regression since BETA 315) cut/copy/paste broken when monaco Find box is open [ fafalone, discord ]
- fixed: edge case involving VBP parsing reference with high version numbers
- improved: IDE tab history is now tracked, and after closing a tab, the previously activated tab will be refocused [ fafalone, discord ]
- improved: IDE hover over arrays whilst debugging would give a string-sorted list rather than index-ordered [ Tecman, discord ]
BETA 322
- fixed: most of the intellisense icons now match up to the correct monaco icons [ Tecman, discord ]
BETA 323
- improved: 'insert a randomly generated GUID' codelens will now also appear when an empty string literal is passed to ClassId/InterfaceId/EventInterfaceId [ fafalone, discord ]
- added: [_HiddenModule].CreateGUID method, wrapper for CoCreateGuid, for use in the debug console [ fafalone, discord ]
- added: 'Clear All Breakpoints' option in Debug menu [ Tecman, discord ]
- fixed: TypeName(UserControl) would return 'Object' instead of the real control name [ https://github.com//issues/1569 ]
- fixed: KeyDown event not firing for arrow keys [ https://github.com//issues/1564 ]
- fixed: UserControl child control tooltips not showing [ https://github.com//issues/1563 ]
BETA 324
- fixed: property-let on control array element not working when accessed from outside of the class [ https://github.com//issues/1562 ]
- improved: light-theme menus are now themed [ Tecman, discord ]
- improved: light-theme find-all results are now themed [ Tecman, discord ]