> ## Content Index
> Fetch the complete content index at: https://nolongerset.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# twinBASIC Update: September 19, 2021
- URL: https://nolongerset.com/twinbasic-update-september-19-2021/
- Published: 2021-09-20T03:26:23.000Z
- Updated: 2026-05-08T13:02:18.000Z
- Description: Highlights include discussions around block scoping and a planned ObjRefCount() function.
- Author: Mike Wolfe
- Tags: twinBASIC Weekly Update, #Import 2026-05-20 02:59

*On April 23, 2021, I helped [Wayne Phillips](twitter.com/WaynePhillipsEA/) introduce the world to [twinBASIC](https://www.twinbasic.com/) at the [Access DevCon Vienna](https://www.donkarl.com/devcon/) conference. I [boldly predicted](https://nolongerset.com/devcon-2021/) 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](https://twitter.com/NoLongerSet) or email me at mike at nolongerset dot com.*

---

## Highlights

It doesn't happen often, but it appears a full week passed without a new release of twinBASIC. Perhaps there is a [good reason](https://github.com/WaynePhillipsEA/twinbasic/issues/429#issuecomment-919200037) for that...

> "...I'm a little busy finalizing the GUI framework at the minute."  
> \- Wayne Phillips (September 14, 2021)

## Around the Web

### Block scoping

Andrew Mansell [opened a discussion](https://github.com/WaynePhillipsEA/twinbasic/issues/436) on the possibility of Block Scoping in twinBASIC.

> Consider the following piece of code:
> 
> ```
> Option Explicit
> 
> Sub Test()
> 
>    If True Then
>        Dim x As String ' Is this block scoped, or procedure scoped?
>        x = "Hello, World!"
>    End If
>    MsgBox(x) ' We find out here
> End Sub
> 
> ```
> 
> In VBx, this will show "Hello, World!". In VB.Net, it will refuse to compile as x is not defined in the same scope as the call to MsgBox.

From there, the discussion expanded to include:

- possible block-scoping syntax
- local functions
- anonymous functions
- type inference

It's a fascinating discussion about language features, even if none of the discussed features end up making it into twinBASIC.

### Planned *ObjRefCount()* function

As you may know, VBA/VB6 use reference counting to keep track of objects and release memory when no longer needed. The language manages the reference counting internally. You don't even need to explicitly release objects by setting them to Nothing; an object's reference count automatically decreases whenever a referencing object variable goes out of scope. As long as you avoid circular references, things should run smoothly. 

However, there are some situations where you may intentionally create circular references. In those cases, you need to be intentional about explicitly releasing objects (`Set MyObj = Nothing`) to avoid leaking memory. 

In such situations, a function that returns the current reference count for an object would be very handy for debugging purposes. It sounds like such a [function is in the works](https://github.com/WaynePhillipsEA/twinbasic/issues/433) for twinBASIC.

## Changelog

Here are the updates from the past week. You can also find this information by installing the twinBASIC VS Code extension and clicking on the Changelog tab of the extension page:

![](https://storage.ghost.io/c/eb/d7/ebd732c1-5f03-4f07-b386-5d08557e15c9/content/images/2021/05/image-2.png)

*Nothing to see here this week!*