twinBASIC Update: July 3, 2024

Highlights include initial Printer object support, a new PDF Merge utility from fafalone, and an answer to one redditor's burning question.

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

Initial Printing Support Arrives!!!

One of the long-awaited v1 features finally landed: Printer object support.

Beta 570 provides the following new printer-related features:

  • Initial support for Printers collection and Printer object
  • Printer.OutputFile method (to provide virtual PDF print drivers with a filename hint which many PDF drivers will use as a default filename)
  • Form.PrintForm with optional arguments:
    ImplicitEndDoc (default True)
    OutputAtCurrentPosition (default False)

Discord Chat Summary

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

Weekly Update on twinBASIC Development

This week's discussions in the general channel of the twinBASIC Discord server covered a range of topics including bug reports, feature requests, and comparisons with other programming languages. Here are the key highlights:

  • Textbox Property Issue: A user reported that changing the text property of a textbox in Beta 569 doesn't update when using ENTER, TAB, or mouse clicks. This issue was confirmed on multiple Windows versions, but not reproducible by all users.

  • Font Size Rounding: Another user encountered a problem where setting font sizes to decimal values in the properties table resulted in rounding. This limitation was noted as a potential area for future improvement.

  • Media Player Compatibility: There was a discussion about using a VB6-based media player under twinBASIC. Users reported runtime errors and instability, similar to issues faced in VB6.

  • Array Handling in Classes: A user struggled with writing to a TypeArray in a class. It was clarified that twinBASIC creates an automatic property-get wrapper, which returns a copy of the array, not the real array. Solutions included using property-let with an index argument.

  • LLVM Compilation: It was confirmed that LLVM compilation is half-implemented and will be completed by the v1 release, expected in October.

  • CSS Customization: Users discussed customizing the twinBASIC IDE's appearance using CSS. This included changing comment background colors and other UI elements, with guidance provided by Wayne Phillips.

  • Printer Support: Upcoming support for printers was announced, with a release expected next week. Discussions also covered handling printer-related commands and ensuring compatibility with VB6 behaviors.

  • Comparison with VB.NET: There was a conversation about the advantages of twinBASIC over VB.NET, particularly for low-level programming tasks like game hacking, where unmanaged code is beneficial.

  • GitHub Account Issues: A user's GitHub posts were mysteriously hidden, leading to confusion. It was suggested that this might be related to account deletion or privacy settings.

In summary, this week saw significant progress in addressing user-reported issues, enhancing IDE customization, and preparing for new feature releases. The community remains active in providing feedback and discussing the future direction of twinBASIC, particularly in comparison to other languages like VB.NET. The upcoming printer support and ongoing LLVM implementation are eagerly anticipated milestones.

Around the Web

gPdfMerge - A New Utility from fafalone

Here's fafalone's announcement (via Discord):

gPdfMerge is a simple utility written in twinBASIC mainly for me to try out using pdfium.dll, Google's open source PDF utility. It will merge the selected PDFs together, either into a new file, or into the first file on the list. You can optionally specify which pages in each document should be merged, and if you're appending the first in list, where to insert them at. That's all there is to it right now; just a brief experiment before I make a 64bit version of a more complex PDF control.

The project is available on GitHub:

GitHub - fafalone/gPdfMerge: GUI-based PDF Merger
GUI-based PDF Merger . Contribute to fafalone/gPdfMerge development by creating an account on GitHub.

Dear Redditor: "twinBASIC is what you are looking for"

Over at the internet's water cooler (a.k.a., Reddit), user PunjacLenovo asks the following question in the visualbasic subreddit (emphasis mine):

I remember doing VB6 back in my elementary school (more than 20 years ago) and I was making cool apps with friends. Some of them are even still published at download com. I am now totally in different area of development for more than 15 years, but I'd like from time to time to make some cool VB6 apps again. I remember it was quite easy just to save project as .exe file and that's it, that's why I liked VB6 so much.

Is this still a thing now when we are at W10/W11 era? Do you recommend some other VB version and how to export apps as .exe simply as in VB6? Are there some alternatives?

The current top answer comes from MadDog845:

Comment
byu/PunjacLenovo from discussion
invisualbasic

Of course, our good friend fafalone also posted a more fully-fleshed out answer:

Comment
byu/PunjacLenovo from discussion
invisualbasic

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."

Here's a concise summary of the notable updates in twinBASIC:

  • Added initial support for Printers collection and Printer object: This brings in capabilities for handling multiple printers and printer settings, aligning with modern printing needs.
  • Introduced Printer.OutputFile: Allows specifying output files, such as for printing to PDF, enhancing flexibility in print management.
  • Enhanced Form.PrintForm method: Now accepts optional arguments like ImplicitEndDoc and OutputAtCurrentPosition, providing more control over how forms are printed.

These updates mark significant strides in integrating modern printing functionalities into twinBASIC while maintaining compatibility with traditional VB6 and VBA environments.


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

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

BETA 570

  • added: initial support for Printers collection and Printer object
  • added: Printer.OutputFile (string hint, e.g. for Print To PDF drivers)
  • improved: Form.PrintForm accepts optional arguments: ImplicitEndDoc (default True), OutputAtCurrentPosition (default False)

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