twinBASIC Update: October 23, 2022
Highlights include many IDE improvements, better support for high-performance code, and a sample Task Dialog project from fafalone.
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
This week saw several improvements to the IDE and the twinBASIC development experience:
- Optional Paren-Matching Highlighting
- Better Multi-Monitor Support
- Experimental "Sticky Scrolling"
From Wayne in GitHub:
Highlighting of bracket pairs is now an option available via the IDE settings (IDE > Tools menu > IDE Options) in BETA 155.
Better Multi-Monitor Support
From Wayne in Discord:
For the multi-monitor lovers, BETA 150 now supports some breakout toolwindows. The virtual treeviews in the IDE are designed for this feature, so currently we only support creating toolwindows for the PROBLEMS and OUTLINE panels only. Once the other panels are moved over to use the new virtual treeviews, you'll be able to put them inside ToolWindows as well.
To create a toolwindow, go to the
This one is really cool. And, honestly, I'm a little afraid to start using it because I will miss it so much when I go back to the old VBA editor.
The experimental "Sticky Scroll" IDE option pins the structure of the code at the top of the screen, so that each level of nested logic is always visible. It's harder to describe it in words than it is to just show the feature in action:
New GUI Properties, Methods, and Events Implemented
Listed below are all the newly implemented form and control properties, methods, and events:
Form.Opacity(0-100 percent; default 100)
Form.TransparencyKey(color; -1 for not set)
The full list of GUI items yet to be implemented is available here.
VBx Input File Functions Implemented
One of the final non-GUI pieces needed for VBx compatibility got implemented this week. As of BETA 151, twinBASIC supports:
Better Support for High Performance Code
One of the great promises of twinBASIC is that it will remove some of the artificial limitations that VBx imposed in the name of protecting inexperienced developers.
Whereas VBx welded the drawers shut to keep developers from getting to the sharp knives, twinBASIC has opted instead for child safety locks. Default settings keep new users from getting into trouble, but advanced features can be unlocked via a variety of project-level through procedure-level settings and attributes. After all, determined VBx developers still managed to get to the sharp knives–they just had to break out blow torches to get to them.
In the spirit of child safety locks, BETA 152 introduced
[IntegerOverflowChecks(False)] support. To better understand the reasoning behind this new attribute, here's wqweto lobbying for it in Discord:
Is there some way to implement non-overflowing arithmetic operators in TB:
This would be very helpful for translating C/C++ code where overflow is always ignored esp. often used in crypto routines and similar.
Around the Web
Over on vb6forums.com, fafalone posted a project that uses conditional compilation to run in both 32- and 64-bit versions of VB6/VBA6/VBA7/twinBASIC.
This is a version of my cTaskDialog 1.2R2 project that uses conditional compilation to support both VB6/VBA6 and twinBASIC/VBA7 in either x86 or x64. See that page for complete project description and numerous more pictures and examples.
Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.
- added: IDE feature, Window menu > Create ToolWindow > PROBLEMS panel
- added: IDE feature, Window menu > Create ToolWindow > OUTLINE panel
- fixed: subtle timing bug in handling of ByRef ANSI to UNICODE conversions in ANSI declare calls [ feldharke, discord ]
- fixed: (regression) Custom controls (e.g. Sample 6 / 8) would fail to open in the form designer in last two BETAs [ sokinkeso, discord ]
- fixed: (regression) performance of editing some large projects had degraded [ https://github.com//issues/1271 ]
- added: Form.TopMost boolean property (default False) corresponding to WS_EX_TOPMOST window style
- fixed: return types not showing for signature-help/hover on some APIs [ https://github.com//issues/1273 ]
- fixed: spaces at beginning of Label.Caption were being ignored [ https://github.com//issues/1269 ]
- fixed: non-sizable Form.BorderStyle no longer show Min/Max buttons [ https://github.com//issues/1268 ]
- fixed: FileListBox.Pattern not working with multiple patterns [ https://github.com//issues/1266 ]
- added: support Input/InputB/Input$/InputB$ file functions [ https://github.com//issues/621 ]
- improved: WebView2 package now offers DevToolsProtocolResponse response event for CallDevToolsProtocolMethod [ msFaktura, private ]
- fixed: disallow duplicate named public enums within a project scope, to match VBx rules [ fafalone, discord ]
[IntegerOverflowChecks(False)]attribute support, available at procedure and component scopes, currently affecting simple integral types (Byte, Integer, Long, LongLong)
- improved: type library viewer now includes a warning when outputting a DLL procedure definition where the syntax is not an exact match to the real TLB definition (e.g. HRESULT return values)
- fixed: Width file I/O function was not accessible when prefixed with VBA / _HiddenModule [ fafalone, discord ]
- fixed: subtle UDT alignment issue around LongLong members in 32-bit [ fafalone, discord]
- added: Form.AlwaysShowKeyboardCues boolean property, default False
- improved: handling of WM_UPDATEUISTATE for OS handling of keyboard cues
- fixed: TLB defined events are allowed to return void, not just HRESULT (e.g. as seen with WinHttpRequest) [ wqweto, discord ]
- fixed: auto-generated skeleton implementations of event/interface members had wrong syntax for array parameters [ wqweto, discord ]
- added: Form.Opacity property (0-100 percent, default 100)
- added: Form.TransparencyKey property (color, -1 for not set)
- fixed: IDE hover tooltips should now show full array information when applicable [ https://github.com//issues/1280 ]
- fixed: IDE signature help would sometimes show Long or LongLong rather than LongPtr for return types [ https://github.com//issues/1273#issuecomment-1281886458 ]
- fixed: line splitter '_' character immediately following a callsite procedure symbol was not being parsed correctly [ https://github.com//issues/1276 ]
- added: Form.MinWidth/MinHeight/MaxWidth/MaxHeight properties (not currently validated at design time)
- improved: IDE now has a minimum size of 800x600 to help prevent cut off of some important UI features
- added: ComboBox.CloseUp/DriveListBox.CloseUp events [ https://github.com//issues/1281 ]
- fixed: ANSI<->Unicode conversions of UDTs were sometimes leaking a symbol table entry during codegen, causing compilation problems after first full codegen [ fafalone, discord ]
- improved: IDE Export folder dialog now uses the BIF_USENEWUI flag, giving a 'make new folder' option and textbox entry [ fafalone/krool, discord ]
- fixed: traditional event/implements syntax now detects non-matching procedure signatures [ fafalone, discord ]
- added: IDE option 'IDE: show intellisense manually (CTRL+SPACE)' [ wqweto, discord ]
- improved: a couple of tweaks to code entry for conditional code blocks [ wqweto, discord ]
- fixed: Form.MaxHeight was not effective if Form.MinHeight had not also been set [ https://github.com//issues/1284 ]
- improved: resolving of Do Loop conditional expressions when the Do loop is not closed/finished (e.g. when writing an opening
Do While <expr>) [ https://github.com//issues/1264 ]
- improved: upgraded Monaco editor to v0.35.1
- added: experimental IDE option 'Sticky scrolling in code editor' (must be switched on manually in IDE settings)
- added: experimental IDE option 'Bracket pair colorization in code editor' (must be switched on manually in IDE settings) [ https://github.com//issues/1259 ]