twinBASIC Update: July 8, 2024

Highlights include a sneak preview of a coming report writer, plus support for accessing the Printers collection by printer name.

twinBASIC Update: July 8, 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, 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

Reports Coming Soon?!

Look out Microsoft Access.  

As twinBASIC nears its v1 launch date and 100% compatibility with VB6, Wayne has offered some glimpses into where twinBASIC may be headed next.  And the future of twinBASIC is starting to look familiar to Microsoft Access developers.

Here's Wayne in Discord:

I'm starting to finalize some ideas around a reporting engine.   It will require some new designer features, in particular 'sections' much like we see in MS Access ('Page header', 'Page Footer' etc).  Here is a WIP of what the changes might look like:
Here I've created some sections to seperate out the form menu, plus added the offscreen section for non-visual controls that has been discussed.
Oh and a ruler, as you can see.

This foundation of a Microsoft Access-style report writer already includes support fo page header, page footer, and detail sections:

It appears there's already a print preview view to go along with the design view:

Wayne posted a 60-second video of the as-yet-unreleased feature in Discord.

In response, a reader asked the following question in Discord:

Fancy fancy! I take it they will act as a form in design time and then have the ability to show / print? Would you load information in the reports code?

To which Wayne responded:

Yep, uses a simple recordset interface so you can easily bind the report to an ADO recordset / DAO recordset / array data or whatever by writing a simple class that implements the required interface.  I'll provide an example for binding to each.

And yes, similar to forms, the Show method launches the preview as shown in the video, with PrintReport methods being the way to send to the printer.


Discord Chat Summary

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

This week saw exciting progress in twinBASIC's development, with significant updates to the IDE's form designer and the introduction of a new reporting engine. The community continued to engage in discussions about language features and comparisons to other programming languages.

Key points from this week's discussions:

  • Wayne Phillips shared a work-in-progress preview of changes to the twinBASIC IDE's form designer. The new design includes sections for separating form elements, an off-screen section for non-visual controls, and a ruler for precise positioning.

  • A new reporting engine is in development, which will include features similar to MS Access reports. This addition will significantly enhance twinBASIC's capabilities for creating professional-looking reports.

  • The roadmap has been updated, with items marked as 'Completed', 'Partially Completed', or 'In Progress', providing clearer insight into the project's current status.

  • Discussions about language features continued, including the use of generics for type inference and the potential for more concise syntax options.

  • The community debated the merits of maintaining simplicity in twinBASIC's syntax versus adding more advanced features, with some members cautioning against following the path of languages like C# that have become increasingly complex over time.

  • Wayne Phillips demonstrated a preview of the new reporting engine, showcasing features like design-time editing and runtime preview functionality.

  • The [PredeclaredId] attribute was highlighted as a way to achieve singleton-like behavior in twinBASIC classes.

In conclusion, this week's developments demonstrate twinBASIC's continued evolution, with a focus on enhancing the IDE's capabilities and adding powerful features like the reporting engine. The ongoing discussions about language design reflect the community's commitment to balancing simplicity with functionality, ensuring twinBASIC remains accessible while meeting the needs of modern developers.

Around the Web

Nothing new to report.

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:

  • Enhanced Printing Functionality:

    • Improved PaintPicture implementation with fallback options
    • Added support for accessing the Printers collection by name
    • Fixed issues with PrintForm and Printer.OutputFile settings
  • UI Improvements:

    • More compact IDE tabs for better workspace management
  • Bug Fixes:

    • Resolved issues with DirListBox, Checkbox events, and parsing of generics with Unicode characters

These updates demonstrate twinBASIC's commitment to maintaining VB6/VBA compatibility while enhancing functionality and user experience.


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

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

BETA 571

  • fixed: PaintPicture implementation will now fallback to using StretchDIBits instead of StretchBlt if the target device does not support it (RC_STRETCHBLT) [ Krool, discord ]
  • improved: tB now supports accessing the Printers collection by name, e.g. Set Printer = Printers("Microsoft Print To PDF")
  • fixed: setting Printer.OutputFile is now only allowed on the root Printer object, not on read-only printers from the Printers collection

BETA 572

  • fixed: missing borders issue in PrintForm for controls that use WS_EX_CLIENTEDGE/WS_BORDER for their borders [ sokinkeso, discord ]
  • fixed: (regression) DirListBox would show empty when a form was re-opened [ sokinkeso, discord ]
  • fixed: a parsing issue where generics specifiers with unicode characters might be wrongly disallowed [ fan2006, vbforums ]

BETA 573

  • fixed: (regression since BETA 424) codegen bug in handling of IErrorInfo propagation
  • improved: IDE tabs are now more compact
  • fixed: Checkbox.Click event wrongly fires during form loading if Value property is set to True in the designer [ fafalone, discord ]

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