twinBASIC Update: October 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 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:


Highlights

GotFocus and LostFocus Events Better Match VB6

Added as of BETA 619:

rewrote the handling around GotFocus and LostFocus events for all controls to better match VBx behaviours

Default Hotkey Added for "Add Watch": [Shift] + [F9]

Also added in BETA 619:

IDE keyboard shortcut added for SHIFT+F9 to trigger command tbWatches_Add, as per VB6

Discord Chat Summary

* Auto-generated via Claude-3.5-Sonnet-200k on poe.com

Here's a summary of the key points from the twinBASIC Discord chat transcript for the General channel:

The past week saw continued development and discussion around twinBASIC (tB), a modern programming language designed to be compatible with Visual Basic 6 and VBA while offering enhanced features. Here are the main highlights:

• A bug causing the IDE to crash when saving or loading projects was identified and fixed in the latest beta release (621). The issue was related to elevated permissions on Windows.

• Delegates, a new feature in twinBASIC, were discussed extensively. They are seen as a significant improvement, especially once they support generics. There was debate about how to best implement asynchronous programming in tB, with comparisons made to .NET's async/await pattern.

• It was clarified that twinBASIC now supports varargs (variable argument lists) in API declarations using ParamArray Args As Any(). This feature had been implemented earlier but was not widely known or documented.

• Developers discussed the challenges of wrapping Windows API functions with variable arguments, with some solutions proposed using the new varargs support.

• There was discussion about how twinBASIC handles interfaces and class conversions, with some unexpected compiler warnings being addressed.

• A community member showcased a working 64-bit shell extension context menu handler created in twinBASIC, demonstrating capabilities beyond what was possible in VB6.

• The community expressed interest in seeing more shell extension examples, with a poll created to determine which types to prioritize for future demonstrations.

• There were inquiries about the twinBASIC project file format (.twinproj) and potential for creating a file explorer extension to browse these projects directly.

Overall, the week's discussions highlight twinBASIC's ongoing evolution, with new features being explored and refined, and the community actively engaging in testing and providing feedback. The ability to create 64-bit shell extensions stands out as a significant advancement over VB6 capabilities.

Around the Web

twinpack for VB SQLite Library (COM Wrapper)

As announced by Krool in the show-and-tell Discord channel:

My VB SQLite Library (COM-Wrapper) is now available as twinpack. (Experimental, 32-bit and 64-bit)

https://www.vbforums.com/showthread.php?882857-VB-SQLite-Library-(COM-Wrapper)

To note is that the IDE will show some errors and x64 will most likely crash in the IDE. However, compiled to an executable all the tests ran fine. Hopefully Wayne will tackle the details here for a smooth IDE run.
VB SQLite Library (COM-Wrapper)-VBForums
This Ax-DLL project is intended to get a VB-friendly COM-Wrapper for the SQLite library, which is based on the sqlite3win32 __stdcall compilation. Ax-DLL version: 1.2.22 SQLite version: 3.45.3 A Std-EXE demo project is also included to show how to use the Ax-DLL. The interaction of the various components are very simplistic: 185387

twinBASIC Documentation Updates

From fafalone:

The New Features Wiki entry now has a section for the newDelegate call by pointer syntax https://github.com/twinbasic/documentation/wiki/twinBASIC-Features#delegate-types-for-call-by-pointer

From Ben Clothier:

Added an entry for variadic arguments: https://github.com/twinbasic/documentation/wiki/twinBASIC-Features#variadic-arguments-support
FWIW, added one more for cdecl callback example, this time sporting the spiffy new delegate feature which I can confirm works for cdecl, too! 😄https://github.com/twinbasic/documentation/wiki/twinBASIC-Features#cdecl-support

WinDevLib Updates

fafalone released a major bug fix for his excellent Windows Development Library project. The full list of fixed API declarations is available in Discord.

Here's the summary:

**Update (v8.5.450, 03 Oct 2024):**
***NOTE:*** These bug fixes were identified through scanning for the actual entry points in DLLs.
            About 75% of these bugs are errors in MSDN documentation or the SDK itself.

fafalone Takes Requests

Over on the #polls channel of the twinBASIC Discord server, fafalone posted a poll question that closes at the end of this week:

What kind of shell extension would you like to see a twinBASIC example for next? There's a few other types, post in the channel if you want to see one of the others!

There are 10 (!) options to choose from, though "All of the above" is not one of them. Be sure to stop by and cast your vote before the poll closes.

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.

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 updates in twinBASIC:

  • Improved form and control behavior:

    • Fixed flickering taskbar issue for the first form opened in compiled EXEs
    • Rewrote GotFocus and LostFocus event handling for all controls to better match VB6/VBA behavior
  • Enhanced IDE functionality:

    • Added SHIFT+F9 keyboard shortcut to trigger the tbWatches_Add command, matching VB6
    • Fixed issues with the WATCHES panel and docked panel movement
  • Compiler and language improvements:

    • Refined compiler diagnostics for delegates
    • Fixed edge cases with the Set statement
  • Bug fixes:

    • Resolved a potential hang in the form designer when loading forms

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

  • there are known memory leaks in these versions, so memory usage will be higher than normal

BETA 618

BETA 619

  • improved: rewrote the handling around GotFocus and LostFocus events for all controls to better match VBx behaviours
  • fixed: IDE command tbWatches_Add would fail if the WATCHES panel was not already visible [ wqweto, discord ]
  • improved: IDE keyboard shortcut added for SHIFT+F9 to trigger command tbWatches_Add, as per VB6 [ wqweto, discord ]

BETA 620

  • improved: refined the compiler diagnostics around delegates [ wqweto, discord ]
  • fixed: IDE error reported when moving docked panels around in some instances [ wqweto, discord ]

BETA 621

  • fixed: (regression) form designer could hang during loading a form [ DTZ, discord ]