twinBASIC Update: March 12, 2023
Highlights include IDE bookmarks, improvements to the debugging experience, and a sampling of how twinBASIC is being used today.
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
IDE Bookmarks
- added: Bookmarks feature in the IDE (available via context menu in code editor)
- improved: code editor Bookmarks are now kept in-sync with code edits
- improved: code editor Bookmarks are now kept in-sync with file renames
Debugging Quality of Life Improvements
- added: 'Debugger: Immediate Memory Invalidation' project option, to help detect hard to reproduce stale pointer errors
- added: "Show Timestamps" option in the Debug Console (default True, press "..." to access the menu to toggle the option) [ Tecman, discord ]
- improved: find/replace in-page (CtrlF/CtrlH) now allows for line breaks in the selection text [ fafalone, discord ]
Around the Web
VBA vs. Python ... vs. twinBASIC?
Over on the VBA subreddit, someone asked a question about whether an Excel automation task should be done in Python or VBA. The top rated answer suggested twinBASIC as a third option for automating small :
If you're going outside of the Office environment, of course Python may be the way to go - but even in that case you may want to check out TwinBasic which could eventually make VBA on a par with Python in terms of being able to code a much broader range of applications than Office-centric ones.
twinBASIC Projects
Over in the twinBASIC Discord server, Wayne posted a simple prompt, "Tell me what you're using twinBASIC for at the moment." Here is a sampling of some of the responses:
Ben Clothier
I wrote a console exe to be used for communicating 64-bit Access to 32-bit library (DLL surrogate did not work in this scenario). It was a simple application to support OPOS [OLE for Retail Point of Sale] which can be only 32-bit.
There is also an ActiveX dll that is used to provide webview2 functionality for Access for use with PBI [Power BI] (requires a modern web browser).
I also have a on-off project building a COM addin to port the micro-ORM written for Access (for use w/ SQL Server) to make it easy to update the VBA entry points into SQL Server programmability objects.
FullValueRider
Just creating a better environment to allow me to have much less boilerplate code when solving advent of code problems, so the focus is on more flexible collections and dictionaries, the reflection needed to make the code for those simpler, and a universal enumerator that will take any variable and enumerate it without the need for behind the scenes for next jiggery pokery(enumerate forwards backwards, start at start or end, get item, key(offset from first index) and index(index from 0), pass the enumerator object as a method parameter, enumerate multiple collection/dictionaries in parallel.
fafalone
Mostly just my open source projects... I'm working on newer DirectComposition demo I'm doing in tB first (and likely only since there's so much other stuff I want to get to) since it has that vbNullPtr feature vb6 doesn't and I'm probably going to have to do a substantial rewrite of oleexp's DirectX stuff to make the workaround usable (middle-optional UDTs->As Any to be able to pass a null ptr), and do plan get to my project to make a filter driver at some point soon. I've got a few personal apps that use my shell controls and shell interfaces, and i've been moving those to tB to take advantage of x64-- because Office and some other apps only have 64bit shell extensions in their 64bit versions, and you can't e.g. read/edit Office document properties via the Windows property system and load the preview handlers in 32bit applications. So for instance I've been missing some office document management utilities I used to use ever since I installed the 64bit version, now I get to use them again.
adakordev
I was planning to create a Java backend web application with a database, and with twinBASIC as frontend, REST/ JSON in between. I once created VBA tools for a company which connected to SAP, executed transactions, created sales orders, pulled different kinds of lists and created Excel files, wrote back info to SAP via transactions(macros) and so on and so forth. The plan was to convert this app to twinBASIC and provide a huge list of new features along the way. Unfortunately, the parent company gave order to stop new hiring and we did not receive green light/ no budget as the current global situation is meh.
sokinkeso
Mostly converting my old utilities/tools, so they have themed forms, and new features of tB like anchors, overloading functions etc..
DinyaZ
I have created a Tb launcher-updater, very handy and useful…and I became Tb-addicted :), used to check the updates and this forum often
Greedo
package manager for VBA. Specifically, the part that interacts with VBE and host COM, most is written in python while tB is young.
Also prototyping VBA hacks using memory manipulation without risk of crashing the host document, saves a lot of time and much easier to debug in tB.
GlevZ
I am working slowly on recreating various RPG ( Role Playing Games) tools in TB. I want these tools redone from the existing languages with a clear possibility of 32bit and 64bit editions in the future from one source code. I may have the occasional non RPG tools I want done in TB.
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 - 268 (the latest build as of publication):
- there are known memory leaks in these versions, so memory usage will be higher than normal
BETA 263
- fixed: HScrollBar and VScrollBar were not firing the Change event for page scrolling
- fixed: (regression) compiler auto-restart on crash was not always working since BETA 259 [ https://github.com//issues/1519 ]
BETA 264
- fixed: making copies of arrays of UDTs was not making appropriate copies of the UDT live elements (Strings/Variants/Objects/Array)
- added: 'Debugger: Immediate Memory Invalidation' project option, to help detect hard to reproduce stale pointer errors
BETA 265
- added: "Show Timestamps" option in the Debug Console (default True, press "..." to access the menu to toggle the option) [ Tecman, discord ]
- improved: ByVal param declarations that spread over multiple lines caused extra debug stepping points [ Tecman, discord ]
- improved: moving statements with ALT+Up/Down would cause File menu to appear after releasing ALT key [ Tecman, discord ]
- fixed: DriveListBox.Drive property-let not working [ https://github.com//issues/1520 ]
- fixed: VersionInfo text project settings fields imported from VBP were wrongly interpretted as UTF8 rather than ANSI [ Tecman, discord ]
- improved: 'Go To Type Definition' context menu now renamed 'Go To Definition' [ Tecman, discord ]
- added: (EXPERIMENTAL) Bookmarks feature in the IDE (available via context menu in code editor)
BETA 266
- improved: code editor Bookmarks are now kept in-sync with code edits
- improved: code editor Bookmarks are now kept in-sync with file renames
- improved: code editor bracket colorization does not now occur within string literals
BETA 267
- added: support for importing RES files when importing a VBP project (resource files are reconstructed and placed in the Resources folder of your imported project)
- fixed: cycling through IDE bookmarks with Next/Prev would not work reliably unless there were bookmarks in two or more seperate documents
- improved: hovering over an IDE tab will now always show the X close icon, even when the modified Dot-indicator is ordinarily shown [ Tecman, discord ]
BETA 268
- improved: find/replace in-page (CtrlF/CtrlH) now allows for line breaks in the selection text [ fafalone, discord ]
- improved: typelibrary viewer now shows [OleAutomation(False)] attribute appropriately [ fafalone, discord ]
- improved: component-scoped Const values with Description attributes now show their descriptions in intellisense/hover situations [ fafalone, discord ]