twinBASIC Update: April 7, 2024

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

Embed Code in Keyboard Shortcuts

This is a very intriguing feature.

Beginning with BETA 495, you can now embed expressions in IDE commands, which can in turn be mapped to custom keyboard shortcuts.

Here's the announcement from Wayne:

BETA 495 allows IDE commands to accept arguments. The first command available accpeting arguments is tbDebugConsole_ExecuteCode. What this means is, that we can now setup custom key bindings to run code using the IDE keyboard shortcuts JSON editor, e.g.:

 {"tbDebugConsole_ExecuteCode('?\"The time is \" & Time')": ["{KEYDOWN}F4"]}

For now, literal strings that are passed to the command are enclosed with single-quotes, and any BASIC strings will need escaping for their double-quotes (") and single-quotes (\'). I appreciate that the format is a little cumbersome in its raw JSON form, but once we get a proper keyboard shortcut editor, it will be much better

App Object Available as a Separate Package

On GitHub, fafalone requested a feature that would provide access to certain project-level information (such as the instance handle) without bringing in the entire VB Forms package:

When making a Standard DLL it's often desirable to leave out the large GUI package when that's not going to be used. But sometimes resources in the DLL need to be accessed.

DllMain provides an hInstance for the DLL; I'd like for there to be some way of getting this without the App object-- assuming App.hInstance even correctly reported a DLL hInstance, which I haven't tested.

In response to the feature request, Wayne added an App object class as a twinBASIC package separate from the VB forms package.

Discord Chat Summary

* Auto-generated via Claude-2-100k on poe.com

  • Added: Separate App object class for non-GUI/console applications, included by default in the latest beta version.
  • Improved: The IDE now supports commands with arguments, allowing for custom key bindings through the IDE keyboard shortcuts JSON editor.
  • Fixed: Issues with form and ActiveX control compatibility when converting projects from VB6 to twinBASIC, along with a temporary fix that allows editing source code when forms are running (without requiring a breakpoint).
  • In Development: Edit and continue feature to allow live code editing without pausing the application is being worked on.
  • Clarified: Conversion of VB6 projects to twinBASIC is one-way; forms and controls are saved in a new format that is not backward compatible with VB6.
  • Confirmed: The twinBASIC form designer supports undo functionality, addressing a limitation in the VB6 designer.

Around the Web

tB IDE Addins from sokinkeso

As announced by sokinkeso in Discord:

Dear friends, today I found the time to update all my latest addins, and update my github page.

All addins have [been] tested with the latest twinBasic releases.

For those of you who are interested in trying my addins, here is my github page:
https://github.com/sokinkeso

The GitHub page currently includes links to five different tB IDE Addins that sokinkeso has written:

  1. AutoSave Addin for twinBasic
  2. Usercontrol Builder Addin for twinBasic
  3. MsgBox Builder Addin for twinBasic
  4. String Converter Addin for twinBasic
  5. Comments Addin for twinBasic
sokinkeso - Overview
I’m a Basic language fan. vb6 was my favorite language for many years, until TwinBasic came out ! - sokinkeso

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.

ChatGPT Changelog Summary

* Auto-generated via ChatGPT, sorted in order of ChatGPT's opinion of "most impactful changes."

  • Improved: Functionality for CommandButton.Value and display of Date values in the form designer property sheet.
  • Added: New 'twinBASIC - App' object global class for easier access to the App object and additional IDE Window submenu Panel Features options for managing panel arrangements.
  • Fixed: Several issues including double-clicking errors in the IDE window, parsing of exponential values in FRM files, PictureBox/Frame rendering, ActiveX control focus behavior, and UserControl UIDeactivate behavior.
  • Enhanced: IDE experience with fixes for tracking key states, syncing issues with WebView2 sample buttons, and updates to the VARIABLES and WATCH panels.
  • Added: The ability to execute code directly from the IDE command line with 'tbDebugConsole_ExecuteCode'.
  • Updated: IDE commands can now accept arguments, allowing for more dynamic command execution.

WARNING: The following issues are present in BETA builds 424 - 495 (the latest build as of publication):

BETA 489

  • improved: implemented CommandButton.Value [ https://github.com//issues/1801 ]
  • fixed: double clicking on IDE window title was throwing an error [ https://github.com//issues/1799 ]
  • improved: form designer property sheet now shows Date values correctly [ https://github.com//issues/1796 ]
  • fixed: parsing of exponential values in FRM files [ https://github.com//issues/1795 ]
  • added: package twinBASIC - App object global class for accessing App object without adding whole VB forms package [ https://github.com//issues/1815 ]

BETA 490

  • fixed: PictureBox/Frame container rendering issue for some standard controls [ https://github.com//issues/1821 ]
  • fixed: ActiveX control focus edge case where two tB ActiveX controls could both continuously fight for the focus causing runtime freeze [ commissioned work ]

BETA 491

  • fixed: UserControl UIDeactivate implementation could cause VBA UserForm controls to fail after UC gaining focus [ commissioned work]
  • added: IDE Window submenu Panel Features options for allowing to lock arrangements, plus associated IDE commands: tbPanels_TogglePreventDockedResize, tbPanels_TogglePreventDockedMove, tbPanels_TogglePreventDockedTearout, tbPanels_TogglePreventFloatingResize, tbPanels_TogglePreventFloatingMove

BETA 492

  • fixed: IOleControl.FreezeEvents now mutes general UserControl RaiseEvent statements to match VBx [ commissioned work ]

BETA 493

  • fixed: (regression) As-New semantics not working with arrays alongside the CoClassCustomConstructor attribute [ axisdj, discord ]
  • fixed: As-New semantics not working with arrays of COM CoClasses (x64-only)

BETA 494

  • fixed: underscore prefix in Interface member names could cause a compiler crash loop [ https://github.com//issues/1820 ]
  • fixed: IDE would sometimes lose track of CTRL/SHIFT/ALT key states [ fafalone, discord ]
  • fixed: WebView2 sample back/forward buttons sync issue [ fafalone, discord ]
  • fixed: (regression since BETA 458) issues with controls that overlap UserControls [ sokinkeso, discord ]

BETA 495

  • fixed: changing a variable value via the VARIABLES panel double-click feature does not trigger watches in the WATCH panel to be re-evaluated
  • fixed: Enter key in monaco editor would not always close intellisense
  • improved: editing source code when forms were running but IDE was not at a breakpoint, would not trigger the form(s) to close
  • added: IDE command tbDebugConsole_ExecuteCode, requiring 1 string literal argument (enclosed in single quotes)
  • improved: some IDE commands can now take arguments, passed via parenthesis in keyboard shortcut definitions, e.g. {"tbDebugConsole_ExecuteCode('?"The time is " & Time')": ["{KEYDOWN}F4"]}