twinBASIC Update: February 10, 2025
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 Monday week, 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, please leave a comment below.
Here are some links to get involved with the project:
- Custom twinBASIC IDE Installation Guide
- twinBASIC Discord Server (chat about the project)
- twinBASIC Wiki (list of new features not in VBx)
- GitHub Issue Tracker (report bugs)
- twinBASIC/VBx LinkedIn Group
Highlights
New Webview2 Markdown-it Library Example
BETA 678 introduced a new WebView2 sample project that demonstrates how to implement the Markdown-it project.
To run the new sample:
- Download tB v678 or later
- Launch twinBASIC
- Click the Samples tab
- Click on Sample 1a. WebView2 Examples
- Click [Open]
- Go to the Run menu and click Start [F5]
- Click on [Example 4: Using Markdown-it Library]
- Click [DevTools] to open the Edge DevTools window
Screenshots
Additional Notes
To customize the form that shows the Markdown on the left and preview on the right, check out the Example4.tbform object in the Sources folder of the sample project.
The demo works by copying the contents of the embedded \Resources\MARKDOWNIT_DEMO\
folder from twinBASIC to the user's My Documents folder:
The code then creates a "virtual host name" that points to the subfolder of My Documents and navigates the WebView2 control to that "web page":
This technique opens up a world of possibilities beyond simply the Markdown-it library. For example, you could embed source code for the Chart.js project to provide modern charting capabilities for your twinBASIC projects.
And, of course, these things could also be packaged into ActiveX controls for inclusion in Access and Excel projects (with easy support for both 32-bit and 64-bit versions of Office).
Discord Chat Summary
* Auto-generated via Claude-3.5-Sonnet-200k on poe.com
Here's the summary of the twinBASIC Discord general channel discussions from February 4-10, 2025:
Overview
This week saw significant improvements to the IDE debugger functionality and form clipping region handling. Notable discussions centered around API declarations for 64-bit compatibility, form property behaviors, and the Windows Ribbon Framework implementation. Community engagement was high with substantial technical deep-dives and collaborative problem-solving.
Debugger Enhancements
- Wayne Phillips implemented improvements to the IDE's break/pause functionality in BETA 673, allowing breaking into code execution more reliably (waynephillipsea)
- The debugger now properly handles variable inspection when breaking into the message loop, matching VB6 behavior more closely
- Community testing helped identify and resolve issues with the Watches window and variable accessibility during debugging
Form Rendering & Clipping
- A significant visual glitching issue with the Windows Ribbon Framework was resolved through collaboration between Wayne Phillips and jpbrown
- Two solutions were identified: setting HasDC=False or implementing proper clipping region management
- The team determined optimal clipping region sizes and handling for different form configurations
API Declaration Improvements
- Extensive discussion about proper 64-bit API declarations, particularly around ByRef/ByVal parameter handling
- Community members collaborated on best practices for handling pointer types across 32-bit and 64-bit platforms
- Wayne Phillips provided clarification on tB's implementation of VB6/VBA7 compatibility rules for API declarations
IDE Enhancements
- Version number display is being restored to the New Project dialog in upcoming release (waynephillipsea)
- Community member dinyaz contributed an improved tB loader program with better version handling
- Profanity was cleaned from internal package comments to improve corporate compatibility
Conclusion
This week demonstrated strong progress in core IDE functionality and compatibility features. The debugger improvements particularly show twinBASIC's commitment to matching and enhancing VB6 development workflows. Community collaboration continues to drive refinements in both the language implementation and supporting tools, with careful attention to maintaining compatibility while introducing modern improvements.
Around the Web
tbLoader Update
Community user DTZ posted the following to the Discord show-and-tell channel this week:
New tbLoader program version that either launches the application or, if it finds a newer version, updates to it with a single button press and then starts it. The old version and the ZIP file are deleted. It is developed in tB language.
The main difference compared to the previous version is a bug fix: when searching for a new version on GitHub, it no longer gets stuck if a version does not exist, such as version 674, which Wayne retracted.
The file must be placed on the Windows desktop, and from there, it can be used to launch tB.
Head to Discord to download the executable and/or source code.
Cristian Buse's VBA-FastDictionary Project
Over in the Discord show-and-tell channel, GCUser99 highlighted recent changes to Cristian Buse's pure-VBA FastDictionary implementation in GitHub:
Cristian Buse has put some effort into making his FastDictionary compatible with twinBASIC, in case it is of use to anyone
The project is available here: https://github.com/cristianbuse/VBA-FastDictionary
Here's the AI summary of the changes. Note that I harassed the AI repeatedly to reduce its hallucinations, but you should still take its summary with a grain of salt. The subject matter is far enough over my head that I can't fully assess the accuracy of the statements below. However, I think they provide enough context to be useful to us mere mortals:
AI-Generated Summary
Cristian Buse's VBA-FastDictionary project has uncovered intriguing issues in how VBA handles certain method calls.
Two distinct bugs were identified: one causing IDE crashes when accessing non-existent dictionary keys through array notation in debug mode, and another involving chained method calls on dictionary objects stored in Variant variables. Buse's investigation, documented in the GitHub issues, points to VBA's stack handling in 64-bit environments as a key factor. He demonstrated this by creating minimal test cases showing how default member calls behave differently when made through Variant variables versus direct object references. While the same code executes without error in twinBASIC, Buse's solution focused on adding dynamic stack size tracking and explicit error handling to ensure reliable operation across both environments.
This case demonstrates how subtle differences between VBA and twinBASIC's implementations can affect real-world code, while highlighting the complexity of maintaining cross-platform compatibility.
Changelog
Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.
AI-Generated Changelog Summary
* Auto-generated via Claude-3.5-Sonnet, sorted in order of its opinion of "most impactful changes."
Here's a concise summary of the notable twinBASIC updates:
-
Enhanced Debugging Experience
- Improved BREAK functionality across all application windows
- Added native debugger process to prevent hung windows
- Better message loop breakpoint context matching VB6 behavior
-
IDE Improvements
- Restored BETA version display in New Project dialog
- Fixed form designer properties (MinWidth/MaxWidth/MinHeight/MaxHeight)
- Resolved ComboBox and PictureBox-related issues
-
Internationalization & Documentation
- Updated Chinese Traditional and Simplified language packs
- Added new WebView2 markdown example
- Improved Unicode support in WebView2 JSON decoder
The releases focus on debugging enhancements, IDE stability, and better internationalization support, while maintaining VB6/VBA compatibility.
WARNING: The following issues are present in BETA builds 623 - 679 (the latest build as of publication):
- IMPORTANT: This is an interim/experimental release. It includes significant changes, so some instability is to be expected. [Editor's Note: Rolling back to BETA 622 may be necessary until the BETA 623+ version stabilizes or if any of the KNOWN ISSUES below affect your project.]
- KNOWN ISSUE: UserControls from the ACTIVE project will not appear correctly in the form designer in this release (they are purposely disabled until next release). Packaged controls, such as VBCCR will work.
- KNOWN ISSUE: Menus currently not appearing in MDI Forms (broken in this build)
- KNOWN ISSUE: 'Scale*' properties are often not settable in the IDE property sheet (broken in this build)
- KNOWN ISSUE: Setting Width/Height via the property sheet often does not work correctly (broken in this build)
- KNOWN ISSUE: Controls are not being destroyed properly by the form designer, causing big memory leaks (broken in this build)
- there are known memory leaks in these versions, so memory usage will be higher than at the Version 1.0 release
BETA 673
- improved: attempting to pause/break when there is no actively executing user code will now break at function VB.IdleMessageLoopBreakpoint [ Jim Drew, discord ]
- improved: BREAK key should now work when any window of the application is active, not just when inside the IDE [ Jim Drew, discord ]
- updated: 2 language packs (Chinese Traditional, Chinese Simplified)
- special thanks to our community members for the new/updated language packs (woeoio2)
BETA 674
[version recalled due to serious bug]
BETA 675
- improved: cleaned up some uses of profanities in comments inside the built-in packages [ jpbro, discord ]
- improved: we're now using an extra native debugger process to avoid hung application windows that prevent catching BREAK keyboard events [ with special thanks to HackerVlad!, vbforums ]
- [ with extra special thanks to HackerVlad!!, vbforums ]
BETA 676
- improved: the context at IdeMessageLoopBreakpoint has been improved to match VB6 [ Jim Drew, discord ]
BETA 677
- improved: the IDE BETA version number is now displayed on the New Project dialog again [ DTZ, discord ]
- fixed: (regression) MinWidth/MaxWidth/MinHeight/MaxHeight form designer properties have not been working in recent releases [ fafalone, discord ]
- fixed: (regression) editing a ComboBox List in the form designer would cause a crash
- fixed: ComboBox dropdown list height would be 1px when IntegralHeight is False, or VisualStyles is False [ XYplorer, private ]
- fixed: PictureBox GotFocus/LostFocus events not firing [ XYplorer, private ]
BETA 678
- improved: added unicode (\uXXXX) character decoding to the simple JSON decoder in WebView2 package
- added: Example 4 (MarkdownIt example) to WebView2 sample project [ VIP Gold comissioned work ]
BETA 679
- fixed: compiler memory allocation bug that can lead to bad codegen in large projects, causing AVs/internal mem corruption [ XYplorer, private ]