twinBASIC Update: August 13, 2024

Highlights include predefined caption/text when adding controls, a progress update on form control implementation, and how to set the icon for your tB apps.

twinBASIC Update: August 13, 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

Predefined Caption/Text

Last week, sokinkeso proposed the following improvement in Discord:

In latest betas, when adding controls that have Caption/ Text property, on the form, we immediately have to in place edit this property.
IMO, Text or Caption is better to have a default value (and being selected) instead of being empty, so if we click out of the control the default value will stored.
Pressing Enter, will store the current value.
Pressing Esc will store the default value.

The requested feature is available as of BETA 590.

Discord Chat Summary

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

twinBASIC Development Update: August 5-13, 2024

This week's discussions in the twinBASIC Discord server covered a range of topics, from file handling best practices to database options for desktop applications. The community also explored language features and syntax improvements, while the twinBASIC team provided updates on recent enhancements.

Key points from the conversations:

  • File handling best practices were discussed, with a reminder to use the FreeFile function for obtaining unique file numbers in VB-style file I/O operations.

  • SQLite was recommended as a suitable database option for single-user desktop applications, praised for its stability and wide usage.

  • Transparency support for PNG images in the Image control was confirmed to be working in recent twinBASIC versions (BETA 592 and later), allowing for see-through effects on form backgrounds.

  • A community member proposed the idea of adding LINQ-like functionality to twinBASIC:

    For each item in itemList where itemList.someCriteria = true
        'logic
    next item
    
  • The twinBASIC team acknowledged the potential for LINQ-like features but emphasized the need for careful consideration, particularly regarding COM compatibility and the preference for function-based approaches over new keywords.

  • Syntax for inline conditional statements was clarified, with examples showing how to perform multiple actions in a single line:

    If True Then variable = 123: Debug.Print "cool": Else Debug.Print "too bad"
    
  • The twinBASIC team confirmed that the language is not set in stone and will be extended as needed, with multithreading being a future area requiring new syntax.

In summary, this week's discussions highlighted the ongoing evolution of twinBASIC, balancing backwards compatibility with VBx while considering new features to enhance developer productivity. The community's engagement in proposing and discussing potential language improvements demonstrates the active development and collaborative nature of the twinBASIC project.

Around the Web

VB6 Form Control Implementation Tracker Updated

Over on GitHub, camomille22003 updated his Google Sheets tracker that shows the twinBASIC implementation status of all the various VB6 control objects' properties, methods, and events.  

Implemented items are colored green.  

Items that still need to be implemented are shown in red.

The sheet has more than 400 rows and 30 columns.  Below is a screenshot of the sheet completely zoomed out and rotated 90 degrees to give you a bird's eye view of the overall project progress:

Here are the current cell counts:

  • GREEN: 1,737
  • RED: 199

According to my math, that puts the UI controls portion of the project at about 90% complete.

Setting a Program Icon for your twinBASIC Applications

Over in GitHub, someone asked what is likely a very common question for new twinBASIC users:

Exe icon
Why the generated build exe doesn't have the main form icon like vb?

The answer can be found in the FAQ page of the twinBASIC wiki:

How do I set my own icon for my program?
By default, imported projects use whichever icon (or no icon) was used previously, and newly created projects use the twinBASIC logo. For either, you can of course set a new icon. If you're not already familiar with using resources in twinBASIC, see the FAQ entry right above this one. The icon used for your application in Explorer is the one in the Resources\ICON folder that comes first alphabetically. If you do not have an ICON folder, you can create one by right-click and selecting Add->Add folder.

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 designer functionality:
    • Context menu 'Duplicate' option fixed
    • Inline editor for new controls now starts with default caption (rather than an empty value)
  • Enhanced code execution and debugging:
    • Fixed issues with breakpoints and stepping through code
    • Resolved object reference leaks affecting Class_Terminate events
  • Compatibility and performance improvements:
    • Addressed regression errors in VB compatibility package on Win64 platform
    • Optimized codegen for smaller builds on x64 platforms
  • Refined language behavior:
    • Corrected field visibility in User Controls
    • Fixed Variant array element assignment behavior

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

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

BETA 589

  • fixed: (regression) form designer context menu 'Duplicate (same name, control array)' option not working correctly [ sokinkeso, discord ]
  • fixed: Sub New (constructor) procedures are no longer listed in intellisense lists [ Merp, discord ]
  • fixed: Fields defined in a UC should overshadow members of the base class [ vbuser, discord ]

BETA 590

  • fixed: (regression in recent builds) error TB5001 in VB compatibility package on Win64 platform [ Gary Miller, discord ]
  • improved: form designer inline editor for new controls now starts with the default caption rather than an empty value [ sokinkeso, discord ]

BETA 591

  • improved: some minor tweaks for smaller codegen on x64 builds
  • fixed: when switching documents in the IDE, a stale debugger breakpoint could be activated incorrectly
  • fixed: Let-assigning an object to a Variant array element caused a Set-assignment in some instances [ https://github.com//issues/1596 ]

BETA 592

  • fixed: breaking/stepping through code could cause object reference leaks, causing Class_Terminate events not to fire in some instances
  • fixed: removed all internal usage of GWL_USERDATA for storing internal data associated with HWNDs [ fafalone, discord ]

All original code samples by Mike Wolfe are licensed under CC BY 4.0