twinBASIC Update: June 25, 2023

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

Data Binding Arrives!!!

BETA 338 introduced an experimental version of the DAO data control.

Wayne recommends following this VB6 tutorial to test the new twinBASIC data control features.  At the very bottom of the page is a download link with sample exercises.  According to Wayne, exercises 1 through 7 should all work with BETA 341 and later.

For the Access crowd, Ben Clothier asked how databinding in VB6 (and, hence, twinBASIC) compared to databinding in Microsoft Access.  Wayne answered as follows:

There's many differences.  IMO, the biggest is that in Access the bindings between the controls and the underlying recordset fields are very tight, but with VB6 Data control you can think of the bindings being disconnected and synced when the record gets moved/updated.

.DataField/.DataSource/.DataChanged were added to the following controls:

  • Label
  • TextBox
  • CheckBox
  • ComboBox
  • ListBox
  • Image
  • PictureBox

The Data.Refresh method was added, too.

Around the Web

New Questions Channel in Discord Server

If you are a newcomer to twinBASIC, there is now a dedicated channel named "questions" in the twinBASIC Discord server to get answers to questions about the project.

Here's a sample Q&A from the new channel that may be of particular interest to the Microsoft Access crowd:

[maxVBA]: I am trying to figure out a possible migration path from an MSAccess based architecture to a similar one based on tB...  some basic example supporting MsAccess developer like me could be very useful!!!

[bclothier]: Right now, it'd be more like rewriting than migrating. One reason for that is the VB6 controls and data-binding is quite very different from Access' controls and data binding. You would be able to retain the code & queries you already wrote but would have to refactor how the code gets called from the forms and controls to approximate what is already done for free by Access for you. For example, I'm fairly sure, you'd have to move your VBA code from form's BeforeUpdate event to the Validating event in tB form among other things. Continuous forms and datasheets are probably harder to convert.

That said, the data support may make it easier to re-implement the Access form & controls so it should be possible to have a community-driven project to do just that and thus make it easy to migrate an Access application to tB.

64-Bit Version of Kr00l's VBFlexGrid Control

There was a brief conversation in the Discord server about which controls would be included in twinBASIC's v1 release.  Wayne's plan is to include the Common Controls from comctllib/mscomctl along with Kr00l's "excellent VBFlexGrid" control, which he would like to have upgraded to 64-bit and be fully supported.

fafalone offered to handle the 64-bit conversion from the existing 32-bit VB6 project (VBFlexGrid is open source under an MIT license).  Kr00l jumped into the conversation to offer his blessing for the project, but warned about a memory consumption error.  Less than 12 hours later, he apparently had fixed the issue via some direct pointer manipulation:

The sorting (or .RowPosition) is now super fast as TCOLS array in UDT is now swapped by it's pointers only and not copying content over.

Keep an eye out for a new 64-bit compatible version of VBFlexGrid sometime in the next several weeks.

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.

WARNING: The following issue is present in BETA builds 202 - 341 (the latest build as of publication):

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

BETA 337

  • improved: LoadResPicture() should now more correctly handle cursor selection

BETA 338

  • fixed: builtin control events not firing when the control is sited on an Ax container [ https://github.com//issues/1591 ]
  • added: an extremely experimental implementation of the (DAO) Data control, and TextBox.DataField / TextBox.DataSource members
  • added: DatabaseTypeConstants.vbUseACE enumeration for allowing use of Access ACE engine instead of JET in data bound controls

BETA 339

  • fixed: ListBox.Text property-let was not working
  • added: [_HiddenModule].PictureToByteArray method
  • added: initial Label.DataField / Label.DataSource / Label.DataChanged support
  • added: initial TextBox.DataField / TextBox.DataSource / TextBox.DataChanged support
  • added: initial CheckBox.DataField / CheckBox.DataSource / CheckBox.DataChanged support
  • added: initial ComboBox.DataField / ComboBox.DataSource / ComboBox.DataChanged support
  • added: initial ListBox.DataField / ListBox.DataSource / ListBox.DataChanged support
  • added: initial Image.DataField / Image.DataSource / Image.DataChanged support
  • added: initial PictureBox.DataField / PictureBox.DataSource / PictureBox.DataChanged support
  • added: Data.Refresh method
  • fixed: lots of Data control related issues

BETA 340

  • added: intial Data.Validate event support
  • fixed: various Data control issues

BETA 341

  • fixed: DataField runtime property-let now working
  • fixed: DataSource runtime property-set now working
  • fixed: lots of minor issues involving Data control