# Other Languages > Other BASIC >  TwinBasic

## baka

since theres no thread about this I think its time to make one.
check https://www.twinbasic.com/
and now (2021-01-19) theres 5 videos to watch and planned release February 2021

this could be it. but before we start the festivities lets wait for the release so we can play around first.

the reason to start this thread is to notify about news, this because the other 2 threads _Vb6 , the Future, and what I have discovered_ and _[RESOLVED] Develop a new/modern VB6-IDE_ that mention twinbasic are not updated.

comparing the VB6 IDE and TwinBasic, I prefer VB6 as Im used to it. so hopefully it can be customized a bit, colors, font etc.
sure I will get used to it eventually. the importance is the language and how easy is to find in the code, organize it etc.

----------


## Episcopal

Come on me ... TwinBasic

----------


## yereverluvinuncleber

Should this also be the TwinBasic and RADBasic thread? I know there is a RADBASIC thread https://www.vbforums.com/showthread....light=radbasic but the two new projects need to be kept in the communities' consciousness at the same time and with equal attention. Both projects have potential and are deserving.

https://www.radbasic.dev/blog/2019/0...ject_about.php

----------


## IndicSoftware

@WaynePhillipsEA,

With just a week left for January to end when is TwinBasic planning to release its creation in February. Any date guess?

----------


## yereverluvinuncleber

They'll be late, we are ALL late.

----------


## baka

new page and new video!

----------


## Episcopal

It's still in the oven baking ...

----------


## yereverluvinuncleber

The RADBasic dev is working hard to get something ready for testing. I'm not sure whether it will be released for general testing or just to a select group of testers but something is emerging from the pipeline shortly. Just an update to keep the thread warm.

----------


## Episcopal

I may be wrong, but apparently the twinbasic goes further ...

----------


## Semke

waiting with anticipation.
I hope its as good as its reporting, I wonder which one will be first/better, TwinBasic or RADBasic. they both sound like my dream coming true

----------


## baka

just 4 more days and after that they failed the release date.
understandable that it can take more time, thats the life of a dev. but I hope its nothing serious that halted the development

----------


## WaynePhillipsEA

Hello everyone.  Just wanted to pop in and give you an update on twinBASIC developments.

Our home-schooling requirements during the UK national lockdown has affected our work output more significantly than anticipated.  We are working night and day to get as much done as possible, and things are progressing well, but despite our best efforts our work output is only a third of where it would normally be.  

The good news is that our kids go back to school on 8th March, and normal operations will then resume.   The first twinBASIC release will now be rescheduled for March.  Please accept our apologies.  I promise it will be worth the wait!

----------


## baka

np, good to know its "life" that is slowing things down, as its usually that, circumstances.
the importance is that the motivation is there and the coding is going smoothly without giving too much headaches.
one month extra is nothing with such big project. keep it up!
and hopefully we will win against this virus so we can resume normality, if theres even possible to get back to what it was.

----------


## yereverluvinuncleber

> Just wanted to pop in and give you an update on twinBASIC developments.


Thanks for that, the update appreciated.

----------


## Episcopal

Damn, the twinbasic wasn't even released and I'm already a fan of it ...  :Big Grin:

----------


## mansellan

Just spotted this, I'm a long-time contributer to the Rubberduck extension - Wayne has contributed some of the most complex, ingenious code to the project, deep inside the internals of VB. I'm quite sure this is real, and I'm really looking forward to seeing it.

----------


## baka

Im thinking a bit here.
twinbasic offer 32/64 bit but right now without any gui.
I see from time to time people asking a way to deal with 64bit, but still using their own 32bit application, like a communicator between the 32bit application, the meddler with the 64bit dll/packages.

do you think twinbasic could be that now on its early stage since theres no gui right now, it could at least act as a meddler?
example:
we create an app in twinbasic 64bit, that will communicate with the 64 bit DLLs.
and we create a server functionality that our 32bit application can communicate with.

what say?

----------


## Eduardo-

This thread should be in the VB6 and earlier forum. Nobody see it here (I found it with a Google search).

----------


## Episcopal

Eduardo ... If you put it there, it will be moved

----------


## Eduardo-

> Eduardo ... If you put it there, it will be moved


But that would be wrong. This subject is totally of interest of the VB6 community, and only for the VB6 community.

I, as I think most users, only go to the VB6 and earlier forum, I don't navigate for all the many forums and subforums here (that I even don't remember they exists).

----------


## Episcopal

> I, as I think most users, only go to the VB6 and earlier forum, I don't navigate for all the many forums and subforums here (that I even don't remember they exists).


I also only browse vb6 and earlier.

----------


## yereverluvinuncleber

Then create a thread there, add a brief summary and link it here for information purposes, the thread is in the correct place here. 

We have an idea of what TwinBasic might be but it isn't yet VB6 but one day it might handle VB6 projects whatever they may be - but I understand it will be a BASIC dialect with VB6 compatibility and 64bit. I may be wrong.

We have an idea that RADBasic is striving to be completely VB6 compatible but at the moment that is an aspiration so for the moment RADBasic isn't VB6 but aims to be in the same space VB6 is now (but supported and 64bit).

Until those aspirations are proven and one of those projects becomes both the spiritual and practical successor to VB6  then the thread belongs here I think.

----------


## Eduardo-

> I also only browse vb6 and earlier.


My guess is that this thread was posted originally in VB6 & earlier forum and then moved by the moderators, but not sure.

BTW: I don't think that it is a good idea to have so many subforums when most ones are never used or visited (and most members don't even know they exist).

Perhaps when VB had millions of developers that could made sense, but now that we are a few, we are all in one place.

----------


## baka

yeah, I posted this in vb6&earlier but was moved.
I feel the same, this thread will be invisible for most VB6 users since they will not look outside the VB6 threads.

when twinbasic is out and we can play with it, maybe it can be integrated with VB6 if the code is working in both or theres a communication between the two (as I posted about earlier)

----------


## yereverluvinuncleber

RADBasic latest update.

----------


## baka

hopefully we can try both this year. looking forward to try and compare the two projects.
rad basic looks simpler, and not in a bad way. I dont care how it looks, just that it works and do what I need.

----------


## wqweto

> Just spotted this, I'm a long-time contributer to the Rubberduck extension - Wayne has contributed some of the most complex, ingenious code to the project, deep inside the internals of VB. I'm quite sure this is real, and I'm really looking forward to seeing it.


https://github.com/rubberduck-vba/Ru...aynePhillipsEA

cheers,
</wqw>

p.s. And now I can get notified of new posts in this thread.

----------


## Eduardo-

> p.s. And now I can get notified of new posts in this thread.


I believe that we can subscribe to treads also from the "Thread Tools" menu that is on top (although I never tried it).

----------


## passel

> I believe that we can subscribe to treads also from the "Thread Tools" menu that is on top (although I never tried it).


Unless you've disabled it, the default option is to automatically be subscribed to any thread you've posted in, which is what I think wqweto was referring to in his p.s.
He didn't ask "how" to get notified, he stated "now" he can get notified, since he has posted in the thread.

----------


## Eduardo-

> Unless you've disabled it, the default option is to automatically be subscribed to any thread you've posted in, which is what I think wqweto was referring to in his p.s.
> He didn't ask "how" to get notified, he stated "now" he can get notified, since he has posted in the thread.


I understood his post as an action with the purpose of being notified of the thread.

----------


## xiaoyao

It's too bad that it's not VB6 and it's not allowed to be displayed in the VB6 section. This so-called other channel even has less than ten posts. The equivalent of life imprisonment. Any new IDE like VB6, I don't think should be treated so unfairly. Just as there are very few Indians who are classified as colored.

----------


## 2kaud

There's a RADBasic thread in the VB6 forum https://www.vbforums.com/showthread....w-radbasic-dev

----------


## baka

this thread should now only be about TwinBasic!

----------


## TTn

I'm not really sure what is being demonstrated here #25.  It looks like a simple project browser at this point after all this time, without any significant capabilities...not a single one demonstrated.  Is it being debugged or just shelled.... This project is fake

----------


## baka

that is radbasic.
please go here: https://www.vbforums.com/showthread....w-radbasic-dev

(before it was moved here we used this thread, but now since we have radbasic on its own thread, we keep this one twinbasic only)

----------


## yereverluvinuncleber

I'll re-post that RADBasic video there then instead. @Ttn, I don't think it is a fake, I think it just shows what he's done up to this point - and no more. I think he is trying to bash out a user-testable version of what he has built so far. A proof of concept using ANTLR to convert and LLVMClang to compile. Most likely he will release it soon for users to test. I am more positive than most with regard to the various efforts being made here and there to take VB6 forward. I think he has a path and he is pursuing it with positivity. That is 50% of the battle, just having a direction and pursuing it without being deflected by any negativity - you know what I mean as you have experienced it yourself.

----------


## yereverluvinuncleber

> that is radbasic.
> (before it was moved here we used this thread, but now since we have radbasic on its own thread, we keep this one twinbasic only)


We certainly had a RadBasic thread (before this one) but it was quite an incendiary thread and more about community disapproval, disbelief and negativity as to the technical approach of such a tool. As such it died a little death... but it has been re-opened now and so I will post about RADBasic there instead. Let's try to stay positive in this thread and the other and try to help the developers in any way we can, regardless of our own opinion.

----------


## VB6 Programming

I see TwinBasic are now saying "The first preview version of twinBASIC will be released to the public on *7th April 2021*"




> This first version of twinBASIC will not offer any GUI (form) elements.
> Once we have finalized and fixed up any bugs in the first release of twinBASIC, we will be focusing on three key areas over the coming weeks and months:
> Forms / GUI support, including full backwards compatibility with existing VB6 forms.Native compilation.Cross-platform compilation.


https://twinbasic.com/

----------


## baka

one thing that I would like to understand is the cross-platform compilation.
VB6 is "a lot" of API calls, the graphics, is GDI, so to make it compatible all that need a substitute.
will twinbasic offer a substitute for windows as well? to make the graphic more robust and faster than gdi?

I mean, if I use direct2d to create some graphics in VB6, how will that be possible to use on ios/mac/linux/? when they don't have it?
if I use GDI api calls, its the same, that need to be converted on ios/mac/linux/?.

if I use the internal VB6 graphics, its too slow and limited. this need to be addressed so it can be added early.

as I can see we have 32/64 bit mode we can switch between.
I would like a "cross" mode, that is made for the cross-platform purpose. in that mode, u can not add anything that is not "supported", so u can only add things that actually works in all platforms. so kind of "limited-mode".
and of course, if the community can create a "plugin", similar to RC6/cairo. that can be used for the cross-mode.

----------


## WaynePhillipsEA

@baka,   when it comes to cross-platform, the feature set will indeed have to be much more limited.  Certainly no GDI/direct2d/etc, as you'd be better off running under WINE for such things.  

Our plans on the GUI side of things will offer much greater flexibility than what VB6 offers though  :Smilie:    There are already plans for a 'legacy' mode in twinBASIC to allow restricting the feature set for pure VB6 compatibility, and so there will naturally be an extension of that when it comes to cross-compilation to restrict the feature set up-front.

----------


## VB6 Programming

> @baka,   when it comes to cross-platform, the feature set will indeed have to be much more limited.  Certainly no GDI/direct2d/etc, as you'd be better off running under WINE for such things.


That makes sense.

For me, any VB6 alternative needs to be able to run existing VB6 apps (on Windows).
That includes using ActiveXs and OCXs. And intrinsic controls. What about DAO and ADO, for example? Can they be used? 
Would it be legal to use Microsoft controls? 
And can 32bit ActiveXs/OCXs be used in 64bit apps?
Krools controls offer good alternatives to some of the MS OCXs, will they work too (I'm assuming so)?

Hopefully this will start to become clearer when the preview release becomes available.

My other concern is about the continued availability of the product - what happens if you lose interest/move on/find it's not profitable? Some form of Escrow (with release to open source if you stop selling the product) would be wise.

----------


## WaynePhillipsEA

> That makes sense.
> 
> For me, any VB6 alternative needs to be able to run existing VB6 apps (on Windows).
> That includes using ActiveXs and OCXs. And intrinsic controls. What about DAO and ADO, for example? Can they be used? 
> Would it be legal to use Microsoft controls? 
> And can 32bit ActiveXs/OCXs be used in 64bit apps?
> Krools controls offer good alternatives to some of the MS OCXs, will they work too (I'm assuming so)?
> 
> Hopefully this will start to become clearer when the preview release becomes available.
> ...


The first release will not support any GUI elements, as we are concentrating on creating a rock solid compiler that we can build everything else upon.   That being said, we will certainly be supporting ActiveX and OCX controls once we get onto the GUI side of things soon.  

twinBASIC already fully supports COM (early and late binding support).  If I'm not mistaken, DAO/ADO were (/are?) part of MDAC which is freely available and redistributable and so are already supported in the upcoming release.    

For supporting 32-bit OCXs in a 64-bit process, yes this is planned via a bridging process which should be compatible with most OCXs (but not all).   Krools controls should work fine, as all OCXs will, though for full 64-bit support they likely require some work.

We are considering escrow options.

----------


## Episcopal

> as we are concentrating on creating a rock solid compiler that we can build everything else upon.



Wayne, I'm sorry if I misunderstood, but the whole project, like the IDE, is compiled from this compiler?

----------


## WaynePhillipsEA

> Wayne, I'm sorry if I misunderstood, but the whole project, like the IDE, is compiled from this compiler?


No, apologies; my bad choice of words.

The IDE is covered by VSCode plus the twinBASIC extension (written in JS).  That extension connects directly to our compiler, which comprises the parser, compiler, debugger, linker, etc, all written in C++.

What I was trying to say was that we have been concentrating on creating a compiler that will provide a solid foundation to build the rest of the project around.  The compiler is such a massive thing to get right on a project like this that we tackled it head on before touching other areas like the GUI designers.

----------


## VB6 Programming

TwinBasic are now saying "*UPDATE: First preview release coming Friday (9th April 2021)*"

At least the delays are getting shorter  :Smilie: 

I'm sure none of us on this forum are ever late delivering our software  :Wink:

----------


## baka

the importance is that they are working on it and is going well without much troubles and bugs.
a couple delays here and there and ok as long they are honest with the reason.
we will see, but if they can predict just a 2 days delay it means they are close.

----------


## VB6 Programming

There is a new article about coding in TwinBasic.
TwinBasic uses VSCode as its IDE.


Writing Code in TwinBasic: Part 1

----------


## VB6 Programming

... and part 2 is here

Writing Code in TwinBasic: Part 2

----------


## VB6 Programming

The TwinBasic Developer Preview 1 (v0.9.1502) download is now available  :Big Grin:  ...

https://www.twinbasic.com/preview.html

TwinBasic uses VS Code as its IDE (you need to download this separately).

The plan seems to be that the 32bit Windows version will be free of charge, but for 64bit versions developers will need to buy a licence.

EDIT:
TwinBasic say:
This first version of twinBASIC will not offer any GUI (form) elements.
Once we have finalized and fixed up any bugs in the first release of twinBASIC, we will be focusing on three key areas over the coming weeks and months:
Forms / GUI support, including full backwards compatibility with existing VB6 forms.Native compilation.Cross-platform compilation.

This preview version of twinBASIC can compile standalone EXE applications, as well as ActiveX DLLs that you can reference from other environments, like VBA.
TwinBasic state that most of the common VB language features are complete, however there are several important things to note. These issues will be fixed in the weeks ahead:-

Compiles only to 32-bit. We wanted to focus on key areas in this preview, without getting distracted by users hitting 64-bit compilation issues that are not specific to twinBASIC. Plus we have some 64-bit linker issues to work through.Error numbers and descriptions don't always match VB yetSupport for global variables (plus global constants, and predeclared objects) are currently disabledLate-bound calls to twinBASIC class objects are disabled (but late-bound calls to other normal COM objects are working fine)twinBASIC classes cant yet expose events (but you can consume events from other COM classes via WithEvents)multi-threading only allowed via the debug console for nowvbWatchdog support disabledWebserver extension library disabledThe VBA.Interaction.* namespace is implemented but has little test coverage, so there may be issuesThe VBA.Strings.* namespace is implemented but has little test coverage, so there may be issuesWith-blocks not working with user defined Types (but working fine with objects)DllRegisterServer is not currently implemented in built ActiveX DLLs (the IDE registers it appropriately for now)Occasionally the file solution wont open and you can't access the files in the project. If that happens, close VS Code and open the code-workspace file again

----------


## wqweto

Eleven downloads already! :-))

Edit: VS Code IDE needs getting used to but overall the compiler seems to work and is quite fast. Kudos!

cheers,
</wqw>

----------


## yereverluvinuncleber

What a bu@@er, I do not use Windows 10 for development and do not plan to either. So, I won't be able to test TwinBasic for the moment. What a pity. I suggest you chaps find alternatives for other versions of the Windows o/s. It needs to be accessible to more than just the current windows version. I understand the reasons  - I am just one of those people that has absolutely no plans to use Windows 10 whilst any other solution exists.

----------


## WaynePhillipsEA

> What a bu@@er, I do not use Windows 10 for development and do not plan to either. So, I won't be able to test TwinBasic for the moment. What a pity. I suggest you chaps find alternatives for other versions of the Windows o/s. It needs to be accessible to more than just the current windows version. I understand the reasons  - I am just one of those people that has absolutely no plans to use Windows 10 whilst any other solution exists.


It's purely untested on other OS at the moment.  If you fancy being a guinea pig, give it a try anyway  :Smilie: 

We'll be testing on other OS's over the coming days and will rectify any issues found.

----------


## yereverluvinuncleber

> It's purely untested on other OS at the moment.  If you fancy being a guinea pig, give it a try anyway 
> 
> We'll be testing on other OS's over the coming days and will rectify any issues found.


First Class, I know VS Code runs on Win 7 - I will test and reply if there are any issues. 

BTW I sent you some cash a while back for your Rubberduck add in, hope to do the same for TB.

----------


## VB6 Programming

> I am just one of those people that has absolutely no plans to use Windows 10 whilst any other solution exists.


I guess that is NfN    :Big Grin:  :Big Grin:   :Wink: 

Windows 10 isn't that bad, really.  Though I don't really have a choice, all my customers (mainly corporates) use Windows 10 (64bit) only.  The biggest issue now with Windows 10 is knowing what version of Windows 10 they are using.  Versions 1909 (September 2019) and 2004 (April 2020) seem to be the most popular.

I suspect TwinBasic would work on Windows 7 (VS Code does).

----------


## yereverluvinuncleber

Re: windows 10 - It is THAT bad, my own personal experiences have shown how bad it is for a poor desktop user.  The white cog of doom has been encountered and my decision is made. 

I do love working in Win 7 and XP but I do have Win10 for testing (only) and luckily I have my options! 
VB6 and the o/s and now (VS code?) are my last Alamo-like holdouts for Microsoft products. I have open-sourced or found usable alternatives for all. Just VB and the underlying o/s to go, until then Win7 is my dugout.

----------


## immortalx

That's pretty awesome and the integration with VSCode is fantastic. Kudos to the developers!

----------


## CreativeDreamer

I tried the preview and it worked well.
The instruction on installing the compiler was a little vague (install from marketplace) but I ended sorting it  ( Run, Install Additional debuggers/compilers, choose TwinBasic)
I can't wait to see how TwinBasic develops. I was kind of really devastated to see the Vb6 PlanetVb web site disappear so I am hoping all the uploaders will turn to TwinBasic and convert their old vb6 projects. I was a regular uploader to PlanetVb. It might be nice to get sent email updates on the progress of TwinBasic. I will definitely buy it when it becomes available (hoping its not too expensive, as I am a lowly paid teacher). I sent a few ex members of PlanetVB the details of Twinbasic.

I  also ended up pledging my support for RadBasic, as I would like to see both compilers develop to be replacements for Vb6.
I played around with FreeBasic (32bit and 64bit) as well, but it seemed to lack gui drag and drop components like in Vb6 forms.

Wishing you well Wayne PhillipsEA

Regards Eddie Bole

----------


## Arnoutdv

Never had any problem with any version of W10 for developing VB6 applications.
My customers also have a wide range of W10 version.

----------


## baka

I use both 7 & 10. but my primary OS is 7.
10 is still buggy for me, some tools dont work that I like to work with (paint shop pro 9) and my latest project is not working in 10, it will compile a buggy exe, while it works 100% in 7.

so, Im a bit sad that twibasic need 10 to work. when I get back home in 4 days, I will be trying it in 7. I can be a guinea pig as well.

----------


## WaynePhillipsEA

Thanks everyone, glad to hear some of you have got it working already!

To those not on Win10... we hear you.   There's no technical reason why the twinBASIC compiler won't work on earlier versions of Windows, it's just a matter of time and priorities for us to test (and possibly tweak) it properly.

----------


## krita

OS: win7 ultimate x64 works with x32 compiled exe. When x64 compiler coming out?! good luck with the project!

----------


## WaynePhillipsEA

> OS: win7 ultimate x64 works with x32 compiled exe. When x64 compiler coming out?! good luck with the project!


Thanks for that, that is good news.     Next on our agenda is sorting out the global variables support, and the late-binding of twinBASIC classes (IDispatch).  After that, we will get to work on the changes for the x64 linker.  We are certainly talking weeks, not years  :Smilie:

----------


## yokesee

Very good job, it works perfectly.
My support for this great project.
regards

----------


## TTn

Can TwinBasic open an existing .vbp file?  I want to test Twin without downloading project files in an unknown format.   I'm on Windows 10 latest updates.  Thanks.

----------


## VB6 Programming

> Can TwinBasic open an existing .vbp file?


Not yet.  TwinBasic say "In a future revision we will offer automatic migration from VB6 project files (.vbp)".

They seem to be suggesting it will be in "weeks not years".

----------


## VB6 Programming

Here is an outline of how to debug code in twinBASIC...

Debugging code in twinBASIC

----------


## radBasicHost

Wayne,

Congrats for this milestone.

I think there is enough room for our projects and they could live side by side.

We talked before and we are kind each other  :Smilie:

----------


## Episcopal

> I think there is enough room for our projects and they could live side by side.


Would this be partnership or merger?

----------


## radBasicHost

> Would this be partnership or merger?


None. At this moment friendly relationship.

We see in future...

Regards

Carles

----------


## WaynePhillipsEA

> Can TwinBasic open an existing .vbp file?  I want to test Twin without downloading project files in an unknown format.   I'm on Windows 10 latest updates.  Thanks.


No, not in preview 1.   They will be supported in due course though, so watch this space.

----------


## WaynePhillipsEA

> Wayne,
> 
> Congrats for this milestone.
> 
> I think there is enough room for our projects and they could live side by side.
> 
> We talked before and we are kind each other


Thanks Carles, appreciated.   I see that you have started your kickstarter campaign -- good luck with it!

----------


## CreativeDreamer

Nice to see some extra information  happening. I have contacted some programmers from the old PlanetVB site. They are eager to play around with the preview release. Hopefully TwinBasic eventuates into a replacement for VB6 and more. I sort of would like to see a few more examples of programs made with TwinBasic, but I guess the program still needs to be further developed.

----------


## Thierry69

I did a first simple test with TwinBasic with this code, using ADODB to make a query to an Access DB



```
Module TestADODB_Module

    ' This project type is set to 'Standard EXE' in the Settings file, so you need a Main() subroutine to run when the EXE is started.
    Public Sub Main()

        MsgBox ("Test ADODB" & vbcrlf & TestDB(),vbInformation+vbYesNoCancel)

    End Sub
    
    Public Function TestDB() as string
    
        dim sConnection as string 

        sConnection = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=D:\Twinbasic\test\test.mdb"
                
        Return GetFieldFromID(sConnection, 1, "Products", "ProductName")        
    
    end Function        

	Public Function GetFieldFromID(sConnection  as String, nID As Long, sTableName As String, sReturnField As String, Optional sFieldID As String = "ID", Optional sDefault As String) As String
        ' #VBIDEUtilsERROR#
        On Error GoTo ERROR_getFieldFromID

        Dim sSQL             As String
        Dim oRecord          As ADODB.Recordset
        Dim aRecords         As Variant

        sSQL = "Select Top 1 " & sReturnField & " From " & sTableName & " Where "
        sSQL = sSQL & sFieldID & " = " & nID

        Debug.Print sSQL

        Set oRecord = New ADODB.Recordset
        oRecord.Open sSQL, sConnection, adOpenForwardOnly, adLockReadOnly
        
        aRecords = oRecord.GetRows()

        If UBound(aRecords, 2) > -1 Then
            GetFieldFromID = aRecords(0, 0)
        Else
            GetFieldFromID = IIf(IsMissing(sDefault), vbNullString, sDefault)
        End If

        EXIT_getFieldFromID:
        On Error Resume Next
        oRecord.Close
        Set oRecord = Nothing
        Erase aRecords

        Exit Function

        ' #VBIDEUtilsERROR#
        ERROR_getFieldFromID:
        Debug.print Err.Description
        Resume EXIT_getFieldFromID

    End Function

End Module
```

And the result is good, even error handling
I had to do some modifications to the code. 

So it seems a good start, but not yet any GUI

NB : I had to disable Kaspersky to make VSCode opening Twinbasic project.
I need to investigate the reason

----------


## WaynePhillipsEA

> I did a first simple test with TwinBasic with this code, using ADODB to make a query to an Access DB
> 
> 
> 
> ```
> Module TestADODB_Module
> 
>     ' This project type is set to 'Standard EXE' in the Settings file, so you need a Main() subroutine to run when the EXE is started.
>     Public Sub Main()
> ...


Thanks for trying out twinBASIC, @Thierry69!  

With regards to the Kaspersky problem, it will be our compiler EXE triggering it.   The file usually sits in the following folder:
    C:\Users\{UserName}\.vscode\extensions\twinbasic.twinbasic-0.9.****\out\bin   (where **** is the version number installed)

You may need to create an exception rule in Kaspsersky for now.  Soon, we will be code-signing the compiler EXE, and this should help increase the reputation of the file over time, and then this problem should resolve.

----------


## VB6 Programming

There is a new release of twinBASIC, v0.9.1537.
It should update automatically.
See the Extensions view (button on left of screen, or View>Extensions from the menu).
You may need to restart if you have an older version.

----------


## VB6 Programming

Here is an article about creating an ActiveX DLL in twinBASIC

Creating a twinBASIC ActiveX DLL

----------


## wqweto

> Here is an article about creating an ActiveX DLL in twinBASIC
> 
> Creating a twinBASIC ActiveX DLL


How do we create *new* workspaces for Std-EXE/Ax-DLL for twinBASIC within VS Code? Am I missing the menu option or do we have to copy these from the samples?

cheers,
</wqw>

----------


## WaynePhillipsEA

> How do we create *new* workspaces for Std-EXE/Ax-DLL for twinBASIC within VS Code? Am I missing the menu option or do we have to copy these from the samples?
> 
> cheers,
> </wqw>


You're right, please copy the helloworld project, and adjust as you need.  Apologies, I know it's a pain at the moment in the preview.  

If you rename the helloworld files, just note that the code-workspace and twinproj files need to be named identically for now (...except for the file extension of course).

----------


## wqweto

Cloning sample Std-EXE it seems I cannot add second source file for some reason, neither under Sources node, nor under a sub-folder I successfully made under it



cheers,
</wqw>

----------


## WaynePhillipsEA

> Cloning sample Std-EXE it seems I cannot add second source file for some reason, neither under Sources node, nor under a sub-folder I successfully made under it
> 
> 
> 
> cheers,
> </wqw>


Yes, this limitation is noted in the preview notes:  https://www.twinbasic.com/preview.html

You can add as many components as you like to the single source file though.  Sorry about that.

----------


## wqweto

> Yes, this limitation is noted in the preview notes:  https://www.twinbasic.com/preview.html
> 
> You can add as many components as you like to the single source file though.  Sorry about that.


Hey, no problem, I'm sure this will eventually work. I'll be putting everything in *the* single source file for now.

Btw, just read the list with limitations and couldn't find anything about multiple source files -- at least the bullet with this is not obvious to me.

cheers,
</wqw>

----------


## WaynePhillipsEA

> Hey, no problem, I'm sure this will eventually work. I'll be putting everything in *the* single source file for now.
> 
> Btw, just read the list with limitations and couldn't find anything about multiple source files -- at least the bullet with this is not obvious to me.
> 
> cheers,
> </wqw>


You're right, it should be in that list.  It's currently further down in the 'Starting a new twinBASIC project' section.  I'll get that sorted, thanks.

----------


## wqweto

Are Consts at module level still disabled like in



```
Class cAsyncSocket

    Private Const MODULE_NAME As String = "cAsyncSocket"

End Class
```

This fails with "syntax error.  no handler for this symbol" but 

Private MODULE_NAME As String = "cAsyncSocket"
. . . works.

Is this new syntax compiled to a member variable with an initializer?

cheers,
</wqw>

----------


## WaynePhillipsEA

> Are Consts at module level still disabled


Yes, this will be sorted this week.




> Is this new syntax compiled to a member variable with an initializer?


Yes, that's exactly correct.   But... there's also a special symbol.... CurrentComponentName to help you out there  :Wink:

----------


## wqweto

> Yes, this will be sorted this week.
> 
> 
> 
> Yes, that's exactly correct.   But... there's also a special symbol.... CurrentComponentName to help you out there


Wow, now that's a mouthful! :-))

Not sure if VB.Net has NameOf(MyClass), NameOf(MyMethod) and NameOf(MyParam) the way C# has but .Net languages are lacking compared to C/C++ as simple as __FILE__, __LINE__, __FUNCTION__

cheers,
</wqw>

----------


## wqweto

This works in VB6/VBA

    Private Declare Function ArrPtr Lib "msvbvm60" Alias "VarPtr" (Ptr() As Any) As Long

    Public Sub Main()
        Dim arr() As Long
        Dim ptr As Long
        ptr = ArrPtr(arr)    End Sub
. . . but fails compiling with TB with "validation of call to 'ArrPtr' failed.  argument for 'Ptr': cannot coerce type 'Long()' to [ByRef] 'Any()'"

Changing API declare to Ptr() As Long fixes it but this would require separate API declare for each possible type for array's elements.

This

Class Test
    Public Sub Init()
        PassThis Me    End Sub

    Public Sub PassThis(oRef As Test)

    End SubEnd Class

. . . fails with "unable to bind to reference; this is a read-only binder".

Edit: Oh, it needs ByVal oRef As Test -- I get it :-))

cheers,
</wqw>

----------


## WaynePhillipsEA

> This works in VB6/VBA
> 
>     Private Declare Function ArrPtr Lib "msvbvm60" Alias "VarPtr" (Ptr() As Any) As Long
> 
>     Public Sub Main()
>         Dim arr() As Long
>         Dim ptr As Long
>         ptr = ArrPtr(arr)    End Sub
> . . . but fails compiling with TB with "validation of call to 'ArrPtr' failed.  argument for 'Ptr': cannot coerce type 'Long()' to [ByRef] 'Any()'"
> ...


Thanks @wqweto, these will be fixed in tomorrows release!  Also, if I remember correctly, we made our version of VarPtr accept arrays natively.

----------


## wqweto

This

Class Test

    Private Property Get Data(ByVal First As Long, Optional ByVal Index As Long) As Long

    End Property

    Private Property Let Data(ByVal First As Long, Optional ByVal Index As Long, ByVal lValue As Long)

    End Property


    Public Sub Init()
        Data(3) = Data(4)    End Sub 
End Class

. . . fails with "too few arguments, expected at least 2 in call to 'Data'".

Passing an explicit value for the optional Index parameter fixes it.




> Thanks @wqweto, these will be fixed in tomorrows release!  Also, if I remember correctly, we made our version of VarPtr accept arrays natively.


Cool!

Unfortunately my cAsyncSocket class is both using With MyUdt / End With in a few places *and* is raising events with RaiseEvent OnReceive (to be usefull for anything) so I'll have to wait a few more weeks to test porting my VNC server (headless and perfect match for TB testing).

cheers,
</wqw>

----------


## WaynePhillipsEA

> This
> 
> Class Test
> 
>     Private Property Get Data(ByVal First As Long, Optional ByVal Index As Long) As Long
> 
>     End Property
> 
>     Private Property Let Data(ByVal First As Long, Optional ByVal Index As Long, ByVal lValue As Long)
> ...


I'll get that fixed as well -- thanks very much for looking at twinBASIC.  I'll let you know once we've got those other two hurdles sorted as well.  Thanks

----------


## Schmidt

> You can add as many components as you like to the single source file though.


The "single file concept" can later be quite handy, when it comes to the "publishing" of small or midsized Demos...
(only one file to upload to GitHub or Bitbucket, or to "drag into an Email").

In that regard...
Currently there are *two* files to "manage" a project:
- ProjectName.code-workspace
- ProjectName.twinproj

The *.code-workspace (as a file-ending) is already associated with (VS)Code.exe (containing setting-defs in JSON-format).
Whereas the *.twinproj is not associated with any executable currently...

So, why not ship your VSCode-plugin-binaries with an additional little "TwinStarter.exe", 
which after installing the plugin is then already "registered" for the *.twinproj File-endings...

The TwinStarter.exe will then get the chance, to "do a few things with the passed project-file" internally, as e.g.:
- dynamically creating a *.code-workspace-file with the same ProjectName (in case there currently is none in the same folder)
- for that, one could parse out a "leading JSON-header" (instead of the current "binary one")
- and that header should be compatible with the JSON-format which is expected in a "normal *.code-workspace-file"
- to be able to ensure the content of a potentially missing *.code-workspace-file,
- which after that dynamic creation could then be used to start VSCode (indirectly) in turn ...
- simply by calling ShellExecuteW with the *.code-workspace-filepath

So, this new "JSON-header" (instead of the binary header+footer in *.twinproject files),
basically contains the normal JSON-fields which are expected in a *.code-workspace-file,
but also a few "additional JSON-nodes" (as e.g. references to additional "normal *.bas and *.cls files) - 
but of course also the informations which formerly sat in the binary header and footer of a *.twinproject.

Ensuring "plain text" in files which contain code - also agrees better with later Repo-Uploads 
(to not confuse any "diff-processings" between file-versions).

To conclude - I guess what I was trying to say is - please "empower" the *.twinproject files, making them more universal in:
- not requiring a workspace-file (because the new TwinStarter.exe can ensure that dynamically)
- only containing PlainText in the end (a leading JSON-header instead of the current binary ones)
- codewise keeping their current ability to directly host module- and class-sections as a single-file code-container
- whilst also offering the ability, to act more like a *.vbp (only containing relative references to *.bas and *.cls code-files)

Olaf

----------


## WaynePhillipsEA

> The "single file concept" can later be quite handy, when it comes to the "publishing" of small or midsized Demos...
> (only one file to upload to GitHub or Bitbucket, or to "drag into an Email").
> 
> In that regard...
> Currently there are *two* files to "manage" a project:
> - ProjectName.code-workspace
> - ProjectName.twinproj
> 
> The *.code-workspace (as a file-ending) is already associated with (VS)Code.exe (containing setting-defs in JSON-format).
> ...


Hey Olaf,

Thanks for your thoughts.  Ironically, in the early alpha builds we had a single file solution, which was a single code-workspace file that had the project file embedded into a configuration setting BLOB as base64 data (in the JSON file).  It worked well for small project files, but it soon became apparent that the code-workspace file wasn't designed to handle large binary data, so we separated out the project file to improve the performance.   

I do like your idea, but the problem with using a temporary code-workspace file is that there is potentially no chance to save/propagate changes in the temporary code-workspace file back to the proposed dual-format file.   To explain... When VS code informs extensions to cleanup and shutdown, the extensions have very tight restrictions on what they can do, and the time they get to do it in.  During testing I noted VSCode extensions get roughly 1 second each to shutdown (sometimes less), and then... poof the extension process is destroyed abruptly -- if you try to save something at that point, you most certainly would end up causing corruption if there's even a small delay.   Even executables that are started from the Node.js environment, such as the twinBASIC compiler get terminated abruptly alongside the extension host.

Now it may be that we can come up with a reasonable solution to the above problem, but I'm not convinced it's possible to make it 100% reliable, and that concerns me.

Ideally we'd provide the code-workspace file itself to VSCode via a virtual file system, so that we then get proper control of reading and writing the file.  But unfortunately, I had already tried that method early on in development, and VSCode just didn't allow it.

*A solution might be to just make the code-workspace file optional, and have a default one created on-demand if you open the twinproj file in VSCode.  That way, you can distribute just the twinproj file for simplicity.*

The file format for the twinproj file is binary because we allow binary files in the virtual file system, and formats like JSON are not great for binary data.   The reason for allowing binary files is because you'll be able to put files (e.g. graphics) into the Resources folder soon, and they will be pushed directly into the built EXE/DLL resources at link time.    For source control concerns, we will be offering git integration that works off the virtual file system in-memory, and so the actual binary file format that the project file is stored in won't matter.

----------


## Eduardo-

Hello, congrats for your achievements!

Since it is intended to have backward compatibility with VB6 I want to ask if there is any technical reason for not sticking to the original file format and system, I mean plain text for definitions and binary files for binary data.

Text files:
vbp
bas
frm
cls
ctl
pag

Binary files:
frx
ctx
pgx
res
(better forget about vbw)

You could add your own new keys and sections on the text files for the new properties and features, or even new text files if needed, and new binary files (and extensions) if needed for whatever new features not supported by the original format.

The developers many times like to edit the files "by hand", but for being able to do that the files need to be easily readable and understable.

That's my opinion (and wishes). 

I wish much success to you and also to Carles.

----------


## WaynePhillipsEA

> Hello, congrats for your achievements!
> 
> Since it is intended to have backward compatibility with VB6 I want to ask if there is any technical reason for not sticking to the original file format and system, I mean plain text for definitions and binary files for binary data.
> 
> Text files:
> vbp
> bas
> frm
> cls
> ...


Hi Eduardo,

Thanks for your message.    The plan is that all these formats will be supported, and natively.

Think of the twinproj file like a ZIP container, but it will also allow links to external files.    So you'll be able to open a VBP file in twinBASIC/VSCode, and that will get migrated to the twinproj format, with links to the individual files (.bas, .cls, etc).  The VBP file will be kept in-sync with the new twinproj format, and this will be effectively invisible to the developer.

The .twin file format is naturally different, because there is no way we can represent that in the old VB6 file formats at all, since you can't have multiple components per file, but all the original VB6 file formats will be supported via file links.  Just not for this preview  :Smilie:

----------


## Eduardo-

> there is no way we can represent that in the old VB6 file formats at all, since you can't have multiple components per file


Thanks for responding Wayne,

I don't know why you need multiple components per file, what are these components and why they cannot be written all together, the text part into a text file and if they have a binary part into a companion file (as VB6 does).

But I don't know what you are doing. I just have some insights into your project but I still didn't test anything (I've been currently busy with other things, but I'm very interested of course). 
Aside from that, in my case the last 10 times that I said something was impossible 9 I was wrong.
But if you say so, it must be.

Regards.

Edit: I mean text files UTF-8 encoded, with some keys Base-64 encoded if necessary.

----------


## VB6 Programming

An article about additional features in the VB6 compatible twinBASIC...

New Syntax in twinBASIC: Part 1

----------


## immortalx

May I make a little suggestion? A compiler option to enforce assignment and equality/inequality (= and ==/!=) syntax, as in C and other languages. I guess it only makes sense by producing an appropriate warning if a "=" is used in a comparison.

----------


## wqweto

> May I make a little suggestion? A compiler option to enforce assignment and equality/inequality (= and ==/!=) syntax, as in C and other languages. I guess it only makes sense by producing an appropriate warning if a "=" is used in a comparison.


Why? Assignment is never an expression i.e. something like IIf(Total = 0, 0, 42) will never assign 0 to Total and Count = Total = 42 will never assign 42 to Count (nor Total) so BASIC is safe regarding this C-world idiosyncrasy.

cheers,
</wqw>

----------


## immortalx

No reason other than habit, readability and being able to more easily port C stuff.

----------


## Schmidt

> *A solution might be to just make the code-workspace file optional, and have a default one created on-demand if you open the twinproj file in VSCode.  That way, you can distribute just the twinproj file for simplicity.*


I'd appreciate, when at least that will work in the future.
And as for "back-syncing" into the twinbasic-projectfile... (from the dynamically created workspace-file).

If it succeeds, all is well - and the "TwinStarter.exe" could override the "last temporary workspace-file" with it.
If it does not succeed (or was left out) - then "TwinStarter.exe" could use:
- either the last temporary workspace-file
- or if there isn't one yet for the project-file, then dynamically create one with the default-settings




> The file format for the twinproj file is binary because we allow binary files in the virtual file system...


The only binary files which come to my mind, are image-files (or perhaps Font-Files)...
And *especially* these should go into a different, isolated location in the filesystem.

You might want to take a look, how "all kind of resources" *could* be handled
(conveniently, behind a \Res\ SubFolder below the Poject-Path, where you can place anything):
https://www.vbforums.com/showthread....ontainer-Files

According to the above example - what you will end up with - is a single Res.zip file -
which in turn could be "hung in" into the final binary as a "single ByteArray-resource" in a post-compile-step automatically.

I also don't see the "big advantage" of dealing with the "virtual file-structure" you currently have.
...IMO, the Node.js fs-module is capable enough to deal with "normal Files" in a performant manner
(with free choice, to do certain methodcalls synch-, or asynchronously).

And if I read the VSCode-docu correctly - its "workspace" should be able to provide you with 
proper "filechange"-events also for normal files.

JFYI -  the main-VB6 project at the place where I work, has literally "hundreds" of modules and classes
(when combined in certain Debug-Groups)... meaning "Megabytes of Code" to compile for a debug-run.
I cannot imagine that VSCode will not choke, when such an amount of modules shall be handled in "virtual mode".

And as for the "binary-format" (binary-blocks) on your project-file ...
I'm quite sure I'm not the only one here, who would (quite strongly) prefer "plain-text" for that important "entry-point-into-a-given-project".

Cannot count the times and occasions, where I've written (or used) tools,
which performed different operations on all kind of VB-sourcefiles (without involving the VB6-Executable at all).

Olaf

----------


## WaynePhillipsEA

> You might want to take a look, how "all kind of resources" *could* be handled
> (conveniently, behind a \Res\ SubFolder below the Poject-Path, where you can place anything):


Yes, that is pretty much what we have planned.  We already have the Resources folder in the project virtual file system ready for this.  Files in there will be embedded at build time automatically into the PE file resources section, and they will be exposed conveniently through the object model at runtime.




> I also don't see the "big advantage" of dealing with the "virtual file-structure" you currently have.
> ...IMO, the Node.js fs-module is capable enough to deal with "normal Files" in a performant manner
> (with free choice, to do certain methodcalls synch-, or asynchronously).


Absolutely, I agree.    That wasn't a factor in the decision.

The main reason for the current design is so that we can, in future, support in-memory VBA streams (which are IStorage based).  This design is extremely flexible, in allowing for both in-memory streams as well as on-disk files.   The further benefit of being able to distribute a simple one-file project solution is also particularly useful.




> JFYI - the main-VB6 project at the place where I work, has literally "hundreds" of modules and classes
> (when combined in certain Debug-Groups)... meaning "Megabytes of Code" to compile for a debug-run.
> I cannot imagine that VSCode will not choke, when such an amount of modules shall be handled in "virtual mode".


Oh believe me, VS Code will handle this just fine.   The virtual file system is actually implemented within the twinBASIC compiler (written in C++), with VS Code connecting to it via raw socket requests.  Believe me, we have extensively tested it, and there is absolutely no performance concern with the scenario you describe.

----------


## VB6 Programming

I have to say how impressed I have been with twinBASIC so far.  Good work, Wayne.

Are you planning to publish a roadmap for twinBASIC - when can we expect Forms/GUI support?

----------


## TTn

> No, not in preview 1.   They will be supported in due course though, so watch this space.


Also on my wish list is having compile switches similar to VB.  Compile switches from Advanced Microsoft Visual Basics (second edition)

The output of c2 hooked in a default project is:


```
C3 -il "C:\Users\user\AppData\Local\Temp\VB430308" -f "Form1" -W 3 -Gy -G5 -Gs4096 -dos -Zl -Fo"C:\Users\user\Desktop\Form1.OBJ" -QIfdiv -ML -basic
```

The output of link is:


```
L1NK "C:\Users\user\Desktop\Form1.OBJ" "C:\Users\user\Desktop\Project1.OBJ" "C:\Program Files (x86)\Microsoft Visual Studio\VB98\VBAEXE6.LIB" /ENTRY:__vbaS /OUT:"C:\Users\user\Desktop\Project1.exe" /BASE:0x400000 /SUBSYSTEM:WINDOWS,4.0 /VERSION:1.0   /INCREMENTAL:NO /OPT:REF /MERGE:.rdata=.text /IGNORE:4078
```

Is it possible to keep that string format compatible?

----------


## WaynePhillipsEA

> Also on my wish list is having compile switches similar to VB.  Compile switches from Advanced Microsoft Visual Basics (second edition)
> 
> The output of c2 hooked in a default project is:
> 
> 
> ```
> C3 -il "C:\Users\user\AppData\Local\Temp\VB430308" -f "Form1" -W 3 -Gy -G5 -Gs4096 -dos -Zl -Fo"C:\Users\user\Desktop\Form1.OBJ" -QIfdiv -ML -basic
> ```
> 
> ...


Thanks for the request.   Sure, once we add command-line compilation support, we'll certainly make sure the switches match as much as possible.

----------


## WaynePhillipsEA

> I have to say how impressed I have been with twinBASIC so far.  Good work, Wayne.
> 
> Are you planning to publish a roadmap for twinBASIC - when can we expect Forms/GUI support?


Thank you very much!  Indeed, a detailed roadmap will be published in the coming weeks.

----------


## VB6 Programming

Articles about additional features in the VB6 compatible twinBASIC,
including *AndAlso*, *OrElse*, *Continue For* and *Return*.
These are additions to the VB6-compatible language and may be familiar to VB.Net users.

New syntax in twinBASIC part 1

New syntax in twinBASIC part 2

New syntax in twinBASIC part 3

----------


## wqweto

The new ternary If operator is a missed opportunity for this to compile in TB

        Dim a As Variant, b As Variant

        If(True, a, b) = 10

The point is that in C/C++ the ternary operator preserves value category (here being l-value) so that the analogous snippet works just ok.

In C/C++ this (expr ? a : b) is replaced by something like *(expr ? &a : &b) so that ternary operator works even with struct member access like this snippet

MyStruct a, b;

(true ? a : b).MyField = 5;

cheers,
</wqw>

----------


## Eduardo-

> If(True, a, b) = 10


I don't see how that could be of much use.

But instead:



```
x = If(condition, a, b)
```

similar to current IIF, but where the False part is not evaluated beforehand.

----------


## wqweto

The sample is contrived but it's used in C/C++ so it must be of some use to somebody. (To me for instance.)

The False part is not evaluated in C/C++ as well and there are no non-short-circuit logical operators in C/C++ like the And/Or debacle in VB6. Not sure there is any other language lacking short-circuit operators like VB6 to be honest. Probably only VB5. . .

cheers,
</wqw>

----------


## Eduardo-

About the ternary that you propose, I can't think where I would need that.

Also, in VB6 it can be done like this:



```
If condition Then a = 10 Else b = 10
```

But the other one, could have some uses IMO:



```
FontName = If(nFont is Nothing, "Arial", nFont.Name)
```

----------


## TTn

> About the ternary that you propose, I can't think where I would need that.
> 
> Also, in VB6 it can be done like this:
> 
> 
> 
> ```
> If condition Then a = 10 Else b = 10
> ```
> ...


If the condition is a slow synchronous function return, then it does makes sense.  In vb6, If/Else is not two conditions though?

----------


## Eduardo-

> If the condition is a slow synchronous function return, then it does makes sense.  In vb6, If/Else is not two conditions though?


Sorry, but about which one are you talking about?
The one I proposed is like IIF but short-circuited (does not evaluate both as IIF does).

The one that wqweto proposed is to assign a value to different variables (to one or the other) based on certain condition.

----------


## SearchingDataOnly

I tested twinBasic and it is really exciting.

It's of course a good thing to see that twinBasic has added some new language features. But I'm thinking about a question:
twinBasic has its own Basic language features (mainly similar to VB.NET), then Olaf's VB.Next will also have its own Basic language features, and RadBasic will also have its own Basic language features.

If this is the case, then the Basic code accepted by these three compilers cannot be unified. Maybe we should have a Basic standardization organization like ECMAScript.

----------


## wqweto

> The one that wqweto proposed is to assign a value to different variables (to one or the other) based on certain condition.


This is not new to VB6 language as an l-value "feature" -- consider Mid function vs Mid statement:

chunk = Mid$(s, 5, 10)

Mid$(s, 5, 10) = "abcdef"

Yes, Mid statement is unique but then new If ternary operator can follow.

cheers,
</wqw>

----------


## Eduardo-

> This is not new to VB6 language as an l-value "feature" -- consider Mid function vs Mid statement:
> 
> chunk = Mid$(s, 5, 10)
> 
> Mid$(s, 5, 10) = "abcdef"
> 
> Yes, Mid statement is unique but then new If ternary operator can follow.
> 
> cheers,
> </wqw>


Yes, I know.
I don't want to argue, just wonder for a real case use.

----------


## WaynePhillipsEA

> Yes, I know.
> I don't want to argue, just wonder for a real case use.


I'll be happy to consider the syntax suggested by @wqweto, though I do wonder how many developers would actually use that form.   I'll be creating a github repo just for issue tracking and feature requests in the next day or so.  Once we've got that set up, I would ask that you post your suggestion over there, and then others can comment on it before we make a decision.

BTW, twinBASIC already supports the ternary short-circuiting If() operator function in expressions.

Thanks for all the support / suggestions / bug reports so far! Much appreciated.

----------


## WaynePhillipsEA

twinBASIC issue tracking is now live at github.   We've been inundated with bug reports and feature requests from many different sources.  Going forward, it would help immensely if you could report bugs and post feature requests over at the repository which will help us better keep track and manage requests.

https://github.com/WaynePhillipsEA/twinbasic
https://github.com/WaynePhillipsEA/twinbasic/issues

Tomorrow we'll put up all the existing known issues as currently listed on the main website.  Thanks!

----------


## Schmidt

> I'll be happy to consider the syntax suggested by @wqweto, though I do wonder how many developers would actually use that form.


I actually use even VBs current IIF() kinda like that with objects 
(often when filtering into "two different baskets" like the code below shows):



```
Private Sub Form_Load()
  Dim Num, Evn As New Collection, Odd As New Collection
  
  For Num = 0 To 9
      IIf(Num Mod 2, Odd, Evn).Add Num
  Next
  
  Debug.Print vbLf; "Even Numbers: ";
  For Each Num In Evn: Debug.Print Num;: Next
  
  Debug.Print vbLf; "Odd  Numbers: ";
  For Each Num In Odd: Debug.Print Num;: Next
End Sub
```

Prints out:


```
Even Numbers:  0  2  4  6  8 
Odd  Numbers:  1  3  5  7  9
```

If there's more than two different "target-objects" to decide between... the Choose()-function can be used in a quite similar manner.

Olaf

----------


## IndicSoftware

> I tested twinBasic and it is really exciting.
> 
> It's of course a good thing to see that twinBasic has added some new language features. But I'm thinking about a question:
> twinBasic has its own Basic language features (mainly similar to VB.NET), then Olaf's VB.Next will also have its own Basic language features, and RadBasic will also have its own Basic language features.
> 
> If this is the case, then the Basic code accepted by these three compilers cannot be unified. Maybe we should have a Basic standardization organization like ECMAScript.


A good idea but actually it is not practical as there are a huge number of Basic variants in the market.

----------


## yereverluvinuncleber

> A good idea but actually it is not practical as there are a huge number of Basic variants in the market.


But surely that would help standardise and potentially reduce the number of those variants? It also makes it much easier for any developer as you can re-use the documentation and testing methodology for any version of basic following the standard. No need to rewrite the book.

A developer I know wasted huge amounts of time developing an IDE, a forms developer, a whole development environment only to fall at the last fence because he failed to understand the advantages of maintaining compatibility with the product that came before. Developers are generally bad at documentation. He did not realise that if he stood on the shoulders of giants he was much more likely to succeed. As it was, he went on a slightly different technical route which could not take advantage of all that had been achieved thus far in the past 5 years. His product was 90% complete, in parts it was very good - it failed despite that as it had no documentation, was incompatible, migration was difficult due to the technical differences and due to the massive workload he had taken on (due to the technical differences) he was unable to produce a bug free and usable product.

A BASIC standard along the ECMA methodology would be a very desirable thing to have and simply following VB6 in all its peculiarities would mean one step toward that -  no one would need to be retrained and all existing documentation and sample code/bug fixing would apply. Yet-Another-BASIC-Variant is not what we need and I applaud RADBasic in that developer's efforts to attain this or at least have it as his goal.

This was the IDE that failed. You click on the program running on your desktop, click EDIT. Full transparency of all objects, use of VBscript or .js as you desired.



It was good, at least this bit was. Closed source, dead and gone forever, no more development because he forgot what benefits standardisation brings and how compatibility is vital.

----------


## Krool

If TwinBasic claims to be VBA/VB6 compatible at the end than this is "enough standards" and all pluses what come on top does not need to be synced with other basic variants. IMO

----------


## Eduardo-

Is there somewhere a list of all new features introduced to tB now?
I was about to open an "issue", but didn't want to suggest something already supported.

Also, should they be things only related to the language itself, or can they be also suggestions regarding forms and features that are not currently developed?

----------


## Krool

I hope WaynePhillipsEA will not get distracted too much by too many "side-wishes" and will still focus on the core to make prio for compatibility.

----------


## WaynePhillipsEA

> I hope WaynePhillipsEA will not get distracted too much by too many "side-wishes" and will still focus on the core to make prio for compatibility.


Don't worry, back compatibility is the #1 priority.  I'm not planning any major new features for a little while until we've put the bulk of the remaining missing features in place over the next couple of weeks.

----------


## WaynePhillipsEA

> Is there somewhere a list of all new features introduced to tB now?
> I was about to open an "issue", but didn't want to suggest something already supported.
> 
> Also, should they be things only related to the language itself, or can they be also suggestions regarding forms and features that are not currently developed?


The list of features under 'Compiler Features' on the main homepage (twinbasic.com) is the most thorough list of features for now until the documentation is complete.

Please do come over and post any requests on the github page any time you like.  Everyone here is welcome to come over, and the more people we can get involved in the discussions will help shape the future of the product.

https://github.com/WaynePhillipsEA/twinbasic/issues

I certainly don't mind if the issues you raise relate to something not yet implemented... I'll just label them as such, ready to look at when we get to that stage.

----------


## Eduardo-

OK, thank you for the clarifications.

----------


## VB6 Programming

twinBASIC's 100% Compatibility Goal...

"twinBASIC is a modern version of the classic BASIC programming language.  With twinBASIC we aim for 100% backwards compatibility with existing VB6 and VBA projects."

twinBASIC's 100% Compatibility Goal

----------


## VB6 Programming

Good to see there have been 222 downloads of the twinBASIC preview.

Edit:  Now 230 downloads

----------


## yokesee

To be a first version, it works a lot better than I expected,
Great work tb.

----------


## VB6 Programming

> To be a first version, it works a lot better than I expected,
> Great work tb.


I'm very impressed too.  Great compatibility with the VB6 language.  There is still a lot to be done, I'm looking forward to Forms/GUI support being added, and the automatic migration from VB6.

----------


## VB6 Programming

Slides of the Access DevCon twinBASIC presentation twinBASIC slides

and some other twinBASIC links https://nolongerset.com/devcon-2021/

There have been over 250 downloads of the twinBASIC Developer Preview twinBASIC Developer Preview installation guide

----------


## VB6 Programming

twinBASIC Preview release 0.9.2021 out now.  

This release adds late-bound support to twinBASIC classes, which in turn fixes many other issues such as WithEvents support.

----------


## xiaoyao

> Just spotted this, I'm a long-time contributer to the Rubberduck extension - Wayne has contributed some of the most complex, ingenious code to the project, deep inside the internals of VB. I'm quite sure this is real, and I'm really looking forward to seeing it.


do you test twinbasic?

----------


## mansellan

Yes, been testing since before the first public preview. I've contributed to a bunch of the feature requests on the project's GitHib project. There's more to do (not least of which is forms support), but it's progressing swiftly.

----------


## VB6 Programming

Olaf Schmidt's vbRichClient on twinBASIC

----------


## yokesee

I have the following problem.
the list of com I get empty
I only have OLE Automation V2
It does not let me select any reference.
a greeting

----------


## VB6 Programming

> I have the following problem.
> the list of com I get empty
> I only have OLE Automation V2
> It does not let me select any reference.
> a greeting
> [/img]


Have you registered RC6.dll and RC6Widgets.dll?



> For those who want to run the code, before you start:
> 
> the newest RC6-Version 6.0.8 needs to be downloaded
> unzipped into a Folder of your choice
> and then *RC6.dll and RC6Widgets.dll need to be registered* (e.g. via the 2 little install-scripts in the Package)


See the instructions here

----------


## WaynePhillipsEA

> I have the following problem.
> the list of com I get empty
> I only have OLE Automation V2
> It does not let me select any reference.
> a greeting


Hi!   This is a bug.   Could you possibly open up an issue over at GitHub so that we can investigate?
https://github.com/WaynePhillipsEA/twinbasic/issues

Thanks!

----------


## vbrad

> Hi!   This is a bug.   Could you possibly open up an issue over at GitHub so that we can investigate?
> https://github.com/WaynePhillipsEA/twinbasic/issues
> 
> Thanks!


Good on you Wayne, class response.

----------


## yokesee

Thank you .
In a virtual machine VSCODE and RC6, it worked perfectly.
It may be a problem with my vscode installation
good team Vbbrichclient  TwinBasic  :Smilie: 
a greeting

----------


## camomille

The clock with RC6 works perfectly.

Only to check compatibility
the RC6BaseDlls folder is placed in the workspace next to the Build folder with recording of the 2 .vbs

Also based on RC6, an equally convincing RecordSet test :

Modifications :

vbLeftJustify, vbRightJustify, vbCenter not recognized, replace respectively with 0,1,2
Static replace by Dim in cfMain Class
App.Path replace by absolute address "C:\...\..."

----------


## baka

if RC6 could be added to the project without the need to register the dll, as u can just put them in the same folder as the compiled .exe that could be what I need to start using RC.

----------


## SearchingDataOnly

> if RC6 could be added to the project without the need to register the dll, as u can just put them in the same folder as the compiled .exe that could be what I need to start using RC.


RC5/RC6 has always been doing what you expect (no need to register DLLs), but you always close your eyes and cover your ears.

https://www.vbforums.com/showthread....=1#post5443031

----------


## baka

no, I can't make RC to work. I can't add it to the references, it gives me errors. I have told about this numerous times. no matter what Im doing I can't add to references, so its impossible to use.

----------


## Schmidt

> no, I can't make RC to work. I can't add it to the references, it gives me errors.


That might happen, if you didn't keep the Dlls from the zipped packages together in their "unzipped Folder-location".

Perhaps make another attempt with the RC6BaseDlls.zip-Download?
- unpack it to C:\RC6\
- now go into that Folder (and don't move any Files away from each other, leave them sitting there together, as they are)
- if you have an OS higher than XP, then it should be sufficient, to just DblClick the two *.vbs Files for registering

If you don't like the registering via *.vbs Files, then you can of course do the registering also manually:
- by opening a console in *admin*-mode
- and then typing: regsvr32 C:\RC6\RC6.dll (and regsvr32 C:\RC6\RC6Widgets.dll respectively)

Now you should see two new (errorfree selectable) entries in your VB6-IDEs References-Dialog:
- RC6
- RC6Widgets

Cannot imagine, that this works for hundreds of Users, but not on your machine
(other than, that you possibly do not run your VB6-IDE elevated? ... or have some "weird AddIn" loaded?).

Olaf

----------


## VB6 Programming

Weekly update on the status of twinBASIC:

twinBASIC status update

----------


## Eduardo-

> Weekly update on the status of twinBASIC:
> 
> twinBASIC status update


Thanks.

----------


## VB6 Programming

*twinBASIC Roadmap/Priorities* - twinBASIC are asking for our views on what should be the development priorities for the twinBASIC language.

twinBASIC Roadmap

----------


## SearchingDataOnly

Both twinBasic and RADBasic are products that are worth looking forward to, but I don't know when twinBasic will stabilize in the language syntax and become a product that can be used in practice.

I have a suggestion, which is:
(1) List all the features of VB.NET, and then discuss which features should be added to twinBasic.
(2) In addition to the features of VB.NET, organize a list of extended features, and then discuss which features should be added to twinBasic.
(3) Implement (1) as the main plan, and implement (2) as the auxiliary plan (future expansion plan)

RADBasic can also take a similar approach.

----------


## baka

as for me, what I would like twinbasic to be is, example:

- we do this in VB6 because theres no built-in function that can do it, example subclassing the mouse wheel.
twinbasic should instead give us a built-in alternative so we dont need to subclass again.

- same as before, is "the usual API", like get width/height in pixel and all the trouble with DPI etc.
twinbasic should have a built-in alternative so we dont need to deal with that again.

- a more robust graphic rendering that is following the monitor sync. so, all the graphic methods, that "draw", will actually draw into a memory buffer, and when monitor sync, it will draw "everything" in one go. (like we have with direct2d, I draw everything but not until I use "EndDraw" it will actually show. this will allow flicker-free drawing/animation.

so, instead of adding VB.NET features, VB6 can be upgraded first, by looking at every aspect that are lacking or where we need to do lots o "tricks" to go around a problem, twinbasic should give us an alternative.

----------


## xiaoyao

Can the grammar check function expose the interface? I am developing a small VB6 IDE, using VB6, VBS, JAVASCRIPT as the code to run


Features:
- Unicode enabled.
- 32 bit and 64 bit versions.
- High DPI aware for any monitor resolution.
- Language localization. Simple create language file based on English.lang file.
- Localized for 11 languages.
- Projects and non-project based editing.
- Easy integration of Console or GUI based code.
- Incremental compiling of code defined as a "module".
- Easy including of Windows Resource files simply by specifying which source code file is the resource.
- Seamless integration of the  Compiler (both 32 bit and 64 bit).
- Codetip popups and auto completion.
- Built in Visual Designer.

----------


## xiaoyao

> as for me, what I would like twinbasic to be is, example:
> 
> - we do this in VB6 because theres no built-in function that can do it, example subclassing the mouse wheel.
> twinbasic should instead give us a built-in alternative so we dont need to subclass again.
> 
> - same as before, is "the usual API", like get width/height in pixel and all the trouble with DPI etc.
> twinbasic should have a built-in alternative so we dont need to deal with that again.
> 
> - a more robust graphic rendering that is following the monitor sync. so, all the graphic methods, that "draw", will actually draw into a memory buffer, and when monitor sync, it will draw "everything" in one go. (like we have with direct2d, I draw everything but not until I use "EndDraw" it will actually show. this will allow flicker-free drawing/animation.
> ...


It would be better to develop a VB6 plug-in package (add in), which can allow many VB6 users to switch over to use your software.
The plug-in is just a DLL, and installing your programming IDE may require hundreds of megabytes of space

Develop a VB6 plug-in program for free, which can train more users and let them try some new features.

----------


## Schmidt

> as for me, what I would like twinbasic to be is, example:
> 
> - we do this in VB6 because theres no built-in function that can do it, example subclassing the mouse wheel.
> twinbasic should instead give us a built-in alternative so we dont need to subclass again.
> 
> - same as before, is "the usual API", like get width/height in pixel and all the trouble with DPI etc.
> twinbasic should have a built-in alternative so we dont need to deal with that again.
> 
> - a more robust graphic rendering that is following the monitor sync. so, all the graphic methods, that "draw", will actually draw into a memory buffer, and when monitor sync, it will draw "everything" in one go. (like we have with direct2d, I draw everything but not until I use "EndDraw" it will actually show. this will allow flicker-free drawing/animation.
> ...


TwinBasic (as a compiler, a "language") is not responsible to solve your points above.
All it needs to focus on is, to provide the ability to compile VB6 *.cls and *.bas modules (as they are) - 
later on also providing support, to achieve that feat also on other platforms - but nothing more (especially that latter part is harder than it seems).

Every single one of your points above, can then be solved:
- in a "twinBasic accompanying "Class-Framework with enhanced Drawing- and GUI-support"
- ideally written in twinBasic (or VB6 *.cls or *.bas modules only, to which twinBasic is compatible)
- furthermore, that new Class-Framework should work platform-independent (using no Direct2D, no DirectX, no GDI32, no GDIPlus underneath)
- ideal would be, when you could already start using that framework now, directly in VB6 (to gather experience with it)
- it'd also be nice, when that framework would allow, to solve the same problems you formerly solved with GDIPlus etc., in less lines of code
- it'd also be nice, when the Class-framework itself would be implemented efficiently (binaries significantly smaller than .NET, QT, GTK+)

Now wait,... we have that already...  :Wink: 

Well, here I'm kinda thankful, that with twinBasic - it now becomes more and more clear what I was aiming at with the RC5/RC6 ClassLib...
TwinBasic simply providing somewhat earlier "the yet missing part" (I nevertheless continue to work on).

Olaf

----------


## Eduardo-

I don't think that's the (only) aim of tB.
The aim is to support forms, usercontrols and property pages. It aims to be backward compatible with existent VB6 projects.
So far it only supports bas and class modules because that was the first step (and I think the "easier" part), but it doesn't stop there.

----------


## Schmidt

> I don't think that's the (only) aim of tB.


I'm not yet sure, what kind of concept Wayne plans with regards to:
"VB6-compatible GUI support in an extended tB-Runtime-Lib".

I seriously hope, that he doesn't plan to "re-invent, what's already there".
(especially not, since doing so, would require an additional amount of about 3 man-years on his end).

Therefore I think, that he plans to develop this GUI-support in a "Web-based fashion".
(the existence of his little WebServer-Addon, tB currently ships with, is an indicator for that -
and also his existing experience with his current GUI-Outputs in the context of VSCode - which works WebBased (NodeJS+Electron-like) as well.

If that is the case, then our efforts with regards to GUI-support will not overlap at all:
- the RC6-lib providing a "classic, Desktop-based UserControl/Widget-concept" (able to import VB *.frm, *.frx, *.ctl, *.ctx)
- tB-GUI-RTLib providing a "Web-based (Chromium-based) UserControl/Widget-concept" (able to import VB *.frm, *.frx, *.ctl, *.ctx)




> The aim is to support forms, usercontrols and property pages. 
> It aims to be backward compatible with existent VB6 projects.
> So far it only supports bas and class modules ...


Both of the GUI-concepts I've just mentioned above, can be implemented with only "plain *.cls and *.bas support" at compiler-level.
(it's both "Class-library-stuff" - and not the concern of a given compiler).

And as said - both concepts can be brought to a point (quite *easily*), where you're later be able to:
- also import existing *.frm and *.ctl files (because they're both essentially "Class-definitions" underneath, with a bit of Control- and Positioning-Infos "on top")
- which would then work (exactly as they formerly did in VB6) with RC6-Desktop-Widget-mappings, or tB-WebWidget-mappings
- with the advantage, that thusly imported *.frm and *.ctl files, would work also on other platforms like Android or Linux 
- either in Desktop-Widget-mode - or in "BrowserControl-based mode", Electron-like 

If you'd be willing, I could explain (and demonstrate) these necessary import- transform-steps (to RC6-Forms and RC6-Widgets),
based on a simple VB6-TestForm, which uses a simple UserControl you've written (e.g. your "advanced Shape-Control").

Olaf

----------


## Eduardo-

I don't know what he's doing and what ideas he has in mind, I only hope that he don't get misguided by wrong ideas.

About yourself: I think you already got what you needed (a compiler for bas and cls), you can write yourself your usercontrols and forms importer in RC, you don't need for Wayne to do anything else, only cross platform compilation is currently missing for you.
You can do you own "Basic" or "VB6 replacement" from what you have now.

----------


## Schmidt

> I don't know what he's doing and what ideas he has in mind, I only hope that he don't get misguided by wrong ideas.


I sure hope so as well...  :Wink: 

I consider anything which would introduce ActiveX or OCX-stuff into a platform-independently planned compiler, as "the wrong idea".

Any such "MS-dependency-heavy" stuff should not be part in the "official RuntimeLib" of a platform-independent compiler, 
and instead be developed as a "side-project" (preferrably by those who need that).




> About yourself: I think you already got what you needed...


If that's the way you think about all the current ongoing efforts, it cannot be helped...

Eduardo, you have to realize, that there's guys out there who have a vision - 
(and who don't think about "satisfying personal needs").

As for my vision with all my ongoing efforts... 
It is to ensure a (long-term) future for VB6 - and I seriously hope, that Wayne is sharing that vision...
(a future, 100% compatible *Visual* Basic simply cannot be restricted to "Windows-only" in the visual department... no way!).

Your vision seems to be:
Let others do all the hard work - I'm not going to invest any of my precious time...
I just want to re-compile "my old stuff" as a 64Bit-executable (on Windows-only) and be done with it.

Well, and that's not really "community-spirit at its best", you know...

I also don't know, why you have absolutely no interest in learning about,
how exactly your current investments into old controls, your old "visual stuff" -
could be brought onto a platform-independently working GUI-platform without too much efforts.

Going "platform-independent GUI" does not mean at all, that existing investments into "*.frm or *.ctl" are lost.

Olaf

----------


## Eduardo-

That's why I said that I hope that Wayne doesn't get not influenced by wrong ideas.

As for efforts, I offer whatever I could do to achieve backward compatibility, that I believe is the key to success of a (true, not fake) VB6 replacement.
I first need to be asked to do something.
By the time being I made a Component Documenter, not so much thinking in VB6 components that are few these days, but thinking in new components (or existing, migrated) for tB and RB.

So, no. The one following a personal agenda is perhaps you.
What are you planning to do with your RC6 anyway? Do you want to be famous? Are you planning to get money? I don't understand your fixation with that component. Allow other people to do *something better*.

As for "learning new things", in case that you are talking about your RC6, you already got my answer many times: I'm not interested.

And every time you try to push others into the adoption of your personal project in a Jehovah Witness way, you get people more and more away (OK, some get in, as some convert to be Jehovah Witness too).

I just wonder how long your "friendship" with Wayne will last.

And BTW, I wonder who set up those fake GitHub accounts to present issues related to RC6 in the tB section.

The only relationship that success with you is of the master-slave, like with SDO (DM).

----------


## Schmidt

> That's why I said that I hope that Wayne doesn't get not influenced by wrong ideas.


I've known exactly what you meant with "the wrong idea", already the first time.

But that doen't make it "the wrong idea".
Keeping up the platform-independent support not only in the compiler, but also in the supporting "official runtime" which comes with it, is absolutely the right idea.




> So, no. The one following a personal agenda is perhaps you.


I've already explained "my agenda" - it's bringing a *Visual* Basic into the new age.

Any new language which wants to be successful in the long-run, has to be platform-independent.
And a "special language", which focuses on "being more visual than others", 
has to ensure that platform-independence also in its accompanying runtime-lib.




> What are you planning to do with your RC6 anyway? 
> Do you want to be famous? Are you planning to get money?


Why do you ask this nonsense?
I'm providing (and maintaining) the framework at no costs for over a decade now (so, "money-making with the RC" is ruled out already)
And I will keep my promise, to open everything up under LGPL as soon as "my vision" is reached
(when VB6-Code will run 1:1 on Win *and* Linux or other non-windows-platforms - but not before).




> I don't understand your fixation with that component.


That's perhaps because you still don't understand why it is necessary 
(to achieve the goal of platform-independently running *Visual* Basic Code)




> Allow other people to do *something better*.


Well, the *absolute best* would be, when VB6-Projects:
- could be simply imported (without requiring you, to change a single line - not even in *.frm and *.ctl parts)
- and after that will run (as 64Bit-compiled binaries) on Windows *and* Linux

Can this "absolute best" outcome be achieved by using the RC6-lib?
Absolutely.

Would a new Form-Designer (or other parts not covered currently by tB+VSCode) -
require more coding-efforts, compared to e.g. an "ActiveX/OCX-based, WinOnly-supporting  Form-Designer"?
No, it would require less efforts.




> As for "learning new things", in case that you are talking about your RC6, 
> you already got my answer many times: I'm not interested.


I know that already - but that doesn't mean I will refrain from commenting when you post stuff I absolutely disagree with
(like e.g. your strong preferrence of a "Win-only" VB-successor).




> And every time you try to push others into the adoption of your personal project in a Jehovah Witness way, you get people more and more away (OK, some get in, as some convert to be Jehovah Witness too).


You got that entirely wrong - I'm primarily a tech-nerd (religious striving is sooo not my thing...).

From your responses it is obvious, that the purpose (and necessity) of a lib like the RC5/6 is still not understood by you
(nor is it understood by the majority of the remaining community... most of the guys with the capabilities to understand, have "migrated" long ago).




> I just wonder how long your "friendship" with Wayne will last.


Why you're getting personal now, I have no idea.
But nope, there's no such thing as a friendship at the moment - only mutual respect, I hope.




> And BTW, I wonder who set up those fake GitHub accounts to present issues related to RC6 in the tB section.


How low can you get in your thought-processes?

Do you mean the "Mo-Lo" account?
If that's the case, then I have a slight inkling who it might be - but will leave it to himself, to reveal his Forum-identity here...




> The only relationship that success with you is of the master-slave, like with SDO (DM).


Can you cut out this nonsense, please?
I've mentioned it already several times (in different threads), 
that I feel extremely uncomfortable with any kind of "hero worship"...

Olaf

----------


## Eduardo-

I don't think it is "low" to notify the other when someone is trying to take you as a fool.
But whatever, I don't care anyway the quality of what you do.

About wanted a Windows-only successor, it is another lie from you.
I already said how I thought it would have to be, but anyway I'm not the designer, so it is no my decision. And I right now I don't have the time to search for it (I have to do something else at the moment), may be later (or never).

----------


## Schmidt

> I don't think it is "low" to notify the other when someone is trying to take you as a fool.


Are you still onto the topic of that "Mo-Lo" account who's posting in the tB-issue-section on GitHub?

What did you not understand in my reply, that it wasn't me who created this account.
It's you who's acting like a fool (seeing "ghost-accounts" where there aren't any).




> But whatever, I don't care anyway the quality of what you do.


???  
Is it you, xiaoyao?  :Wink: 




> About wanted a Windows-only successor, it is another lie from you.


Yeah - you want a lot of things (without having the slightest clue, how GUI-support like that has to be implemented, 
to *not* be restricted to "win-only" (and the consequences and compromises which result from these technical implementation-necessities).




> I already said how I thought it would have to be, ...


Making "wishes" with regards to "how you'd prefer GUI-support to look like" is one thing...
Another thing entirely, whether "such a wish" is technically considered feasible 
(in the eyes of the ones who possess the required knowledge, to implement such a platform-independent GUI).

Olaf

----------


## Eduardo-

I think that I understand better than you what the options are and what is technically required for each one (and the constraints of each option). But I don't have to prove anything to anybody, less to you.

And no, Mo-Lo *is not the only* account I wonder who made it.
But who cares anyway, strange things happen all the time.

----------


## yereverluvinuncleber

Alright you chaps, break it up, haven't you got wives and children to go home to?

That's enough fighting for tonight. Time to go home and get to bed, up again tomorrow, bright and early then we can all smile again and be one happy family.

----------


## Krool

If tB aims to be 100% VB6 compatible I wonder how does it work to have an "independent" GUI framework that is not based on the..
window classes to emulate VBThunderForm and more..
window classes to replicate intrinsic controls etc.

So, there must be a "legacy" version which will work on windows only.

----------


## baka

Schmidt/Olaf

that is my "vision", of what "I" like it to be.
you say its not responsible to do what I would like, but on the other hand I could say "why not".
is twinbasic just a 100% compatible vb6 and thats it? 
SearchingDataOnly wants more features from VB.NET. that could also be said, "its not responsible", u need to work with that u have, instead of "upgrading" it, as you seems to not want that.

you want your RC6 to be used as the "magic" component that we can use to "please" our needs.
that for me is also making u bias to it and of course critical to anything that could replace it or compete with your RC6.

my requests will make your RC6 obsolete, as I only need a good and stable render-method as everything else VB6 is enough for my needs.
I think you are scared that twinbasic will have it all and make your effort wasted.
that is also why I posted about integrate RC into twinbasic, as that would make me more interested and maybe even use it. 
but it need to be integrated in a way that it will feel "right", VB6-right. not Olaf-right. 
but again as always, the post I made about integration I didnt get a good response, instead I need to knee down and praise and just accept that Im a lower species.
that is also one reason I dont use RC, because of the way you treat others. to get respect you also need to give respect. if you piss on others, others will piss on you.

----------


## Schmidt

> If tB aims to be 100% VB6 compatible I wonder how does it work to have an "independent" GUI framework that is not based on the..
> window classes to emulate VBThunderForm and more..
> window classes to replicate intrinsic controls etc.
> 
> So, there must be a "legacy" version which will work on windows only.


That's not, how I understand the "100% goal".

I understand it as "the *language* being 100% VB6-compatible" - and I think that goal is absolutely achievable
(even for a VB6-compatible compiler which supports and works on other platforms).

IMO, as soon as *.cls and *.bas modules work, the 100% goal is already fully reached.

What more do you expect from the author of the compiler?

That he replicates each and every OCX which was ever produced in the last 25 years?
(so that any imaginable *.frm code imports without the slightest hickup?)
It's an impossible task - somewhere you have to draw a line...

All I can imagine as a "reasonable effort for the runtime, regarding GUI", is the support for the intrinsics:
TextBox, CommandButton, ListBox, ComboBox, Image, PictureBox, Frame, Timer, etc... because those are "simple enough" - but not much more.
And I would suggest, that the hWnd and hDC props of these Intrinsics, should be marked "deprecated" as well 
(so that there's at least the chance to write different implementations for the intrinsic-abstraction-layer when it is used on other platforms).

Because when you have a platform-independent compiler (and GUI), one is well-advised,
to use Win32-APIs as "sparsely as possible" (including the "SubClassing" everyone loves so much).

Stuff like that should not make it into the runtime-lib of such a compiler 
(just my personal opinion, though Wayne might have a different stance on that).

Why is that so important?
Because of "protection of Code-Investments" (primarily the ones, which are about to be written in *tB*-Code).

Because *if* system-specific stuff would be supported in the official runtime, it'd send "the wrong signal" - 
in that it encourages users (who don't know better), to write a ton of platform-specific code without realizing it...
who then start "blaming the tool" (as soon as they realize, that they have to rewrite it *completely* - to be able to run it on non-windows-systems).

Olaf

----------


## Shaggy Hiker

Enough with the bickering.

----------


## Schmidt

> the post I made about integration I didnt get a  good response, 
> instead I need to knee down and praise and just accept  that Im a lower species.


In the posting you probably mean (#152?), I've gone to some length' to explain what's:
- the responsibility of a compiler
- and what's better addressed by (Class)Libraries (no matter if a "runtime-lib" or an "external one")
- and continued to describe, how the RC6 would address concrete issues, mentioned in your citation

If you felt offended by a purely technical explanation (can't find anything in that post, where I "got personal" with you), then I cannot help it...




> it need to be integrated in a way that it will feel "right", VB6-right. not Olaf-right.


And here *you* go, getting personal... (instead of searching a technical discourse with me,
for example by clearly describing what exactly you mean with the term: "VB6-right").

I also don't know, what you mean with "Olaf-right" exactly, because (according to your own words) - 
you've never used the RC5/RC6 (or any RC-related code, written "by Olaf") in your own apps so far.

Olaf

----------


## TTn

Krool, it may be possible to access/run-on apple hardware with an alternate Windows boot shell.  I think that is supported until at least 2029, but you have to use an older version of Windows to setup, because they removed the ability in the control panel.  I'm running a Samsung T5 with alternate boot setup on it, utilizing the Windows Enterprise image.  The student edition also works if you have a license for that.  Does anyone have any experience running on non-windows hardware like that?

EDIT: Video showing secure desktop shell running in tandem.
https://www.youtube.com/watch?v=9eQ1D0yeN5c

----------


## Schmidt

> Enough with the bickering.


Ok, the "bickering-posts" are gone ... (including mine).

JFYI, you were probably unaware, but a youtube-link to "Jordan Peterson" vanished along with them into the gutter.
(can already feel unimaginable amounts of "Karma" building up)...  :Wink: 

Olaf

----------


## Shaggy Hiker

I don't know who that is. Does karma build up on unrecognized side effects?

----------


## vbrad

> That's not, how I understand the "100% goal".
> 
> I understand it as "the *language* being 100% VB6-compatible" - and I think that goal is absolutely achievable
> (even for a VB6-compatible compiler which supports and works on other platforms).
> 
> IMO, as soon as *.cls and *.bas modules work, the 100% goal is already fully reached.
> 
> 
> Olaf


hi Olaf
but it says on the TwinBasic website:




> Once we have finalized and fixed up any bugs in the first release of twinBASIC, we will be focusing on three key areas over the coming weeks and months:
> 
>     Forms / GUI support, including *full backwards compatibility with existing VB6 forms*.
>     Native compilation.
>     Cross-platform compilation.


In my reading of it that sounds like he's going to support forms as clearly as he does modules and classes?
(But actually I'd be perfectly happy if instead of a windows form my gui appeared in a browser window.)

----------


## Schmidt

> I don't know who that is. Does karma build up on unrecognized side effects?


Absolutely! That's the worst kind...

----------


## Schmidt

> hi Olaf
> but it says on the TwinBasic website:
> 
> 
> 
> 
> 
> 			
> 				Forms / GUI support, including *full backwards compatibility with existing VB6 forms*.
> ...


I guess we will see, what exactly Wayne meant with that...  :Wink: 

And as said 100% compatibility at language (compiler-) level can certainly be achieved,
(even down to the pointer and struct-level, when the Variant-, BSTR, SafeArray allocations, and VBClass-VTables are kept identical, which the tB-author already did care of AFAIK).

Another matter entirely are "Forms" (and Controls).
Just think about it yourself for a bit.

E.g. when you have a Form with an MSHFlexgrid on it...
Then the only way to run this Form "fully compatible in tB" is: to load the original MSHFlexGrid, period.

If you resort to doing that (as the author of that kind of "import-mode", then (IMO) - you send the wrong signal:
- because this imported tB-Project (which contains this Form) will never work on other platforms
- and because this Form (with that HFlexGrid from MS) can only work as long as MS supports the 32Bit-mode

But isn't that latter point exactly, why most users here plan to switch from VB6 to tB?
(protection for your code, when MS decides to ship a "64Bit-only Win-OS")

See, this mode (loading an existing OCX, which exists only in a 32bit version) is basically pointless to be supported by tB - because: 
It will only work as long as the OS ships with a 32bit layer - and it will fail as soon as the OS ships in "64bit only".

But wait, the above sentence is true also for your existing VB6-compiled App... (it will work, as long as MS ships the OS with a 32bit layer).
So why trying to import this "old App, with the old 32Bit only OCX on your Form" into tB in the first place?

So, a "worthwhile Form-importer" (one that will not choke, when MS switches to 64bit only mode),
can only be accomplished for: 
- a limited set of selfwritten Controls/Widgets in a tB-provided or external GUI-lib 
- for which "mappings" exist in the Loader-mechanism of the targeted "new Form-Engine"

Note the word "limited" in the above point...
You simply cannot expect, that 100% compatible Widget- or Control-wrappers will be written for each and every 32bit OCX which floats around in the wild (in old, still working VB6-Apps).

To conclude:
- "100% at language-level"? ... absolutely possible - even for VB6-code on other platforms
- "100% at Form+Control-level"? ... only possible for a (comparably small) SubSet of the Controls, currently used in existing VB6-Projects

And the thing with that "SubSet of Controls", for which compatible Wrappers have to be implemented is,
that the efforts for:
- writing them already platform-independent (able to work on Win and Linux, in both, 32bit and 64bit mode)
- writing them "Win only" (with the goal to achieve 64Bit-compatibility on Win-only) 
are about the same (well, less when these Widgets were written, based on the RC6).

Exactly that topic is a "hard decision" to make for any "provider of a new IDE", 
because you will cause "disagreement in either case".

What might help in this regard is, to "look at it long-term" again (the "vision" the author of a new language and IDE has in mind)...

If a given author decides, to make a dozen of old VB6-devs happy with "Win-only GUI and Controls"-support
he's risking loosing hundreds, if not thousands of younger devs, who will ignore your tool, because of "Win-only" - 
and the same "Win-only" reason will affect the Tiobe-ranking as well.

That's (IMO) the classic "shooting yourself in the foot"-scenario, because "making this small group happy" -
will be even more pointless, when the author later (in 2031) realizes, that it was all for nothing, because "VB6-compiled 32bit Apps still work".

HTH

Olaf

----------


## Krool

I think tB will make a lot of people happy who use 64 bit VBA. Those guys "stick" already to Windows so the mantra of cross-platform is not that crucial.
It will help to create add-ins for MS office and allows displaying forms.
And finally it will encourage to finally solve the all time 64bit OCX issue by porting UserControls to tB which then runs on 64 bit host systems, such as VBA.
This is a great niche.

----------


## vbrad

> E.g. when you have a Form with an MSHFlexgrid on it...
> Then the only way to run this Form "fully compatible in tB" is: to load the original MSHFlexGrid, period.
> 
> If you resort to doing that (as the author of that kind of "import-mode", then (IMO) - you send the wrong signal:
> - because this imported tB-Project (which contains this Form) will never work on other platforms
> - and because this Form (with that HFlexGrid from MS) can only work as long as MS supports the 32Bit-mode
> 
> But isn't that latter point exactly, why most users here plan to switch from VB6 to tB?
> (protection for your code, when MS decides to ship a "64Bit-only Win-OS")
> ...


So TwinBasic will not offer a path for projects containing all but a few controls?
That would make it uninteresting for a lot of people who rely on grids a lot for example.
I was hoping for at least support for all the built in controls and then for some others,
of of these MSHFlexgrid would be one that is very widely used for business applications.

----------


## Arnoutdv

@VBRad, if it needs to be 100% compatible with VB6 then you can stick with VB6.

If you want to target 64bit you need to make a choice, you can't have both worlds when only the 64 bit world is supported by the OS.

----------


## Thierry69

In my case except 1 control I use (and OCX exists also in 64 bits), all are 100% written in VB6, so just recompilation for 64 bits.

----------


## vbrad

> In my case except 1 control I use (and OCX exists also in 64 bits), all are 100% written in VB6, so just recompilation for 64 bits.


Unless doesn't support all built in controls?

----------


## yereverluvinuncleber

Krool, Are you willing to speculate whether your controls are likely to operate on TwinBasic/RADBasic from what you've seen so far? Or is there something that makes you feel pessimistic.

How many of your own controls work without making some use of a Windows API? I expect the majority use at least one. I obviously haven't delved deep into your code.

----------


## Krool

> Krool, Are you willing to speculate whether your controls are likely to operate on TwinBasic/RADBasic from what you've seen so far? Or is there something that makes you feel pessimistic.
> 
> How many of your own controls work without making some use of a Windows API? I expect the majority use at least one. I obviously haven't delved deep into your code.


AFAIK, twinBASIC will use for the "windows version" anyway certain MS APIs for it's runtime (oleauth etc.) to be compatible. Maybe Wayne can comment on this.

To your question:
VBCCR is heavily windows based as these classes are windows only. VBFlexGrid uses GDI for drawing, so you can say it's also "windows".

So will tB allow me some day to port these? So they get 64bit support? I don't know.

Would it be worth? IMO yes, businesses use heavily MS office products with a 64 bit COM host system. (VBA)

----------


## Arnoutdv

> To your question:
> VBCCR is heavily windows based as these classes are windows only. VBFlexGrid uses GDI for drawing, so you can say it's also "windows".
> 
> So will tB allow me some day to port these? So they get 64bit support? I don't know.
> 
> Would it be worth? IMO yes, businesses use heavily MS office products with a 64 bit COM host system. (VBA)


But making them Cross Platform requires a complete new development.
That's why I think the focus on Cross Platform should only be done for new projects, not for existing projects which rely on external OCX components or even Office Automation

----------


## VB6 Programming

Without wishing to get involved in the bickering, I'd suggest posters look at what twinBASIC have already said...




> Once we have finalized and fixed up any bugs in the first release of twinBASIC, we will be focusing on three key areas over the coming weeks and months:
> Forms / GUI support, including full backwards compatibility with existing VB6 forms.Native compilation.Cross-platform compilation.


https://twinbasic.com/

and




> when it comes to cross-platform, the feature set will indeed have to be much more limited. Certainly no GDI/direct2d/etc, as you'd be better off running under WINE for such things.


https://www.vbforums.com/showthread....t=#post5515954

----------


## axisdj

on the point of cross platform.

Speaking from experience, I have ported a vb6 app to macos using lazarus.

many of my controls including the flexgrid did port with minimal intervention.

I think cross platform can be achieved, but for most projects that will require some manual changes to port to cross platform user controls

I do not think its a show stopper at all.

added later:

to completely say it has to be one or the other is bad. if it initially works just in windows and then takes a few days/weeks to make it work on a another platform is fine and acceptable.

----------


## vbrad

> on the point of cross platform.
> 
> Speaking from experience, I have ported a vb6 app to macos using lazarus.
> 
> many of my controls including the flexgrid did port with minimal intervention.
> 
> I think cross platform can be achieved, but for most projects that will require some manual changes to port to cross platform user controls
> 
> I do not think its a show stopper at all.
> ...


Hi axisdj
This is very interesting. I'd like to hear what you think of Lazarus after such a project. Are you impressed or disappointed? I spent a little time experimenting in Lazarus There are a couple of grids
built in there as I remember but they seemed very limited in functionality compared to the MSFlexgrid. How did you overcome that?

----------


## TTn

> So will tB allow me some day to port these? So they get 64bit support? I don't know.
> Would it be worth? IMO yes, businesses use heavily MS office products with a 64 bit COM host system. (VBA)


Another idea would be to use an interop hybrid control set that utilizes VB.NET user controls as individual control types.
This already works in VBA with the interop toolkit.  With cross-addin vb6/vba support, almost anything can be achieved in the future for business applications.

I wonder if TB will support VB.NET user controls, or the hybrid interop user controls?

----------


## SearchingDataOnly

> VBCCR is heavily windows based as these classes are windows only. VBFlexGrid uses GDI for drawing, so you can say it's also "windows".
> 
> So will tB allow me some day to port these? So they get 64bit support? I don't know.
> 
> Would it be worth? IMO yes, businesses use heavily MS office products with a 64 bit COM host system. (VBA)


A few years ago, I developed an extremely powerful Spread with pure VB6, and later I used Cairo (you know what it is) to completely rewrite my Spread, which perfectly implemented/simulated all the features of the original Spread (to be precise, more features have been added). 

In other words, you can use Cairo to rewrite all the controls in your VBCCR without any problems. The interfaces of the new control are exactly the same as your VBCCR. After you rewrite your VBCCR with Cairo, I believe it can become a cross-platform product. If you need help, I can help you. I believe that other real Cairo experts here will also support and help you vigorously.

Note:
I dare not mention the VB framework related to Cario, because some of the dark forces here are too strong.

----------


## VB6 Programming

Here is the latest update on the status of the twinBASIC preview...

twinbasic weekly update

----------


## SearchingDataOnly

It's an art to maximize the functionality of a programming language through minimal grammatical/semantic features.

We seem to see twinBasic.NET

----------


## xiaoyao

> A few years ago, I developed an extremely powerful Spread with pure VB6, and later I used Cairo (you know what it is) to completely rewrite my Spread, which perfectly implemented/simulated all the features of the original Spread (to be precise, more features have been added). 
> 
> In other words, you can use Cairo to rewrite all the controls in your VBCCR without any problems. The interfaces of the new control are exactly the same as your VBCCR. After you rewrite your VBCCR with Cairo, I believe it can become a cross-platform product. If you need help, I can help you. I believe that other real Cairo experts here will also support and help you vigorously.
> 
> Note:
> I dare not mention the VB framework related to Cario, because some of the dark forces here are too strong.


how to use Cairo?
Do you have a tutorial,

----------


## Schmidt

> how to use Cairo?
> Do you have a tutorial,


Why do you ask? (you were already there...)
https://www.vbforums.com/showthread....cs-using-Cairo


In case the question was with regards to "cairo-drawn Widgets" - I've just uploaded an appropriate Tutorial for that as well:
https://www.vbforums.com/showthread....dgets-Tutorial

Olaf

----------


## VB6 Programming

The twinBASIC presentation at Access DevCon 2021 is now on YouTube...

https://www.youtube.com/watch?v=dBvMBAUSyT8&t=14s

----------


## Eduardo-

> The twinBASIC presentation at Access DevCon 2021 is now on YouTube...
> 
> https://www.youtube.com/watch?v=dBvMBAUSyT8&t=14s


Thanks.

----------


## baka

well done presentation. not boring and informative. not sure about his "bold prediction" but who knows, could be happening.  :Big Grin:

----------


## 7edm

Ok took the step to try out this thing, as I really like what I have seen and read so far... and of course I ran right into trouble. Not sure if this is something for github bug issue and just be something simple I have overlooked someone already has experienced. So, installed default VSC (User) for Win10, found and installed the twinBasic extension, downloaded the tb project zip, unzipped and opened it as a new workspace in VSC. So far all fine. Then I started to follow the rearrange of the WS as shown by Wane in the introduction video, but when I moved the Stack frame something went wrong, and I got this message in the TERMINAL tab:




> Warning: This shell is running on your local machine
> 
> Windows PowerShell
> Copyright (C) Microsoft Corporation. All rights reserved.
> 
> Try the new cross-platform PowerShell https://aka.ms/pscore6
> 
> PS C:\Users\Joakim>


I think I somehow managed to start the debugger as the icon shown in the video on the Stack panel header is not to be seen, and in the panel there are 2 items "Running..." and they cannot be killed. When I try to run the "hello World" without debugging Shift+F5 it complain complains about a missing "twinBasic debugger extension". Oh my, so I uninstall tb and install it once again and now the code file wont even open. Below EXPLORER I have a HELLOWORD panel, with 2 empty folder items "BUILD CONFIGURATION !" and "PROJECT: HellowWorld !" and a blank code window pain, except for a watermark with keyboard short cuts.

So how can I get out of this mess and start all over again?

EDIT: I forgot to say that before I uninstalled and reinstalled, I tried to close the workspace and open it again with fresh files from the tb project zip, but it went right into the same situation with 2 items "Running" in the stack panel, and that's why I decided to uninstall and start allover, which apparently have made it worse as VSC seems to remember something no longer current or something like that.

and one more thing, there were some recommendation to install a "debugger for firefox" extension, which I didn't do as noting was mentioned about it on tb page and I don't like to bloat the new environment with stuff I don't need.

----------


## camomille

> Ok took the step to try out this thing, as I really like what I have seen and read so far... and of course I ran right into trouble. Not sure if this is something for github bug issue and just be something simple I have overlooked someone already has experienced. So, installed default VSC (User) for Win10, found and installed the twinBasic extension, downloaded the tb project zip, unzipped and opened it as a new workspace in VSC. So far all fine. Then I started to follow the rearrange of the WS as shown by Wane in the introduction video, but when I moved the Stack frame something went wrong, and I got this message in the TERMINAL tab:
> 
> 
> 
> I think I somehow managed to start the debugger as the icon shown in the video on the Stack panel header is not to be seen, and in the panel there are 2 items "Running..." and they cannot be killed. When I try to run the "hello World" without debugging Shift+F5 it complain complains about a missing "twinBasic debugger extension". Oh my, so I uninstall tb and install it once again and now the code file wont even open. Below EXPLORER I have a HELLOWORD panel, with 2 empty folder items "BUILD CONFIGURATION !" and "PROJECT: HellowWorld !" and a blank code window pain, except for a watermark with keyboard short cuts.
> 
> So how can I get out of this mess and start all over again?
> 
> EDIT: I forgot to say that before I uninstalled and reinstalled, I tried to close the workspace and open it again with fresh files from the tb project zip, but it went right into the same situation with 2 items "Running" in the stack panel, and that's why I decided to uninstall and start allover, which apparently have made it worse as VSC seems to remember something no longer current or something like that.
> ...



I had the same kind of problem after updating from 1.52.1 to 1.56.2
I uninstalled everything and reinstalled 1.52.1 and everything came back okay.

----------


## WaynePhillipsEA

> Ok took the step to try out this thing, as I really like what I have seen and read so far... and of course I ran right into trouble. Not sure if this is something for github bug issue and just be something simple I have overlooked someone already has experienced. So, installed default VSC (User) for Win10, found and installed the twinBasic extension, downloaded the tb project zip, unzipped and opened it as a new workspace in VSC. So far all fine. Then I started to follow the rearrange of the WS as shown by Wane in the introduction video, but when I moved the Stack frame something went wrong, and I got this message in the TERMINAL tab:
> 
> 
> 
> I think I somehow managed to start the debugger as the icon shown in the video on the Stack panel header is not to be seen, and in the panel there are 2 items "Running..." and they cannot be killed. When I try to run the "hello World" without debugging Shift+F5 it complain complains about a missing "twinBasic debugger extension". Oh my, so I uninstall tb and install it once again and now the code file wont even open. Below EXPLORER I have a HELLOWORD panel, with 2 empty folder items "BUILD CONFIGURATION !" and "PROJECT: HellowWorld !" and a blank code window pain, except for a watermark with keyboard short cuts.
> 
> So how can I get out of this mess and start all over again?
> 
> EDIT: I forgot to say that before I uninstalled and reinstalled, I tried to close the workspace and open it again with fresh files from the tb project zip, but it went right into the same situation with 2 items "Running" in the stack panel, and that's why I decided to uninstall and start allover, which apparently have made it worse as VSC seems to remember something no longer current or something like that.
> ...


Hmm, sounds like you almost had it right at one point actually.  Ctrl+F5 (start without debugging) is not currently working with twinBASIC, so will currently display an error.   You can run without debugging, just by using the 'Build' button on the twinBASIC panel.

Please try the following steps:

   Close the workspace (File menu > close workspace).
   Uninstall the twinBASIC extension.
   press F1 > type 'View: Reset View locations'
   Uninstall VS Code.
   Resinstall VS Code, and follow the quick set up video again.

Let me know how you get on.

----------


## 7edm

Thanks Wayne, that brought back the "HellowWord.twin" to open in the editor again, but something is still not ok. While the "VARIABLES", "WATCH" AND "CALL STACK" panes, which I earlier moved to the right side, went back to the left side, the "DEBUG CONSOLE" stayed to the right.

And the same Power Shell warning shows up in the Terminal panel, and when I click the "run guy" icon to run the code in the debugger I get in the Debug Console:

1st row: a circle with "2" inside, and "Executing 'HelloWordProject.ModHellowWord.Main'...
2nd row: "RunCodeUnderCursor failed: main thread is busy.

ok will leave it as is to not screw up before some further feedback.

EDIT: the DEBUG CONSOLE pane header also has a circle with a 1 inside

----------


## 7edm

Ops my bad, it was busy because there was a "hellow world" msgbox hiding behind VSC, and on retest I notice that when I click the run guy icon, the box indeed comes up behind VSC (it staying "on top".

Another strange thing though. There is a vertical "stripe" to the left of the right panel column covering/overlapping the editor window (see arrow on image) and I have no idea where it's coming from (is there from start up) or how to get rid of it? (ok got it, that was from menu: View->Show MiniMap which I must have been clicking on while solving my problem. So all go and ready to Go then I assume  :Smilie:

----------


## VB6 Programming

The twinBASIC weekly update is here...

twinBASIC weekly update May 16 2021

----------


## yereverluvinuncleber

How does TwinBasic intend to handle or introduce the concept of multi-threading to VB6?

----------


## VB6 Programming

> How does TwinBasic intend to handle or introduce the concept of multi-threading to VB6?


My understanding is that twinBASIC already supports multi-threading, but language syntax to support the feature needs to be added.

You can see the multi-threading capabilities from the debug console.

multithreading in twinBASIC example

----------


## yereverluvinuncleber

I once had a wish-list for VB6 and it had certain items in it, some were just nice-to-haves. As time has progressed the main things for me have concreted to become 64bitness, multi-threading and multi-platform support. 64bitness as any target platform support for 32bit is likely to end sooner than I want it to, whether or not I am happy with 32 bits myself, MS will make that step one day. Some Linuxes and os/x are already there.

Multiplatform support as I am ready to rid myself of the Microsoft shackles, Win10 was a hint to leave and never return.



That was what Win10 told me.

Multi-threading? As I compare my VB6 program with a program I am currently cloning I find there are some clear points where multi-threading would drastically alter my program's performance with those tasks that have to occur concurrently at the moment.

Support for modern image types was always another but that is off my wish list as that support will come by default I am assuming.

----------


## freeflow

Nearly two weeks without a visible update.  Something good must be hatching.

----------


## VB6 Programming

twinBASIC status update

twinBASIC update May 23 2021

----------


## wqweto

> twinBASIC status update
> 
> twinBASIC update May 23 2021


Having no news is still some news :-))

cheers,
</wqw>

----------


## VB6 Programming

Updated version of twinBASIC out now - v0.10.313

https://marketplace.visualstudio.com...asic/changelog

https://twinbasic.com/preview.html

----------


## vbrad

It would be great if we could get something definitiive about support for existing vb6 forms.
On one page there is this statement that doesn't mention .FRM files



> There will also be support for VB6 .BAS and .CLS files in the future versions.


while on this page it says



> Forms / GUI support, including full backwards compatibility with existing VB6 forms.


I know that Schmidt does not expect support for existing forms.

----------


## WaynePhillipsEA

> It would be great if we could get something definitiive about support for existing vb6 forms.
> On one page there is this statement that doesn't mention .FRM files
> 
> 
> while on this page it says
> 
> 
> I know that Schmidt does not expect support for existing forms.


The plan is that we will be offering two types of forms in twinBASIC.   One will be Windows-only, and will be fully backwards compatible with VB6 forms.   The second type will be available cross-platform, but will lose some compatibility (though we will try to keep things generally very similar, as much as possible).   I hope that answers your question, but let me know if you need any further clarification.

----------


## vbrad

> The plan is that we will be offering two types of forms in twinBASIC.   One will be Windows-only, and will be fully backwards compatible with VB6 forms.   The second type will be available cross-platform, but will lose some compatibility (though we will try to keep things generally very similar, as much as possible).   I hope that answers your question, but let me know if you need any further clarification.


That's great, thanks. Sounds like a good solution to me!

----------


## Krool

That sounds indeed great to make two form objects.
One which is a "VB6" form object (windows-only) and another "tB" form object (cross-platform) which is as compatible as possible.

----------


## baka

Im looking forward to the "cross-platform" mode.
one thing that Im thinking about is "sound" support
theres no real good sound support in vb6, thats why we use typelibs/API, but if we have a cross-platform we can not use that. 
will there be a build-in cross-platform alternative for that?
and, the .png/opacity image support that vb6 dont have, again, a build-in cross-platform alternative.

----------


## IndicSoftware

If TB will use Cairo in background then support for PNG will be by default available!

----------


## VB6 Programming

twinBASIC status update

https://nolongerset.com/twinbasic-update-may-30-2021/

Wayne says: "*Very soon we'll be moving on to the next big phase... GUI support*"

"In other news, I thought it worth mentioning here that I've now decided on the approach for GUI support.  twinBASIC will eventually offer two types of GUI forms.  One for Windows-only, which is fully backwards compatible with VB6, and a second type of form that supports cross-platform but is not 100% backwards compatible.  I'll be making every effort to make the cross-platform forms 'feel' like VB6 forms as much as possible, and the form designer will be shared between them both."

----------


## VB6 Programming

twinBASIC status update:-

https://nolongerset.com/twinbasic-update-june-6-2021/

----------


## VB6 Programming

Lots of progress in twinBASIC this week...

https://nolongerset.com/twinbasic-update-june-13-2021/

including
Create New ProjectSupport new 'Like' operatorLots of bug fixes

----------


## camomille

a big step for TwinBasic  :Smilie: 



Allows to build the executable for RC6 with events like the example :
"Visualizing a Recordset (multiple Columns and CheckBoxes)" 
without any code modification

----------


## Semke

> Lots of progress in twinBASIC this week...
> [*]Create New Project
> [/LIST]


how would I do that?
I am not familiar with visual studio code

----------


## camomille

> how would I do that?
> I am not familiar with visual studio code


the programming language is VB6 / VBA, Visual Studio Code is the IDE
You will find all installation instructions here:

https://www.twinbasic.com/preview.html

----------


## wqweto

> how would I do that?
> I am not familiar with visual studio code


https://code.visualstudio.com/docs/g...ips-and-tricks

Start VSCode (e.g. Start->Run: code) and press Ctrl+Shift+P and type "twin" without the quotes to find available commands.

cheers,
</wqw>

----------


## VB6 Programming

twinBASIC status update:

https://nolongerset.com/twinbasic-update-june-20-2021/

Lots of progress this week.

There has now been over 600 downloads of the twinBASIC preview.

----------


## VB6 Programming

*twinBASIC status update:*

https://nolongerset.com/twinbasic-update-june-27-2021/

Major developments this week, including support for (external) *version control*; the code *prettifier*; support for *embedded resources*; and support for *visual styles*  via manifest files.


https://twinbasic.com/preview.html

----------


## VB6 Programming

twinBASIC status:

Lots of improvements ...
https://nolongerset.com/twinbasic-update-july-4-2021/


And an early look at the VS Code based forms editor ...
https://twitter.com/WaynePhillipsEA/...66748296306690

----------


## VB6 Programming

Another early look at the twinBASIC form editor 

https://twitter.com/WaynePhillipsEA/...01290518867975

----------


## VB6 Programming

*twinBASIC status update:*

A sneak peek at the yet-to-be-released form editor, a teaser about possible control inheritance, and a future option for version control ...

https://nolongerset.com/twinbasic-update-july-11-2021/

----------


## VB6 Programming

*twinBasic status update:*

https://nolongerset.com/twinbasic-update-july-18-2021/

----------


## VB6 Programming

*twinBasic status update:*

First release expected in 2-3 months (there is already a preview release available).

https://nolongerset.com/twinbasic-update-july-25-2021/

----------


## baka

so, theres a subscription plan, and ordering that now, you get a discount, since the features are not in place yet they want to give you a discount for helping out now with the development costs.
what are everyone thoughts about this, anyone already subscribing?

----------


## vbrad

> so, theres a subscription plan, and ordering that now, you get a discount, since the features are not in place yet they want to give you a discount for helping out now with the development costs.
> what are everyone thoughts about this, anyone already subscribing?


For me, as I make money from VB6, it feels like a sensible thing to do to support this project.
I've signed up and if it all works out it should prove to have been a good investment.
If for some reason it doesn't, well _them's the breaks_ as the saying goes.

----------


## VB6 Programming

> so, theres a subscription plan, and ordering that now, you get a discount, since the features are not in place yet they want to give you a discount for helping out now with the development costs.
> what are everyone thoughts about this, anyone already subscribing?


I haven't yet but I intend to. 

I'm just trying to decide between Professional and Ultimate.

My big requirement is to upgrade existing VB6 software to 64 bit (for Windows 10/11). So that suggests the Professional version.

I can't see I'm ever going to need a Mac OS version, not sure about Linux (I know Linux is the desktop OS of tomorrow, but I just can't wait that long  :Wink:  ). Maybe Linux for server?
Android is always interesting, I've no requirement at the moment - but that could change.

So do I go Ultimate or Professional?

----------


## VB6 Programming

*twinBasic status update:*

https://nolongerset.com/twinbasic-update-august-1-2021/

----------


## Krool

> I haven't yet but I intend to. 
> 
> I'm just trying to decide between Professional and Ultimate.
> 
> My big requirement is to upgrade existing VB6 software to 64 bit (for Windows 10/11). So that suggests the Professional version.
> 
> I can't see I'm ever going to need a Mac OS version, not sure about Linux (I know Linux is the desktop OS of tomorrow, but I just can't wait that long  ). Maybe Linux for server?
> Android is always interesting, I've no requirement at the moment - but that could change.
> 
> So do I go Ultimate or Professional?


You can go for Professional. If for whatever reason in the future you need Ultimate you can migrate and you keep still 40% discount. (Only 10% loss)

----------


## Niya

This seems to be coming along nicely.




> Enough with the bickering.


Wasn't me this time.

----------


## VB6 Programming

> You can go for Professional. If for whatever reason in the future you need Ultimate you can migrate and you keep still 40% discount. (Only 10% loss)


I think that is probably the best approach.

Coincidentally I now have an immediate requirement to develop an Android app. Unfortunately twinBASIC won't be ready in time for that.

----------


## VB6 Programming

> This seems to be coming along nicely.


If you are referring to the progress of twinBASIC I totally agree with you  :Smilie: 

What twinBASIC offers already is stunning.

It's sad really that Microsoft could have done this years ago with VB6 but chose not to (I don't expect you to agree with me on that  :Wink:  )

----------


## VB6 Programming

*twinBasic status update:*

https://nolongerset.com/twinbasic-update-august-8-2021/

----------


## Niya

> It's sad really that Microsoft could have done this years ago with VB6 but chose not to (I don't expect you to agree with me on that  )


I don't think it's sad. They made the right move. They had to sacrifice VB6 for the greater good. 

However, what they should have done, is open sourced VB6 after .Net became mature. It wouldn't have made sense to do it earlier because no one would have given .Net a try, including me. I would have stayed in VB6 if it was developed alongside VB.Net and I would have missed out big time. However at this point in time, I believe it makes sense to open source VB6 and let the community do with it what they want with it. There is no need for force anyone to give .Net try because at this time, those of us who are here already know how great it is and those that stayed behind are never going to move so they might as well throw them a bone and let them be happy.

Also, it can't hurt to be able to spruce up old VB6 applications with some modern features without breaking your back. Personally, I wouldn't write any new apps in it but it would be nice to breath some life into all those old VB6 programs I have lying around and the ones still in active meantainance.

----------


## VB6 Programming

*twinBASIC 12-MONTH ROADMAP*

The 12 month roadmap for twinBASIC...

https://github.com/WaynePhillipsEA/twinbasic/issues/335

Expected release dates:
FILE I/O SUPPORT (September 2021)64-BIT COMPILER SUPPORT (October 2021)OPTIMIZED COMPILATIONS  (November 2021)FORMS GUI SUPPORT 
 - form designer and cross-platform forms engine (November 2021)
 - VB6-compatible Forms engine (February 2022)
 - Reimplementation of all remaining VB6 shipped controls (August 2022)MULTI-THREADING LANGUAGE SUPPORT (December 2021)INHERITANCE LANGUAGE SUPPORT (December 2021)EDIT & CONTINUE SUPPORT (March 2022)CROSS PLATFORM SUPPORT 
 - Initial support for x86 and x64 builds on Linux and Mac OS (May 2022)
 - Support for ARM CPU architectures, and Android OS (August 2022)VBWATCHDOG SUPPORT (December 2021)and many other features

----------


## Niya

I just gave TwinBasic an actual try and HOLY **** IM IMPRESSED!!!

Now, it's very far from being a production ready version of VB6 but for all the talk I've heard over the years about a new VB6 IDE, this one is really for real. I mean I believed in it's promise ever since I first heard of it here on these forums but I had no idea how advanced it really was already. I just took some semi-complex code I wrote in this post and popped it in, expecting a problem or two but the damn thing just worked, without needing a single change. This is really good progress, especially on the promise on VB6 compatibility. 

Looks like you guys are getting your new VB6 after all. You guys have been waiting decades for this. Don't let this fail now.

Now, there are a couple pain points that I think may need to be worked out but I'll do that in a follow up post. Gonna play with for a little bit and see what comes up.

----------


## Niya

Couple of pain points in the intellisense. It doesn't work with enum type parameters. You actually need to type out the enum type with the dot for the enum choices to come up.

Also it's really hard to get a sense of what is what when reading the intellisense description of functions and subs. Visual Studio uses different colours/text styles so you can easily differentiate parameter names, function/sub name and parameter types. Sometimes I just want to know what the parameters are at a glance and having different colours represent different things goes a very very long way. It doesn't even have to be colours alone. Simply bolding or using italics can help. The VB6 intellisense bolds function/sub parameters you're currently typing so you can tell at a glance what you're looking it and where you are.

I know these seem minor but they are huge productivity boosts.

EDIT:

Just noticed the intellisense underlines the parameter you're currently typing. It's not noticeable enough. Maybe bold it too or perhaps use a different colour like modern versions of Visual Studio does.

----------


## Niya

Another thing, whenever I create a new project, it opens a new instance of VS Code. That is really annoying. It would be nice if it did it in the same instance.

----------


## VB6 Programming

> I just gave TwinBasic an actual try and HOLY **** IM IMPRESSED!!!
> 
> Now, it's very far from being a production ready version of VB6 but for all the talk I've heard over the years about a new VB6 IDE, this one is really for real. I mean I believed in it's promise ever since I first heard of it here on these forums but I had no idea how advanced it really was already. I just took some semi-complex code I wrote in this post and popped it in, expecting a problem or two but the damn thing just worked, without needing a single change. This is really good progress, especially on the promise on VB6 compatibility. 
> 
> Looks like you guys are getting your new VB6 after all. You guys have been waiting decades for this. Don't let this fail now.
> 
> Now, there are a couple pain points that I think may need to be worked out but I'll do that in a follow up post. Gonna play with for a little bit and see what comes up.


Twice in one day I've agreed with something you've posted. One of us must not be well  :Wink:

----------


## Niya

> Twice in one day I've agreed with something you've posted. One of us must not be well


I've never had any problems with people liking or wanting to use VB6. I'm really glad it's die hard fans are finally getting what they wanted for all these years. I'm really happy for you guys. My problem was always with all of the misinformation that came out of the VB6 camp about .Net. and all of the emotionally driven drivel that came with that misinformation campaign. 

I have no problem with VB6 but VB.Net really is a great successor that brought a lot of things that I and a lot of people always wanted. However, that came at the cost of compatibility with VB6 and yes, that was a bad thing. It was a terrible thing Microsoft did to VB6 developers when they abandoned VB6 but I fully understand why they did it. When I looked at what .Net has become today, I see now why they couldn't use VB6 as a base. It just would not have worked, at least not without 10x the effort.

Anyways, TwinBASIC really is impressive and based on what I've seen so far, it has a very bright future. Hopefully, the developers won't get burned out before it reaches it's full potential and when it's production ready, I'd have no problem recommending it to anyone. In fact, I'd go so far as to recommend it over VB.Net for beginners looking to get into Windows programming. One of the very few things VB6 does better than any .Net language is that it is far more approachable as a development platform. You can get along in VB6 without knowing anything about classes, inheritance, delegates, generics, lambda expressions, async/await etc. Don't get me wrong, these features do bring a lot of power to a language but beginners, hobbyists and people looking to do something simple will be overwhelmed and you can't really get away from most of this in .Net. You certainly can write code without it but eventually you will need to Google something and you are going to run into these things and as a beginner, it will be very scary. VB6 tends to keep things simple.

That is not to say that TwinBASIC cannot benefit from some modern features. For example, declaring and initializing a variable on the same line:- 


```
Dim i As Long = 10
```

No matter how simple a language is, there's no excuse to not have this ability. Of course the biggest modern benefit by far that TwinBASIC will have is a powerful modern IDE behind it which makes a huge difference. A modern IDE alone is enough for me to take it seriously.

So yea, this is a really good thing for everyone and I'm genuinely happy for all find satisfaction in having this choice.

----------


## WaynePhillipsEA

> Couple of pain points in the intellisense. It doesn't work with enum type parameters. You actually need to type out the enum type with the dot for the enum choices to come up.
> 
> Also it's really hard to get a sense of what is what when reading the intellisense description of functions and subs. Visual Studio uses different colours/text styles so you can easily differentiate parameter names, function/sub name and parameter types. Sometimes I just want to know what the parameters are at a glance and having different colours represent different things goes a very very long way. It doesn't even have to be colours alone. Simply bolding or using italics can help. The VB6 intellisense bolds function/sub parameters you're currently typing so you can tell at a glance what you're looking it and where you are.
> 
> I know these seem minor but they are huge productivity boosts.
> 
> EDIT:
> 
> Just noticed the intellisense underlines the parameter you're currently typing. It's not noticeable enough. Maybe bold it too or perhaps use a different colour like modern versions of Visual Studio does.


Thanks Niya!  Glad you're liking it.

For the enum parameters intellisense, I've opened an issue in our GitHub tracker here:  https://github.com/WaynePhillipsEA/twinbasic/issues/337

For the signature-help formatting, unfortunately VS Code doesn't offer customization here.  The active parameter should be both bold and underlined, but I do agree that it's not always particularly clear.  Hopefully VS Code will improve their offering for this in the future, but for now we can only provide plaintext for the signature help text, and VS code applies its bold+underline formatting to the active parameter part based on offsets into the plaintext data provided by the language server.


Thanks again for looking at twinBASIC, and for your valuable feedback, all noted.

----------


## Niya

> Thanks Niya!  Glad you're liking it.


I'll always be a .Net guy but I really love seeing good work like this and we do have some legacy VB6 stuff that needs maintaining. TwinBASIC would be a good fit.




> For the enum parameters intellisense, I've opened an issue in our GitHub tracker here:  https://github.com/WaynePhillipsEA/twinbasic/issues/337


Nice. That is the issue exactly. I was actually thinking about coming back around to provide a picture myself just in case I wasn't clear enough but you got it.




> For the signature-help formatting, unfortunately VS Code doesn't offer customization here.  The active parameter should be both bold and underlined, but I do agree that it's not always particularly clear.  Hopefully VS Code will improve their offering for this in the future, but for now we can only provide plaintext for the signature help text, and VS code applies its bold+underline formatting to the active parameter part based on offsets into the plaintext data provided by the language server.


Ah ok. This also brings me to something else. Did you guys ever consider integration with Visual Studio itself. One other minor pain point I had was how different VS Code is to Visual Studio. I kept trying to do things the "Visual Studio" way. I mean it's not essential, as VS Code isn't that hard use but it really bites when you're so much more familiar with something else. It would be really great if it was integrated into Visual Studio itself. That could also go a long way as well. Visual Studio is really popular on Windows amongst Windows programmers so it would be a big deal if Visual Studio was also available as a choice alongside VS Code.





> Thanks again for looking at twinBASIC, and for your valuable feedback, all noted.



No problem. Really great work. Keep it up!

----------


## mansellan

> Ah ok. This also brings me to something else. Did you guys ever consider integration with Visual Studio itself. One other minor pain point I had was how different VS Code is to Visual Studio. I kept trying to do things the "Visual Studio" way. I mean it's not essential, as VS Code isn't that hard use but it really bites when you're so much more familiar with something else. It would be really great if it was integrated into Visual Studio itself. That could also go a long way as well. Visual Studio is really popular on Windows amongst Windows programmers so it would be a big deal if Visual Studio was also available as a choice alongside VS Code.


twinBASIC connects to VS Code using standard protocols (LSP and DAP), so it should be possible to integrate with Visual Studio, or any other IDE that implements the protocols. I opened an issue on the GitHub tracker to propose this: https://github.com/WaynePhillipsEA/twinbasic/issues/82. The only slight complication is that VS Code uses a virtual filesystem, but I'm sure that can be worked around.

That said, I suspect it's not a priority right now - VS Code is a good fit as it's cross-platform. And the language needs a "primary" IDE for support reasons. Potentially other integrations could be written by the community.

Note, I'm just an interested party, not a tB developer.

----------


## WaynePhillipsEA

> I'll always be a .Net guy but I really love seeing good work like this and we do have some legacy VB6 stuff that needs maintaining. TwinBASIC would be a good fit.
> 
> 
> 
> Nice. That is the issue exactly. I was actually thinking about coming back around to provide a picture myself just in case I wasn't clear enough but you got it.
> 
> 
> 
> Ah ok. This also brings me to something else. Did you guys ever consider integration with Visual Studio itself. One other minor pain point I had was how different VS Code is to Visual Studio. I kept trying to do things the "Visual Studio" way. I mean it's not essential, as VS Code isn't that hard use but it really bites when you're so much more familiar with something else. It would be really great if it was integrated into Visual Studio itself. That could also go a long way as well. Visual Studio is really popular on Windows amongst Windows programmers so it would be a big deal if Visual Studio was also available as a choice alongside VS Code.
> ...


Integration with VS was considered, yes.  From the start of the project I felt that one of the most important thing was to extend an existing IDE rather than creating one from scratch, and it was just a case of having to choose one.  After much research, VS Code seemed to be way ahead of every other option in terms of supporting open-protocols; LSP for the language and DAP for debugging.  VS does now offer support for LSP and DAP protocols, but from what I've seen it's nowhere near as feature complete as what is offered by VS Code.   Additionally the VS Code API is actually really nice to work with - it is clear the team have put extension authors at the heart of everything VS Code offers.

As @mansellan rightly points out, by using these modern open-protocols (LSP+DAP), it would actually be fairly easy to switch to another IDE at some later point (provided enough of the protocols features are implemented).  For support reasons, our current official view is that VS Code is *the* twinBASIC IDE.  If others in the community were to make twinBASIC work with other editors, I would absolutely support their efforts as best as I can.

All that said, I am very aware that there are improvements still needed to help make the transition from VB6 to twinBASIC/VS Code, so expect further improvements in due course as we put more effort into that.

----------


## Niya

@mansellan 
@WaynePhillipsEA 

Ok that's fine. VS Code is not a bad IDE. It's just different and seems far more generalized. Every version of Microsoft's IDEs have done certain things the same way since QuickBasic. for example F9 being used to set break points and F8 for single stepping and dozens of other tiny things. At least you guys preserved some of these conventions in VS Code.

----------


## WaynePhillipsEA

> Couple of pain points in the intellisense. It doesn't work with enum type parameters. You actually need to type out the enum type with the dot for the enum choices to come up.


@Niya, just to let you know, this should now be working as of v0.10.4125 ( https://github.com/WaynePhillipsEA/twinbasic/issues/337 ).  Thanks for your feedback!

----------


## Niya

> @Niya, just to let you know, this should now be working as of v0.10.4125 ( https://github.com/WaynePhillipsEA/twinbasic/issues/337 ).  Thanks for your feedback!


Nice. Good work.

----------


## Niya

Just found a breaking bug in v0.10.4198



```
    Public Type TESTTYPE
        testString As string * 13 * 2
    End Type
```

The above module level code crashes the compiler.

----------


## Niya

Another minor bug, Go to Definition doesn't seem to work with constants that are in another module in another .twin file.

----------


## WaynePhillipsEA

> Just found a breaking bug in v0.10.4198
> 
> 
> 
> ```
>     Public Type TESTTYPE
>         testString As string * 13 * 2
>     End Type
> ```
> ...


Thanks Niya!   I created an issue for it over on GitHub:
https://github.com/WaynePhillipsEA/twinbasic/issues/350

And it's now fixed in v0.10.4273.

----------


## WaynePhillipsEA

> Another minor bug, Go to Definition doesn't seem to work with constants that are in another module in another .twin file.


Issue for tracking : https://github.com/WaynePhillipsEA/twinbasic/issues/351
Thanks!

----------


## Niya

Wow. You guys work fast. Nice job.

I spent the last 3 days testing out TwinBASIC by taking on something with a more teeth than just printing simple stuff with MsgBox. I decided to really test it by writing a GUI application using pure Win32 from scratch(no copy and pasting code from anywhere) and purely using Visual Studio Code to get a feel for the debugging experience. I just finished it and released it here if anyone wants to check it out.

I have to say, it is really impressive how capable TwinBASIC is, even at this time with bugs and issues popping up here and there. Even though it's still very far from it's goal of VB6 compatibility, it felt like a complete product in it's own right. I had very little trouble coding against the Win32 API and I felt as if I could do anything I wanted. In this regard it is EVERY BIT as capable as VB6.

That being said, I do want to address some major pain points with the debugging experience in Visual Studio Code. Now, the debugger is very solid but not very intuitive to use. The biggest issue I had the entire time was getting breakpoints to work. The biggest pain with that is that I can't just run the application from the Build button if I want Stop or breakpoints to work. I had to use the run feature the "run procedure under cursor" which required me to go back to Sub Main and put the cursor under it every time. This was unbelievably annoying to do. I want to be able to set a breakpoint and run the application from right where I am, like I've been doing since QuickBasic. 

Another very important thing that I really missed was the ability to put Debug.Print in my code to spit out data about the state of my application at runtime. Not having this ability slowed me down massively, especially when combined with what I said above about getting breakpoints to work.

There were a lot of other minor issues that I can't recall right now but those were my biggest problems.

Anyways, my overall experience with TwinBASIC was good. I was really impressed and I had a lot of fun testing this out. I'd like to continue but I have already spent 3 days on this and I need to get back to my work. Keep it up guys. TwinBASIC has real promise.

----------


## WaynePhillipsEA

> Wow. You guys work fast. Nice job.
> 
> I spent the last 3 days testing out TwinBASIC by taking on something with a more teeth than just printing simple stuff with MsgBox. I decided to really test it by writing a GUI application using pure Win32 from scratch(no copy and pasting code from anywhere) and purely using Visual Studio Code to get a feel for the debugging experience. I just finished it and released it here if anyone wants to check it out.
> 
> I have to say, it is really impressive how capable TwinBASIC is, even at this time with bugs and issues popping up here and there. Even though it's still very far from it's goal of VB6 compatibility, it felt like a complete product in it's own right. I had very little trouble coding against the Win32 API and I felt as if I could do anything I wanted. In this regard it is EVERY BIT as capable as VB6.
> 
> That being said, I do want to address some major pain points with the debugging experience in Visual Studio Code. Now, the debugger is very solid but not very intuitive to use. The biggest issue I had the entire time was getting breakpoints to work. The biggest pain with that is that I can't just run the application from the Build button if I want Stop or breakpoints to work. I had to use the run feature the "run procedure under cursor" which required me to go back to Sub Main and put the cursor under it every time. This was unbelievably annoying to do. I want to be able to set a breakpoint and run the application from right where I am, like I've been doing since QuickBasic. 
> 
> Another very important thing that I really missed was the ability to put Debug.Print in my code to spit out data about the state of my application at runtime. Not having this ability slowed me down massively, especially when combined with what I said above about getting breakpoints to work.
> ...


Niya... thanks so much for trying out twinBASIC!  I'm very pleased that the overall experience was a good one, and thanks for your kind words.

I hear you about launching the debug session currently being awkward to start in Sub Main() -- I'll address that very soon.  Breakpoints and Debug.Print etc should all be working provided you do run the code in the debugger rather than launching via the Build button, but I understand why you were using the Build button currently.

Thanks again - your feedback is invaluable.

----------


## Niya

@WaynePhillipsEA

Ok, did a little more testing and I want to bring a couple things to your attention. Hope I'm not annoying you with all this.

It seems pressing F5 works exactly the way it should and Breakpoint/Stop work the way I wanted when using it. I'm unsure if this was always working or if it's a recent fix since I haven't used F5 at all during those 3 days writing that application. But the reason I avoided using it was because I thought it wasn't working. Pressing F5 works but when you actually go to Run -> Start Debugging, it just gave me a menu thing to choose a debugger and when I chose twinbasic DEBUGGER, it didn't do anything. I should have been using F5 instead of the Build button all this time, but I didn't because the inconsistent behavior between Run -> Start Debugging and it's shortcut, F5 led me to believe this feature wasn't working. This is an example what what I meant when I said the debugger was unintuitive. A menu option and it's keyboard shortcut should do the same thing regardless of how you invoke it.

Also, using F5 to execute the program with the debugger still requires that you put the cursor in Sub Main which is a major pain point.

Also, I just tested Debug.Print with an F5 run and it works just as you said. However, Debug.Print doesn't show up in the intellisense which I why I assumed it didn't exist.

One last thing I just noticed about the debugger. It inherited a weakness from VB6 and it has to do with way it executes the program in debug mode. Now I'm making some assumptions here so feel free to correct me where I'm wrong, but I'm guessing that VB6 runs the program in the same process as the IDE which means anything that the program does in the process space would affect the IDE as well. I'm guessing it's one of the reasons why bad API calls can crash the VB6 IDE. It seems that TwinBASIC does something similar. Now, I haven't observed bad API calls crashing the Visual Studio Code IDE but I have noticed behaviors that lead me to believe that TwinBASIC programs run in the same address space as VS Code. 

Modern versions of Visual Studio when running a program in debug mode actually run it as it's own process. This has a couple of advantages. For one, it lets you see debug the application with the exact behavior it would have when compiled and released in a production environment. Secondly and this is the more important point, it allows Windows to clean up resource leaks when your application terminates. If you are debugging an application in TwinBASIC and it breaks for any reason without cleaning up resources like GDI/User32/Kernel handles, these handles end up polluting the debugging session which can hamper the actual process of debugging the application.

You can test this leaking behavior with this code:-


```
Module MainModule

Private Declare Function CreateFileW Lib "kernel32" (ByVal lpFileName As Long, ByVal dwDesiredAccess As Long, ByVal dwShareMode As Long, ByVal lpSecurityAttributes As Long, ByVal dwCreationDisposition As Long, ByVal dwFlagsAndAttributes As Long, ByVal hTemplateFile As Long) As Long
Private Declare Function CloseHandle Lib "kernel32" (ByVal handle As Long) As Long


Private Const GENERIC_READ As Long = &H120089
Private Const NO_SHARE As Long = 0
Private Const OPEN_EXISTING As Long = 3
Private Const FILE_ATTRIBUTE_NORMAL As Long = &H80
Private Const INVALID_HANDLE_VALUE As Long = -1
   
    ' This project type is set to 'Standard EXE' in the Settings file, so you need a Main() subroutine to run when the EXE is started.
    Public Sub Main()
        Dim hfile As Long
        Dim sFileName As String = "d:\t.txt"
        
        hfile = CreateFileW(StrPtr(sFileName), GENERIC_READ, NO_SHARE, 0, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0)
        
        If hfile = INVALID_HANDLE_VALUE Then
            MsgBox ("Failed to open file")
        Else
            MsgBox("File open succeeded")
        End If
        
        'Comment this line out to see that consecutive F5 runs
        'failed to open the file after the first run due to the file
        'handle being leaked. Solving it requires that VS Code be completely restarted 
        'to allow Windows to close the handle.
        CloseHandle(hfile)
    End Sub
	
End Module
```

I've also tested this by leaking Timers and the results were unholy to say the least. Ended up with dozens of timers just running in the process causing all kinds of havoc.

----------


## WaynePhillipsEA

Hey @Niya, sorry about the 'Start Debugging' menu thing... I am aware of it as someone else also mentioned it previously but haven't had chance to look deeper into it yet.  I might open a separate issue for it so that it gets more prominent attention.

> Hope I'm not annoying you with all this

Not at all!  It's great to get feedback.  I'm way too close to the project to notice the little things that annoy new users, so I do take note of all feedback when it come in  :Smilie: 

Debug.Print not showing in the intellisense is also a known issue (https://github.com/WaynePhillipsEA/twinbasic/issues/269) and this will be addressed soon as I've been doing some work in this area so it makes sense to get that sorted now.

Indeed, the debugging session does run inside the same process as the compiler, and you're right that this does create some pain points, particularly with using the Win32 API.  The debugger is tightly bound to the compiler at the moment, but it is planned to be separated out so that the debugged session can be run in a separate process.  This change is not imminent, but will be done in the next few months.    Thanks again!

----------


## Niya

Aite man. Keep up the good work!

----------


## Niya

> Indeed, the debugging session does run inside the same process as the compiler, and you're right that this does create some pain points, particularly with using the Win32 API.  The debugger is tightly bound to the compiler at the moment, but it is planned to be separated out so that the debugged session can be run in a separate process.  This change is not imminent, but will be done in the next few months.


It just occurred to me that a nice stopgap measure would be some kind of button or shortcut that allows you to restart the IDE and reload the current project. If something like that were easy to implement, you could lean on that in the mean time until you're able to separate the compiler from the debugger.

----------


## Niya

Started experimenting with classes in TwinBASIC. Found two minor issues so far:-

 Intellisense doesn't work with Handles clause. Application crashes if you try to assign an object to an object variable without using Set:-


```
m_tc = New TestClass(900) 'Crashes
```



```
Set m_tc = New TestClass(900) 'Works
```

----------


## Niya

Also, would it be more helpful if I posted these on GitHub instead. Do you mind at all having to come over here at read these at VBForums? I'm just very familiar with posting here. I never did anything more than read/download stuff off GitHub.

----------


## Niya

Another thing I wanted to point about about TwinBASIC. I'm really loving the fact that the compiler can produce Windows executables with zero dependencies, an advantage it has over VB6 and .Net. .Net can't do it as far as I know(except when compiling for Linux) and VB6 does it very poorly(OCX errors, always having trouble finding DLLs etc). Although I will always veer towards using Visual Studio and .Net for any serious work, I could see myself using TwinBASIC to write very small and easy to deploy utility applications. I tend write a lot of little utilities in .Net, both for personal use and help wit h our work. And while I've never had serious problems with them, there is always that slight risk that something might be broken on somebody's computer and it would not run. Bare bones binaries coded against the Win32 API almost never fail to run on any Windows system. It would be nice if you guys could preserve this ability in future versions of TwinBASIC.

----------


## WaynePhillipsEA

> Started experimenting with classes in TwinBASIC. Found two minor issues so far:-
> 
>  Intellisense doesn't work with Handles clause. Application crashes if you try to assign an object to an object variable without using Set:-
> 
> 
> ```
> m_tc = New TestClass(900) 'Crashes
> ```
> 
> ...


Could you provide a full example for this?  My following attempt to reproduce generates a runtime unhandled error as expected, but not a hard crash:


```
Private Class TestClass
    Sub New(aValue As Long)
    End Sub
End Class
    
Module MainModule
    Dim m_tc As Object
    Sub Main()
        m_tc = New TestClass(900)
    End Sub
End Module
```

----------


## WaynePhillipsEA

> Another thing I wanted to point about about TwinBASIC. I'm really loving the fact that the compiler can produce Windows executables with zero dependencies, an advantage it has over VB6 and .Net. .Net can't do it as far as I know(except when compiling for Linux) and VB6 does it very poorly(OCX errors, always having trouble finding DLLs etc). Although I will always veer towards using Visual Studio and .Net for any serious work, I could see myself using TwinBASIC to write very small and easy to deploy utility applications. I tend write a lot of little utilities in .Net, both for personal use and help wit h our work. And while I've never had serious problems with them, there is always that slight risk that something might be broken on somebody's computer and it would not run. Bare bones binaries coded against the Win32 API almost never fail to run on any Windows system. It would be nice if you guys could preserve this ability in future versions of TwinBASIC.


This feature will be staying   Even once we've got GUI support, this feature is staying.  Zero dependencies and small executables is one of the key benefits of twinBASIC.

----------


## WaynePhillipsEA

> Also, would it be more helpful if I posted these on GitHub instead. Do you mind at all having to come over here at read these at VBForums? I'm just very familiar with posting here. I never did anything more than read/download stuff off GitHub.


It would be great to see you over at GitHub, and it helps so others can keep track of issues too.  That said, if you prefer to stay over here, I'm fine with that also.

----------


## Niya

> Could you provide a full example for this?  My following attempt to reproduce generates a runtime unhandled error as expected, but not a hard crash:


My apologies, I should have chosen my works more carefully. That is what I meant, the program crashes with an exception. 

With regards to this issue. I was under the impression that this would qualified as syntax error and not a runtime error which I why I found that exception odd. If not using Set was a violation, I was expecting the compiler to prohibit compilation of the code. 




> This feature will be staying Even once we've got GUI support, this feature is staying. Zero dependencies and small executables is one of the key benefits of twinBASIC.


This is good to hear.




> It would be great to see you over at GitHub, and it helps so others can keep track of issues too. That said, if you prefer to stay over here, I'm fine with that also.


I'll see if I can find my GitHub credentials some time soon. I have them in a file somewhere. Been a while since I logged into GitHub.

----------


## WaynePhillipsEA

> My apologies, I should have chosen my works more carefully. That is what I meant, the program crashes with an exception. 
> 
> With regards to this issue. I was under the impression that this would qualified as syntax error and not a runtime error which I why I found that exception odd. If not using Set was a violation, I was expecting the compiler to prohibit compilation of the code. 
> 
> 
> 
> This is good to hear.
> 
> 
> ...


Ah OK, the runtime error is what is expected here; same as VB6.  Without the 'Set', it gets default-member property-put semantics (through IDispatch with DISPID_VALUE).  With IDispatch being late-bound, this is a runtime-error instead of a compile-error.  

However, twinBASIC could be smarter than VB6 here, as it knows for sure that there's no default members defined on these internally defined classes, and so could throw a compile-error.

----------


## WaynePhillipsEA

v0.10.4333 just released.   Handles-clause intellisense is now available, and the Debug object intellisense is also fixed.

----------


## Niya

> Ah OK, the runtime error is what is expected here; same as VB6.  Without the 'Set', the object on the RHS is probed at runtime for its default member through IDispatch (DISPID_VALUE), and then the result from that is passed on to the LHS object similarly using DISPID_VALUE, with property-put semantics.  With IDispatch being late-bound, this is a runtime-error instead of a compile-error.


Wow, ok. I had no idea it worked like that. My knowledge of the internal workings of COM is no where near yours.




> However, twinBASIC could be smarter than VB6 here, as it knows for sure that there's no default members defined on these internally defined classes, and so could throw a compile-error.


That would be a good idea. Errors like that don't exist in VB.Net or C# as far as I know. That's why it felt so weird to me. A general rule of thumb might be to consider any error that can be caught at compile time should be caught at compile time. This error qualifies but only for scenarios where the type being assigned is known.

Of course this is not what I'd consider a major pain. It would be acceptable if it stayed as it is provided we get a better description of why it crashed instead of just "unhandled error". The first time it happened to me, it took me quite a while to figure out that not using Set to assign objects to variables was the cause.




> v0.10.4333 just released.   Handles-clause intellisense is now available, and the Debug object intellisense is also fixed.


Just tried them. Works great so far!!

----------


## WaynePhillipsEA

> It would be acceptable if it stayed as it is provided we get a better description of why it crashed


Absolutely.  Most runtime errors come through as generic E_FAIL at the moment.  There's an open issue for that (https://github.com/WaynePhillipsEA/twinbasic/issues/56), and we'll be tackling it very soon.

----------


## Niya

> Absolutely.  Most runtime errors come through as generic E_FAIL at the moment.  There's an open issue for that (https://github.com/WaynePhillipsEA/twinbasic/issues/56), and we'll be tackling it very soon.


Ah nice.

One other thing on the intellisense, it doesn't work with RaiseEvent.

----------


## TTn

> It would be great to see you over at GitHub, and it helps so others can keep track of issues too.  That said, if you prefer to stay over here, I'm fine with that also.


There are some things that are making tB difficult and cumbersome to use, but should be easy to fix, thus worth the effort sooner.
Here is my feedback as a long time VB6/VB.NET user:

High
Need Quick access to common menu items, in the same placement as VB6 and with the same naming convention.  The learning curve is a bit of a nuisance, especially if what you're looking for doesn't exist yet.  In fact any extra features that are not included in VB6 or laid out as VB6 should be hidden until chosen, or perhaps have 2 simple modes, ie classic mode/tB mode.Intellisense does not appear after typing the New keyword, ie  Dim v As New  {nothing appears here yet}.Intellisense does not initiate parameter/return types after typing spacebar (accepts only tab for some reason).Automatic Code formatting with options!!!  There has never been an excuse for any IDE NOT formatting the code that is the format of the language itself.  Code procedures should be displayed with a pretty arrangement after certain input events, ie Enter key, drag/drop, etc.

Moderate
Make any new auto insertions optional (off by default).  Muscle memory is hard and frankly annoying to change. The developer has to delete the extra inserted characters, or move the caret back because of an unexpected position. Getting used to this may not be possible since you have to switch back/forth to VB6 so often.Goto definition ?Jump to last postion?I'm Expecting the "Redo" shortcut accelerator to be Alt+Shift+Backspace, not Ctrl+Y

Low
Object browser of some sort would be nice.

A smoother transition between VB6 and tB is needed for the user's experience.  As mentioned, the developer will often have to switch back and forth between VB6 and tB.  A good metaphoric example would be for users that switch between VB6 and VB.NET often.  It takes a minute to jump back on the bicycle and remember the subtle differences that have a profound or opposite effect.

EDIT: update undo also has a bug, where it stops for no reason.  Seems to be trying re-case or something?

----------


## WaynePhillipsEA

> Ah nice.
> 
> One other thing on the intellisense, it doesn't work with RaiseEvent.


Fixed in v0.10.4359.  (update will be live in about 5 minutes)  Thanks!

----------


## jpbro

> I'm Expecting the "Redo" shortcut accelerator to be Alt+Shift+Backspace, not Ctrl+Y


@WaynePhillipsEA - I vote to keep Ctrl+Y if you decide to bind Alt+Shift+Backspace to Redo also. It has always driven me nuts that Ctrl+Y doesn't Redo in the VB6 IDE!

----------


## WaynePhillipsEA

Thanks for your input @TTn.

*> Quick access to common menu items*
I hear you.  Unfortunately VS Code doesn't offer full customization of menus (yet), so we can't copy the menu layout of VB6.  At the moment, we've got the twinBASIC panel (with the build button etc), and so we probably need to make better use of that.   In order to copy the layout VB6 more precisely, we'd have to fork VS Code, which is not impossible of course, but does have it's own concerns.

*>Intellisense does not appear after typing the New keyword*
Should already be fixed.  This was a bug due to certain type libraries.  Please let me know if you're version of tB is up-to-date and you're still experiencing this.

*>Intellisense does not initiate parameter/return types after typing spacebar*
This one is tricky.  We can make the spacebar key do that, but it creates other problems.   The issue comes from VS Code, where the intellisense dropdown list automatically pre-selects the top item, and so pressing space at that point then always changes the current entered text to the completion item text, even though you didn't manually select it.  In VB6, it doesn't pre-select an item, so you don't have this problem.   This one might be worth us creating an issue over on the VS Code repository to ask for an option to turn off the pre-selection of intellisense lists, and then we can more safely enable the traditional spacebar commit key.

*> Automatic Code formatting with options*
Planned.

*> Make any new auto insertions optional (off by default)*
Could you give me an example here, as we aren't doing much auto-insertion at the moment.  Perhaps it was the automatic End-block statements you were referring to here?  If so, we can add an option for that, sure.

*> Goto definition*
Already implemented.   It's on the right-click context menu, or press F12.

*> Jump to last postion*
Not sure if VS Code offers that, but if not we could probably implement it.

*> I'm Expecting the "Redo" shortcut accelerator to be Alt+Shift+Backspace, not Ctrl+Y*
I'll look into that.

*> Object browser of some sort would be nice*
Planned.

*> Update undo also has a bug, where it stops for no reason*
Known issue.  Sometimes 'Undo' fights with the tB prettifier.  The prettifier currently wins.  

Thanks!

----------


## TTn

> *> Quick access to common menu items*
> I hear you.  Unfortunately VS Code doesn't offer full customization of menus (yet), so we can't copy the menu layout of VB6.  At the moment, we've got the twinBASIC panel (with the build button etc), and so we probably need to make better use of that.   In order to copy the layout VB6 more precisely, we'd have to fork VS Code, which is not impossible of course, but does have it's own concerns.
> *>Intellisense does not appear after typing the New keyword*
> Should already be fixed.  This was a bug due to certain type libraries.  Please let me know if you're version of tB is up-to-date and you're still experiencing this.
> *>Intellisense does not initiate parameter/return types after typing spacebar*
> This one is tricky.  We can make the spacebar key do that, but it creates other problems.   The issue comes from VS Code, where the intellisense dropdown list automatically pre-selects the top item, and so pressing space at that point then always changes the current entered text to the completion item text, even though you didn't manually select it.  In VB6, it doesn't pre-select an item, so you don't have this problem.   This one might be worth us creating an issue over on the VS Code repository to ask for an option to turn off the pre-selection of intellisense lists, and then we can more safely enable the traditional spacebar commit key.
> *> Automatic Code formatting with options*
> Planned.
> *> Make any new auto insertions optional (off by default)*
> ...


Ok, I understand that the menu layout may be hard, so expanding the tB panel makes sense.Yup, the New keyword is working here now.The spacebar issue is important because it hurts my wrist to extend out to tab key constantly, whereas both thumbs are planted at home on the spacebar, especially different keyboard layouts.Cool, manual code formatting is a subtle yet insidious distractionType a function name, then type open parenthesis character or the open quotation character.  There may be other examples but those kept slipping me up.Thanks for the tip on Goto definition, completely missed that.Jump back is nice but not needed right away.Redo is odd, because VB6 does accept Ctrl+Y, but it deletes lines of code.  An accelerator is not listed on the menu item in the IDE.  I expected to get Alt+Shift+Backspace, since VB.NET uses that alternative.Nice, object browsing!Prettify is difficult, but I'm sure you'll knock it out.

----------


## Eduardo-

> @WaynePhillipsEA - I vote to keep Ctrl+Y if you decide to bind Alt+Shift+Backspace to Redo also. It has always driven me nuts that Ctrl+Y doesn't Redo in the VB6 IDE!


I vote for Control+Y to do (keep doing) what it already does on VB6.

----------


## jpbro

> I vote for Control+Y to do (keep doing) what it already does on VB6.


I vote again for Ctrl+Y to do what almost every other Windows program does. We can vote more than once right?  :Wink:  But seriously, I think it's easier to remap your brain once to a shortcut that works across all apps vs. having to remap it dynamically every time you task switch to another app.

Maybe customizable hotkey to action mapping (similar to what MZTools offers) is what's needed.

----------


## vbrad

> I vote again for Ctrl+Y to do what almost every other Windows program does. We can vote more than once right?  But seriously, I think it's easier to remap your brain once to a shortcut that works across all apps vs. having to remap it dynamically every time you task switch to another app.
> 
> Maybe customizable hotkey to action mapping (similar to what MZTools offers) is what's needed.


I never even knew about Ctrl+Y.
Comment and uncomment serves that purpose for me, I think

----------


## yereverluvinuncleber

No voting required surely? These things should be sorted by configuration. 

I mean we all use tools that are newer and do things the 'new' way but we old VB6ers are used to our old IDE, the way we have been using it for 20 years now. It is hard to unlearn. However, I'd be more than happy to use CTRL+R as a replacement for "find and replace" whereas old VB6 requires it to be CTRL+H. Give me the option to configure it exactly how I'd like and I am sure we will all be happy.

----------


## vbrad

> No voting required surely? These things should be sorted by configuration. 
> 
> I mean we all use tools that are newer and do things the 'new' way but we old VB6ers are used to our old IDE, the way we have been using it for 20 years now. It is hard to unlearn. However, I'd be more than happy to use CTRL+R as a replacement for "find and replace" whereas old VB6 requires it to be CTRL+H. Give me the option to configure it exactly how I'd like and I am sure we will all be happy.


Maybe I'm doing it wrong but I find that making new features configurable adds greatly to the time it takes to complete them.
If that's right then I'd prefer for there to be just one twinbasic way of doing things and I can easily live with that if it opens
my vb6 projects. That's the one thing I want.

----------


## yereverluvinuncleber

As another chap here said, some of us will be working with VB6 probably at the same time as TwinBasic, I have real reasons for doing so. It will make life much easier if TB, being the successor to VB6 acts like it. All the tools I create are configurable, it is easy to do so, perhaps we will let the designers tell us how easy it might be for VS Code.

----------


## WaynePhillipsEA

VS Code is extremely configurable in this regard.  For example, if you want Ctrl+Y to do what VB6 does, it takes only a few seconds to set it up -  details here

The Alt+Shift+Backspace combination isn't assigned to anything in VS Code by default, so it makes sense for us to simply assign that also to the Redo command in the twinBASIC extension.  However, for the Ctrl+Y combination, we'll leave it at the more standard default of 'Redo', but you can easily change it as per the above instructions.  We might offer an initial welcome/setup page when you first install the twinBASIC extension so that you can easily configure things like this.

----------


## Niya

Minor suggestion. I think having the IDE append a () after for any function call where the function has no parameters would help code readability. It feels really odd reading code where you see something like:-


```
v = GetValue
```

instead of:-


```
v = GetValue()
```

Imagine reading code like that 3 years later. It's not hard to envision that you might be wondering what the heck GetValue is. Is it a variable? A function? It needs to be unambiguous.

----------


## Eduardo-

> I vote again for Ctrl+Y to do what almost every other Windows program does. We can vote more than once right?  But seriously, I think it's easier to remap your brain once to a shortcut that works across all apps vs. having to remap it dynamically every time you task switch to another app.


In my case I don't have to remap because I almost never use redo, and when I need it, yes, I have to go to the menu because there is no shortcut for it in VB6 IDE, and I acknowledge it is a bit cumbersome not having a shortcut.
BTW, in my case I don't use Ctrl+Y in any other program for redo either.




> Maybe customizable hotkey to action mapping (similar to what MZTools offers) is what's needed.


There are already customization options for shortcuts in the vscode IDE.
I wonder if the customization file can be saved (and restored after a new installation)

----------


## WaynePhillipsEA

@Niya... there is now a restart-compiler button for you in the twinBASIC extension panel (or press Shift+Escape).
https://marketplace.visualstudio.com...asic/changelog

----------


## Niya

> @Niya... there is now a restart-compiler button for you in the twinBASIC extension panel (or press Shift+Escape).
> https://marketplace.visualstudio.com...asic/changelog


Just tested it with the code I posted in post #256 and it works great and very fast too. Barely takes a second to reload.

----------


## yereverluvinuncleber

> BTW, in my case I don't use Ctrl+Y in any other program for redo either.


In my head CTRL+Y is break, coming from a VMS background it is equivalent to CTRL+C. I could not use it for anything else it is too engrained in brain warped by old operating systems.

----------


## VB6 Programming

Niya has posted a twinBASIC Pure Win32 GUI Sample. It is a simple clock showing the power of twinBASIC even without its GUI tools.
Well worth a look.

https://www.vbforums.com/showthread....n32-GUI-Sample

----------


## Niya

> Niya has posted a twinBASIC Pure Win32 GUI Sample. It is a simple clock showing the power of twinBASIC even without its GUI tools.
> Well worth a look.
> 
> https://www.vbforums.com/showthread....n32-GUI-Sample


If you think that's impressive, wait till you see what I'm doing now. I've taken the code from that project and built a very rudimentary GUI foundation similar to what we see VB6 and WinForms in .Net. So far I've created a Form class with some basic properties and events working.

Here is some code where I'm testing the Form's position related properties:-


```
		dim f1 as new TBForm
		
		f1.Show
		
		debug.Print cstr(f1.Left)
		debug.Print cstr(f1.top)
		debug.Print cstr(f1.Width)
		debug.Print cstr(f1.Height)
```

All of this is implemented using pure Win32 with no dependencies.

----------


## VB6 Programming

Already hugely impressive even in this very early preview, twinBASIC at last offers VB6 developers the hope of a way forward.

As long-time VB6 supporter Niya  :Big Grin:  :Big Grin:  :Big Grin:   says 


> Looks like you guys are getting your new VB6 after all. You guys have been waiting decades for this. Don't let this fail now.


_
Considering the potential importance of twinBASIC as a VB6 replacement, this thread really ought to be in the main VB6 forum, not hidden away under 'Other BASIC'._

----------


## VB6 Programming

> If you think that's impressive, wait till you see what I'm doing now. I've taken the code from that project and built a very rudimentary GUI foundation similar to what we see VB6 and WinForms in .Net. So far I've created a Form class with some basic properties and events working.
> 
> All of this is implemented using pure Win32 with no dependencies.


I look forward to seeing this - and welcome to the dark side  :wave:   :Wink:

----------


## Niya

> Considering the potential importance of twinBASIC as a VB6 replacement, this thread really ought to be in the main VB6 forum, not hidden away under 'Other BASIC'.[/I]


Practically speaking I agree. I almost posted that TwinBASIC sample in the VB6 section but decided against it. TwinBASIC is technically it's own thing. Although it is 100% VB6 compatible right now, it does depart significantly from VB6 in it's extra offerings.

It's up to the moderators to decide what to do with these threads of course. Personally, I'd put them with the VB6 stuff until TwinBASIC gets powerful and popular enough to stand on it's own.

----------


## Niya

> I look forward to seeing this


I'm gonna post the code to it when I finish it. Right now, I'm having trouble deciding how far to take it. I would like to implement at least one control like a Button but I might just end up stopping with just a Form class. I'm not sure where the finish line will be but when I reach it, I'll release the code for that.  




> and welcome to the dark side


I have a deep love for doing technical stuff like this which is what makes VB6/TwinBASIC interesting for me. You don't get to do stuff like this in VB.Net because it's all been done for you already which is good for productivity but not as fun as doing it yourself. However, it doesn't pay the bills. When I'm doing real work and I need serious productivity, I will stick with modern tools like .Net and Visual Studio 2019+. TwinBASIC would also fall in this category. Language wise, TwinBASIC strikes a cord almost perfectly between the power of VB.Net and the simplicity of VB6. And the Visual Studio Code IDE is comparable to modern versions of Visual Studio. I could really see myself using TwinBASIC for smaller workloads. Even at this early stage in it's development with all the bugs and glitches still unsolved, it feels a lot better than VB6 when writing code.

----------


## VB6 Programming

*twinBASIC status update:*

https://nolongerset.com/twinbasic-up...ugust-15-2021/

The current twinBASIC version is v0.10.4378

Highlights include IntelliSense improvements, a 12-month twinBASIC roadmap, and Niya's Win32 API GUI application written in twinBASIC.

----------


## si_the_geek

> It's up to the moderators to decide what to do with these threads of course. Personally, I'd put them with the VB6 stuff until TwinBASIC gets powerful and popular enough to stand on it's own.


While TwinBasic is similar to VB6, it is different - so the VB6 forum is not right, and OtherBasic is the place.

If it becomes popular (as it looks like it might), we would certainly consider a specific forum for TwinBasic.





> Considering the potential importance of twinBASIC as a VB6 replacement, this thread really ought to be in the main VB6 forum, not hidden away under 'Other BASIC'.


That wouldn't be right I'm afraid, but feel free to post a link to this thread (along with some text if you like) in your signature, so it will be seen when people view your posts in the VB6 forum.

----------


## Niya

> While TwinBasic is similar to VB6, it is different - so the VB6 forum is not right, and OtherBasic is the place.


I thought as much.




> *twinBASIC status update:*
> 
> https://nolongerset.com/twinbasic-up...ugust-15-2021/
> 
> The current twinBASIC version is v0.10.4378
> 
> Highlights include IntelliSense improvements, a 12-month twinBASIC roadmap, and Niya's Win32 API GUI application written in twinBASIC.


Oooo...Thanks for the mention. Appreciate it.  :Thumb:

----------


## Niya

@WaynePhillipsEA

I just discovered something that could either be a breaking bug or perhaps it's nothing at all. Either way, I want to draw it to your attention.

Old school VB6 programmers know of this trick where you can pass VB6 COM object references to non-COM clients like the Win32 API. For example, if you have a Win32 or C++ API call that used callbacks, you could pass object references to the callback using this trick. The trick is to create an illegal reference to the COM object which is basically a raw pointer. You can then pass this to the API and when the API makes a callback call, you can dump that pointer back into a VB6 variable and use that variable as you would any object variable. The only catch is that COM would not be aware of this extra reference so if you allow this new variable to go out of scope without removing pointer, it could lead to disaster. I tried this trick in TwinBASIC and it works differently for a potential worrying reason. I'll post code so you can see exactly what I'm talking about**:-


```
Module MainModule
    Public Declare Sub CopyMemory Lib "Kernel32" Alias "RtlMoveMemory"	(ByVal dest As LongPtr, ByVal src As LongPtr, ByVal count As Long)
    
    Private g_cls As New Class1
    
    ' This project type is set to 'Standard EXE' in the Settings file, so you need a Main() subroutine to run when the EXE is started.
    Public Sub Main()
        
        g_cls.ShowMsg
        
        'Creates an illegal reference and let it go out of scope
        DoIllegalRef
        
        'This is not supposed to work. This would crash in VB6 and for good reason.
        'We created an illegal reference and allowed it to go out of scope which means COM
        'should have decreased the reference count and since we only have a single
        'legal reference, that would have made the reference count zero which means COM
        'should have destroyed this object. However in TwinBASIC as of v0.10.4380, this object
        'is still alive. This could mean that either TwinBASIC is smart enough to know that it was
        'an illegal reference and didn't decrease the reference count. Or it could mean there is a serious
        'bug in the TwinBASIC compiler.
        g_cls.ShowMsg
    
        
    End Sub
	
    Private Sub DoIllegalRef()
        
        'Variable to hold illegal reference to the Class1 instance in the g_cls
        'module level variable
        Dim ref As Class1
        
        'Creates an illegal reference to a Class1 object 
        'Because it was created this way, COM should not be aware of it and should not increment the
        'reference count
        CopyMemory VarPtr(ref), VarPtr(g_cls), 4
        
        ref.ShowMsg
        
        'In VB6 COM would decrease the refrence count of 
        'the Class1 object since the ref variable is about to go out of scope. 
    End Sub
    
    
End Module


Public Class Class1
    Public Sub ShowMsg()
        MsgBox ("Boo")
    End Sub
End Class
```

I describe the worrying behavior in the comments.

----------


## WaynePhillipsEA

> @WaynePhillipsEA
> 
> I just discovered something that could either be a breaking bug or perhaps it's nothing at all. Either way, I want to draw it to your attention.
> 
> Old school VB6 programmers know of this trick where you can pass VB6 COM object references to non-COM clients like the Win32 API. For example, if you have a Win32 or C++ API call that used callbacks, you could pass object references to the callback using this trick. The trick is to create an illegal reference to the COM object which is basically a raw pointer. You can then pass this to the API and when the API makes a callback call, you can dump that pointer back into a VB6 variable and use that variable as you would any object variable. The only catch is that COM would not be aware of this extra reference so if you allow this new variable to go out of scope without removing pointer, it could lead to disaster. I tried this trick in TwinBASIC and it works differently for a potential worrying reason. I'll post code so you can see exactly what I'm talking about**:-
> 
> 
> ```
> Module MainModule
> ...


The reference count is reaching zero at the correct point, and the object is being destroyed also.   However, the memory allocation routines we use are different to VB6, and so the memory block *might* still be valid for the extra call to work... or it might not... as you're still playing with fire.  Once the memory block gets reused/reissued, which depends on factors such as time and memory pressure, you will almost certainly get a crash.

BTW, if you add a Class_Terminate Sub to the class, you'll see the object get destroyed at the correct point:


```
Public Sub Class_Terminate()
   MsgBox "Destroyed!"
End Sub
```

----------


## Niya

> The reference count is reaching zero at the correct point, and the object is being destroyed also.   However, the memory allocation routines we use are different to VB6, and so the memory block *might* still be valid for the extra call to work... or it might not... as you're still playing with fire.  Once the memory block gets reused/reissued, which depends on factors such as time and memory pressure, you will almost certainly get a crash.
> 
> BTW, if you add a Class_Terminate Sub to the class, you'll see the object get destroyed at the correct point:
> 
> 
> ```
> Public Sub Class_Terminate()
>    MsgBox "Destroyed!"
> End Sub
> ```


Well that's very good news. I was concerned that TwinBASIC had some kind of bug in it's COM ABI.

Also, in case anyone who stumbles across this wonders if there is a way to make use of this trick and not get burned, there is. I don't know how other people deal with it but I came up with a way of dealing with it by essentially tricking TwinBASIC/VB6 into updating the object's reference count:-


```
	Private Function PtrToObject(ByVal ptr As Long) As Object
		'This function allows us to create a COM object from just a pointer
		'and makes sure that COM knows about it
		'****************************************************************
		Dim illegalObj As Object
		Dim legalObj As Object
		Dim zero As Long
		
		'Create an illegal reference from the pointer
		'passed into this procedure. This wouldn't increase the reference count
		'which is bad.
		CopyMemory VarPtr(illegalObj), VarPtr(ptr), 4
		
		'This assignment increases the reference count of the object
		Set legalObj = illegalObj
		
		'Zero our illegal reference so TwinBASIC doesn't try
		'to decrement the reference count when this function returns
		CopyMemory VarPtr(illegalObj), VarPtr(zero), 4
		
		'Return the legal reference
		return legalObj
	End Function
```

You can use it like this:-


```
    Dim myObject As New Class1
    
    Dim clonedRef As Class1
    
    Set clonedRef = PtrToObject(ObjPtr(myObject))
```

This method works in VB6 so I expect it would be acceptable in TwinBASIC as well.

----------


## TTn

Early integration of twinBasic with a VB.NET form designer from VB6Namespaces.  


I would like the "Set" keyword to be allowed in tB.  Otherwise code that is copy/pasted will run into issues in larger snippets with lots of object setting.

----------


## WaynePhillipsEA

> Early integration of twinBasic with a VB.NET form designer from VB6Namespaces.  
> 
> 
> I would like the "Set" keyword to be allowed in tB.  Otherwise code that is copy/pasted will run into issues in larger snippets with lots of object setting.


Looks good @TTn!    The 'Set' keyword is fully implemented.  What issue are you having with it?

----------


## TTn

> Looks good @TTn!    The 'Set' keyword is fully implemented.  What issue are you having with it?


 Looks fine now!  Thanks.  I was getting squiggles underneath, as if Set was not allowed.  I thought the interop might have been causing tB to ignore them as objects being set, since as copied/pasted VBCtl is not VB as it is in tB.  VB6 appends "Ctl" to whatever name being used.  Everything is good in the latest test though!  Thanks

----------


## WaynePhillipsEA

> Looks fine now!  Thanks.  I was getting squiggles underneath, as if Set was not allowed.  I thought the interop might have been causing tB to ignore them as objects being set, since as copied/pasted VBCtl is not VB as it is in tB.  VB6 appends "Ctl" to whatever name being used.  Everything is good in the latest test though!  Thanks


Ah ok.  Sometimes the squiggles can be on the wrong keyword, but that doesn't happen very often now.  If you see that again, hover over it and see what the error message is as it will likely be an issue with the adjacent symbol rather than the Set keyword itself.

----------


## TTn

> Ah ok.  Sometimes the squiggles can be on the wrong keyword, but that doesn't happen very often now.  If you see that again, hover over it and see what the error message is as it will likely be an issue with the adjacent symbol rather than the Set keyword itself.


 Right, that's what I thought but wasn't sure with the interop from my end.  
Update: I was in the main module when that happened, inside of a class under the MainModule.  I thought we could have more than one module per file?  No problem really, I just didn't see any restrictions until I saw the suggestion to place the class in another file.  The designed file now works in tB.

I was able to save the designed form file into tB, and use the created form with a button event responding.
If there was an easier way to save the class designer code directly into tb that would be great.  Some kind of intercommunication if possible to create a new file in vs code.  I did that manually with the clipboard, then had to replace all "VBCtl" with "VB".  No squiggles!

----------


## WaynePhillipsEA

> Right, that's what I thought but wasn't sure with the interop from my end.  
> Update: I was in the main module when that happened, inside of a class under the MainModule.  I thought we could have more than one module per file?  No problem really, I just didn't see any restrictions until I saw the suggestion to place the class in another file.  The designed file now works in tB.
> 
> I was able to save the designed form file into tB, and use the created form with a button event responding.
> If there was an easier way to save the class designer code directly into tb that would be great.  Some kind of intercommunication if possible to create a new file in vs code.  I did that manually with the clipboard, then had to replace all "VBCtl" with "VB".  No squiggles!


Yes, you can have more than one component per twin file, that's no problem.  The quick-fix suggestion is there because in the first releases of tB we only allowed a single .twin file, so devs were naturally stuffing many, many components into a single file and they wanted a quick way to split them up once we started allowing multiple .twin files.  You can safely ignore that suggestion, and tB wont mind at all.

With regards to saving the generated designer code into tB;  it seems what you really want is an extensibility API, like you have in VBA.  A simple extensibility API would be easy to implement, but the main problem would be that after making a change to a file in the tB virtual filesystem, the compiler will automatically kick in and 'reset' the debug session, including all running code and all global variables because it doesn't yet support Edit & Continue.   Until Edit & Continue is supported, we could potentially offer a feature in the extensibility API to turn off the compiler so that it simply doesn't notice the changes to the files that you've made, until your designer exits.  Needs a little more thought, but should be achievable.

----------


## TTn

> Yes, you can have more than one component per twin file, that's no problem.  The quick-fix suggestion is there because in the first releases of tB we only allowed a single .twin file, so devs were naturally stuffing many, many components into a single file and they wanted a quick way to split them up once we started allowing multiple .twin files.  You can safely ignore that suggestion, and tB wont mind at all.
> 
> With regards to saving the generated designer code into tB;  it seems what you really want is an extensibility API, like you have in VBA.  A simple extensibility API would be easy to implement, but the main problem would be that after making a change to a file in the tB virtual filesystem, the compiler will automatically kick in and 'reset' the debug session, including all running code and all global variables because it doesn't yet support Edit & Continue.   Until Edit & Continue is supported, we could potentially offer a feature in the extensibility API to turn off the compiler so that it simply doesn't notice the changes to the files that you've made, until your designer exits.  Needs a little more thought, but should be achievable.


That makes sense, it would have to be a simpler implementation at first.  It could be worth thinking about later.  I will help by exposing some events from the designer and I'll make an option to save to the clipboard for quickly transferring the designer code over to tB.  It can still save a lot of time designing the initial form starting point.  I still have to do a lot of testing to make sure all of the properties save/open correctly.

----------


## Niya

Here's a teeny tiny very minor suggestion. A better way to do this:-


```
	public function LOWORD(byval value as long) as integer
		return value and clng("&hffff")
	End Function
```

CLng is there to prevent TwinBASIC from sign extending the 2 byte Integer form of &hFFFF to a 4 byte Integer of value &hFFFFFFFF when we actually want &h0000FFFF

This exact function in VB.Net would look like this:-


```
    Public Function LOWORD(ByVal value As Integer) As Short
        Return value And &HFFFFI
    End Function
```

VB.Net allows you to specify the data type of that hex value with a suffix, which in this case is the letter I. This means it's not going to sign extend a 2 byte Integer to a 4 byte integer, since it starts with a 4 byte Integer.

Again, this is just a minor suggestion and not something I would consider an immediate concern. I just think using CLng on a String on like that for this is a bit wild. It just reeks of a kind of dirtiness that is a bit uncomfortable.

----------


## WaynePhillipsEA

> Here's a teeny tiny very minor suggestion. A better way to do this:-
> 
> 
> ```
> 	public function LOWORD(byval value as long) as integer
> 		return value and clng("&hffff")
> 	End Function
> ```
> 
> ...


Ney Niya, you can do the same in tB (and VB6), by appending the Long suffix character, &:
&HFFFF&

----------


## Niya

> Ney Niya, you can do the same in tB (and VB6), by appending the Long suffix character, &:
> &HFFFF&


Ah. Sweet. That never occurred to me to try that. I feel dumb for that  :Frown:

----------


## Niya

Found some more problems with the intellisense. It doesn't seem to work when writing code inside a generic class. The colour coding for identifiers, keyworsd etc also gets a bit screwed up sometimes. Example:-



```
Private Class List(Of T)
	
	Private Const INITIAL_SIZE As Long = 10
	Private g_items() As T
	Private g_count As long
	
	Public Sub new()
		Init(INITIAL_SIZE)
	End Sub

	Public Sub new(capacity As Long)
		Init(capacity)
	End Sub
	
	Public Sub Add(ByVal item As T)
		g_items(g_count) = item
		
		g_count += 1
		
		Me.ResizeArrayIfNeeded()
	End Sub
	
	Public Sub RemoveItem(ByVal index As Long)
		Dim i As Long
		Dim x As Long
		Dim newArray() As T
		
		ReDim newArray(0 To (Me.SizeOfArray - 1))
		
		For i = 0 To Me.Count - 1
			If i = index Then Continue For
			
			newArray(x) = g_items(i)
			x += 1
		Next
		
		g_count -= 1
		
		'TODO: Find out of TwinBASIC actually copies the array element by element
		'or simply replaces array references like VB.Net does. If it does a full copy
		'then we will need to optimize this. No sense in having to traverse the array
		'twice for a remove operation
		g_items = newArray
	End Sub
	
	Public Property Get Count() As Long
		Return g_count
	End Property
	
	Public Property Get Items(ByVal index As Long) As T
		Return g_items(index)
	End Property
	
	Private Function SizeOfArray() As Long
		Return UBound(g_items) - LBound(g_items) + 1
	End Function
	
	Private Sub ResizeArrayIfNeeded()
		Dim sz As Long = Me.SizeOfArray()
		
		If g_count = sz Then ReDim Preserve g_items(0 To (sz * 2) - 1)
	End Sub
	
	Private Sub Init(ByVal capacity As Long)
		ReDim g_items(0 To capacity - 1)
	End Sub
	
	
End Class
```

While writing that code, the intellisense was completely asleep. For example Me. wasn't giving me the list of class methods already written like it usually does in a non-generic class.

Good work on generics by the way. It works fantastic otherwise.

----------


## Niya

I just ran into a problem caused by the old world of VB6 clashing head first into the new world of TwinBASIC:-


```
Module MainModule

    ' This project type is set to 'Standard EXE' in the Settings file, so you need a Main() subroutine to run when the EXE is started.
    Public Sub Main()
        
        Dim oc1 As OtherClass(Of String) = New OtherClass(Of String)
        Dim oc2 As OtherClass(Of Long) = New OtherClass(Of Long)
        Dim oc3 As OtherClass(Of Person) = New OtherClass(Of Person)
        
        oc1.SomeMethod("KL")
        oc2.SomeMethod(34)
        
        'This fails at runtime because the generic class
        'cannot handle non-Object types internally
        oc3.SomeMethod(New Person("John"))
        
        
    End Sub
    
End Module

Private Class OtherClass(Of T)
    
    Private g_myField As T
    
    Public Sub SomeMethod(ByVal value As T)
        
        'This will fail if T is ever an Object type
        'TwinBASIC, like VB6 requires that object assignment be done
        'with the Set keyword. I've tried a number of approaches but
        'found no way to coerce a 1 size fits all way of doing this.
        g_myfield = value
    End Sub
    
End Class
    
Private Class Person
    Public PersonName As String
    
    Public Sub New(ByVal n As String)
        Me.PersonName = n
    End Sub
    
End Class
```

The above code reproduces a problem with generics with it's relationship to TwinBASIC/VB6's class system. It seems a generic class cannot be authored to work with both object and non-object types if the internals of the class performs any kind of assignment of the type. TwinBASIC requires that assignment of Object types to variables be done with the Set keyword and non-Object assignments be done with an implicit or explicit Let. What this means is that a generic class can either work with Objects or non-Object. I've tried a number things to discover a workaround including involving Variants but nothing works. The only work around is to have two versions of the class, one for Objects and one for non-Objects.

If I may be so bold to make a tiny suggestion. Make the Set keyword optionally explicit like Let when object assignment is being performed. After using VB.Net for a number of years I can say with 100% certainty that there is zero benefit to demanding explicit use of a Set keyword or anything like it for object assignment. We are perfectly fine assigning objects using normal assignment syntax. It was never needed and whatever degenerate at Microsoft thought this was a good idea needs some jail time for this crime  :Mad: . By making it optionally explicit, you can solve problems like what I described above and maintain backward compatibility with VB6 at the same time.

----------


## WaynePhillipsEA

> Found some more problems with the intellisense. It doesn't seem to work when writing code inside a generic class. The colour coding for identifiers, keyworsd etc also gets a bit screwed up sometimes. Example:-
> 
> 
> 
> ```
> Private Class List(Of T)
> 	
> 	Private Const INITIAL_SIZE As Long = 10
> 	Private g_items() As T
> ...


Glad you like it Niya.  Intellisense / semantic highlighting being missing for generics is a known issue.  We had to turn off those bits for the preview as there were too many unresolved issues at the time.   We shall revisit that soon, since as you rightly point out generics themselves are working pretty well, but without the intellisense and semantic highlighting they are difficult to work with.

----------


## WaynePhillipsEA

> I just ran into a problem caused by the old world of VB6 clashing head first into the new world of TwinBASIC:-
> 
> 
> ```
> Module MainModule
> 
>     ' This project type is set to 'Standard EXE' in the Settings file, so you need a Main() subroutine to run when the EXE is started.
>     Public Sub Main()
>         
> ...


We can't make Set optional since in classic VB it is valid to do things like 

```
MyVariant = MyObject
```

 where the semantics are different to 

```
Set MyVariant = MyObject
```

.  In the first version, the default member of MyObject is evaluated (DISPID_VALUE), and in the second version it is not.  One of the reasons they were able to remove the Set keyword requirement in VB.NET is because they don't support default member evaluation in VB.NET like classic VB does.

In your example, you could check for IsObject(value) and then use Set assignment, otherwise defer to Let-assignment.  However, I could see this being a common issue in generics, and so it might be worth thinking of an alternative solution, such as introducing another keyword instead of Set that will decide to do either Set-assignment or Let-assignment based on the RHS type.  That would be a compile time decision and so offer slightly better performance than branching on IsObject() at runtime.

----------


## wqweto

> Well that's very good news. I was concerned that TwinBASIC had some kind of bug in it's COM ABI.
> 
> Also, in case anyone who stumbles across this wonders if there is a way to make use of this trick and not get burned, there is. I don't know how other people deal with it but I came up with a way of dealing with it by essentially tricking TwinBASIC/VB6 into updating the object's reference count:-
> 
> 
> ```
> 	Private Function PtrToObject(ByVal ptr As Long) As Object
> 		'This function allows us to create a COM object from just a pointer
> 		'and makes sure that COM knows about it
> ...


In VB6 we usually directly use vbaObjSetAddref export from msvbvm60 to hydrate weakrefs (raw ObjPtr pointers) like this



```
Private Declare Function vbaObjSetAddref Lib "msvbvm60" Alias "__vbaObjSetAddref" (oDest As Any, ByVal lSrcPtr As Long) As Long

Public Function PtrToObject(ByVal ptr As Long) As Object
    Call vbaObjSetAddref(PtrToObject, ptr)
End Function
```

. . . which automagically takes care of the refcount staying correct.

Implementing this as an intrinsic function on LongPtr data-type in TB would be most welcome of course but it's probably very low on the nice-to-have features currently.

Baking it into the language with Set obj = ptr where ptr is of LongPtr data-type would be awesome.

cheers,
</wqw>

----------


## WaynePhillipsEA

> In VB6 we usually directly use vbaObjSetAddref export from msvbvm60 to hydrate weakrefs (raw ObjPtr pointers) like this
> 
> 
> 
> ```
> Private Declare Function vbaObjSetAddref Lib "msvbvm60" Alias "__vbaObjSetAddref" (oDest As Any, ByVal lSrcPtr As Long) As Long
> 
> Public Function PtrToObject(ByVal ptr As Long) As Object
>     Call vbaObjSetAddref(PtrToObject, ptr)
> ...


That reminds me that we will need to redirect DLL calls into msvbvm60 to our own implementations so that we can support them when we switch on 64-bit support (as well as remove the reliance on msvbvm60)

----------


## Niya

> We can't make Set optional since in classic VB it is valid to do things like 
> 
> ```
> MyVariant = MyObject
> ```
> 
>  where the semantics are different to 
> 
> ```
> ...


Damn. That's too bad. Even in the old days when I used VB6 primarily, I hated the Set statement with a passion. It was always a source of confusion and disarray. You had this constant mental burden of remembering to use Set when assigning objects. It always drove me absolutely bonkers, especially when I forget to use it. This was one of the things I was hoping would disappear in TwinBASIC. 




> In your example, you could check for IsObject(value) and then use Set assignment, otherwise defer to Let-assignment.


I was looking for something like that. I tried all kinds of shenanigans with TypeOf. I completely forgot that VB6 had an IsObject function. Come to think of it, as I'm writing this post, I just realized I could have also solved this using TypeName, which I did remember exist since I use it all the time, even in VB.Net. I could have called TypeName on all the primitive types/built in types and if there was no match, it would mean the type is an Object. Sort of an ad-hoc way of doing IsObject. That didn't occur to me till just now.




> However, I could see this being a common issue in generics, and so it might be worth thinking of an alternative solution, such as introducing another keyword instead of Set that will decide to do either Set-assignment or Let-assignment based on the RHS type.  That would be a compile time decision and so offer slightly better performance than branching on IsObject() at runtime.


IsObject is not the only issue. This solution also requires that you use Variants internally:-


```
Private Class OtherClass(Of T)
    
    'The TwinBASIC compiler complains if this is of type T
    Private g_myField As variant
    
    Public Sub SomeMethod(ByVal value As T)
            
        if isobject(value) then 
            set g_myfield=value
        else
            g_myfield=value                                   
        End If
        
    End Sub
```

It's a little dirty but it's definitely worth it for a powerful feature like generics. I have every confidence you will find ways to clean it up eventually. Keep doing your good work.

----------


## wqweto

Is it possible to declare Private g_myField As T instead of Variant?

Assigning to this member variable would be problematic though as it would need a "compile-time IsObject" for parameter type or even (better) an IsObject(T) construct to test the data-type of the typename (or whatever the T parameter to the generic is called in TB:-)).

cheers,
</wqw>

----------


## WaynePhillipsEA

> Is it possible to declare Private g_myField As T instead of Variant?
> 
> Assigning to this member variable would be problematic though as it would need a "compile-time IsObject" for parameter type or even (better) an IsObject(T) construct to test the data-type of the typename (or whatever the T parameter to the generic is called in TB:-)).
> 
> cheers,
> </wqw>


Eventually I would like to see something akin to if-constexpr support as seen in C++ so that the compiler is required to deduce whether a block is needing to be compiled.  But for this my proposal is a simpler solution:



```
Private Class OtherClass(Of T)
    
    Private g_myField As T
    
    Public Sub SomeMethod(ByVal value As T)
        AutoSet g_myField = value
    End Sub
```

I don't particularly like the 'AutoSet' name, but you get the idea.  The keyword would be implemented much like how Dim initializers already work in tB:  if either the LHS variable or the RHS expression is an explicit object type, then AutoSet causes a set-assignment, otherwise let-assignment is used.

----------


## Krool

My proposal would be LetOrSet statement.
Thus the statement tells already whats going on. Either a Let or Set statement. (Though Let is optional and seldom used)

----------


## WaynePhillipsEA

> My proposal would be LetOrSet statement.
> Thus the statement tells already whats going on. Either a Let or Set statement. (Though Let is optional and seldom used)


LetOrSet works for me!

----------


## Niya

> Is it possible to declare Private g_myField As T instead of Variant?


You must have missed the comment in my code. I said that the TwinBASIC compiler complains about that:-


I'm guessing that the TwinBASIC compiler expands generics into non-generic classes of each type based on what types you have defined in the application. In this case, when it expands into a String type, the compiler complains about Set being used to assign a String. It would be the same as doing this:-


```
Private Class OtherClass(Of T)
    
    'Same as using T since we have declared String versions of this class
    Private g_myField As String
    
    Public Sub SomeMethod(ByVal value As T)
            
        if isobject(value) then 
            set g_myfield=value
        else
            g_myfield=value                                   
        End If
        
    End Sub
    
End Class
```

It only works for all types if the field is a Variant.

----------


## wqweto

> It only works for all types if the field is a Variant.


Yes, the if isobject(T) then part has to be executed at compile time and act like a preprocessor so that the invalid statements are not compiled at all.

The idea is for LetOrSet to wrap this comptime logic but a more universal solution has to be researched/borrowed from .Net or C++ depending on which of these is closer as generics implementation (probably .Net).

Btw, using As Variant instead of As T defeats the idea of generics. Currently built-in Collections use Variant as a way of duck-typing it. The idea of ListOf(T) is to not only expose strongly typed Item (indexed) property but to use an array of pointers to T internally for performance/storage reasons too.

cheers,
</wqw>

----------


## Eduardo-

> My proposal would be LetOrSet statement.
> Thus the statement tells already whats going on. Either a Let or Set statement. (Though Let is optional and seldom used)


What about Assign?

----------


## Niya

I just figured out a way to avoid the TwinBASIC compiler and allow me to use type T as a field:-


```
Private Class OtherClass(Of T)
    
    Private g_myField As T
    
    Public Sub SomeMethod(ByVal value As T)
        
        If isobject(value) Then
            'We have to do a song and dance to avoid the TwinBASIC compiler
            '***********************************************************
            dim objPtr as longptr
            
            'Get object pointer
            CopyMemory(varptr(objptr),varptr(value),4)
            
            'Call AddRef on the object through its pointer
            AddRef(objPtr)
            
            'Dump the object pointer directly into the class
            'member field
            CopyMemory varptr(g_myfield),varptr(objptr),4
        Else
          g_myField = value
        End If
    End Sub

    private sub AddRef(byval objPtr as longptr)
        'Roundabout way of calling AddRef
        dim obj as object=PtrToObject(objptr)
        dim zero as long=0
        
        'Prevents TwinBASIC from decrementing the reference count
        'when this sub returns
        CopyMemory VarPtr(obj), VarPtr(zero), 4
    End Sub
    
End Class
```

----------


## Niya

Here's a version using wqweto's method from post 315:-


```
Private Class OtherClass(Of T)
    
    Private g_myField As T
    
    Public Sub SomeMethod(ByVal value As T)
        
        If isobject(value) Then
            'We have to do a song and dance to avoid the TwinBASIC compiler
            '***********************************************************
            dim objPtr as longptr
            
            'Get object pointer
            CopyMemory(varptr(objptr),varptr(value),4)
            
            'AddRef the object by it's pointer and dump that pointer
            'into the field
            vbaobjsetaddref(g_myfield,objptr)
        Else
          g_myField = value
        End If
    End Sub

    
End Class
```

----------


## mansellan

> What about Assign?


FWIW, I very much prefer Assign.

----------


## SearchingDataOnly

> Originally Posted by Krool
> 
> 
> My proposal would be LetOrSet statement.
> Thus the statement tells already whats going on. Either a Let or Set statement. (Though Let is optional and seldom used)
> 
> 
> LetOrSet works for me!


How about *Let_Set* or *LetSet* (I prefer *LetSet*)

Edit:
In addition, VBA occupies a very good keyword LSet. If VBA.LSet is not considered, we can merge Let and Set into LSet, and then replace VBA.LSet with other function. Of course, this is just an unrealistic idea.

Edit2:
If LSet cannot be used, maybe we can use *SLet*. It seems that *LetSet* is more intuitive.

----------


## Niya

I'm really not feeling any of those to be honest. I mean all of it, not just the ones SD mentioned above. I really do not like the idea needing an extra construct for assigning Objects when a normal assignment expression would suffice.

Now since it cannot be removed due to the quirk with Variant assignments mentioned here, I propose.....drum roll please.......*Option Set Off*

I propose the introduction of a new member to the Option Explicit family. When used it will make Set implicit in the code file whenever an object assignment is performed. With this method we can effectively remove this abomination from TwinBASIC at our convenience while also maintaining full backward compatibility with VB6 since it will be on by default. VB6 projects obviously won't have this option set since it didn't exist in VB6. And as a bonus, we can still get all those fancy keywords you guys suggested above for those of you that actually want this. Personally though, I'd like the option to get rid of that garbage whenever I want. Seriously, using Set makes me want to drive molten nails into my skull. Just my opinion.

----------


## SearchingDataOnly

> I'm really not feeling any of those to be honest. I mean all of it, not just the ones SD mentioned above. I really do not like the idea needing an extra construct for assigning Objects when a normal assignment expression would suffice.
> 
> Now since it cannot be removed due to the quirk with Variant assignments mentioned here, I propose.....drum roll please.......*Option Set Off*
> 
> I propose the introduction of a new member to the Option Explicit family. When used it will make Set implicit in the code file whenever an object assignment is performed. With this method we can effectively remove this abomination from TwinBASIC at our convenience while also maintaining full backward compatibility with VB6 since it will be on by default. VB6 projects obviously won't have this option set since it didn't exist in VB6. And as a bonus, we can still get all those fancy keywords you guys suggested above for those of you that actually want this. Personally though, I'd like the option to get rid of that garbage whenever I want. Seriously, using Set makes me want to drive molten nails into my skull. Just my opinion.


Like you, I hate the Set keyword. But the question is, how do you deal with the default value of an object? Do you want to tell everyone not to use the default value?




> We can't make Set optional since in classic VB it is valid to do things like 
> 
> ```
> MyVariant = MyObject
> ```
> 
>  where the semantics are different to 
> 
> ```
> ...

----------


## WaynePhillipsEA

How about a slightly different operator to control that behaviour instead of LetSet/Assign?



```
MyObject1 := MyObject2
```

----------


## Krool

> How about *Let_Set* or *LetSet* (I prefer *LetSet*)
> 
> Edit:
> In addition, VBA occupies a very good keyword LSet. If VBA.LSet is not considered, we can merge Let and Set into LSet, and then replace VBA.LSet with other function. Of course, this is just an unrealistic idea.
> 
> Edit2:
> If LSet cannot be used, maybe we can use *SLet*. It seems that *LetSet* is more intuitive.


LSet is not a shortcut for LetSet. There also exist RSet.
So instead it means Left/Right. (for strings)

----------


## Niya

> Like you, I hate the Set keyword. But the question is, how do you deal with the default value of an object? Do you want to tell everyone not to use the default value?


This is why I said it should be a compiler option like Option Explicit, so you have the choice to opt in or not. You will never see me writing code like that. If I want a property value from an object, I will explicitly call the property. I have zero need for Set. It's just an extra mental burden that gives no extra value. Using Set is like paying your taxes and not getting your roads built and repaired.

----------


## Niya

> How about a slightly different operator to control that behaviour instead of LetSet/Assign?
> 
> 
> 
> ```
> MyObject1 := MyObject2
> ```


I like this option best. It makes a lot more sense and it's less verbose.

EDIT:

Also, what would be even better is if := behaves like a normal assignment when it's not assigning an Object. People like me could default to using it for most assignments. I like consistency. I don't like having to always think about how I'm performing an assignment.

Also, I've been wondering. Is the Variant/Default property thing the only reason Set cannot be removed?

----------


## WaynePhillipsEA

> I like this option best. It makes a lot more sense and it's less verbose.
> 
> EDIT:
> 
> Also, what would be even better is if := behaves like a normal assignment when it's not assigning an Object. People like me could default to using it for most assignments. I like consistency. I don't like having to always think about how I'm performing an assignment.
> 
> Also, I've been wondering. Is the Variant/Default property thing the only reason Set cannot be removed?


The proposed := assignment would behave as earlier discussed about the LetOrSet keyword (i.e. if either side is an explicit object, then Set-assignment is used, else defer to Let-assignment).

Off the top of my head I can't think of anything other than default-member evaluation that prevents the removal of the Set keyword.  By the way, it's not just the Variant example I gave earlier, there's lots of examples, e.g. 'MyObject1 = MyObject2' is valid in classic VB if there's a property-let default member on MyObject1 (or even a property-get default-member that returns an object that itself has a property-let default member)...   it's a minefield, and it's heavily baked into the language.

----------


## SearchingDataOnly

> LSet is not a shortcut for LetSet. There also exist RSet.
> So instead it means Left/Right. (for strings)


Yes, I know this.

----------


## SearchingDataOnly

> How about a slightly different operator to control that behaviour instead of LetSet/Assign?
> 
> 
> 
> ```
> MyObject1 := MyObject2
> ```


Excellent. It is exactly the way I use it in my scripting language (my scripting language has removed the Set keyword)

In my scripting language, "*:=*" has two uses:
(1) Exempt variable declarations (similar to Golang), for example:
var1 := getMyVaraible        *'--- var1 does not require variable declaration*

(2) Get the default value of an object
myDefaultValue := myObject

Note:
If myDefaultValue is declared, then myDefaultValue is used to get the default value of myObject. If myDefaultValue is not declared, then myDefaultValue is the object reference of myObject.
But this point is easy to cause ambiguity, so I'm considering whether my scripting language retains the feature of the default value of the object.

----------


## wqweto

How about augmenting the preprocessor to understand comptime expressions so this would compile



```
        #If isobject(T) Then 
            set g_myfield=value
        #Else
            g_myfield=value                                   
        #End If
```

. . . as a generic solution instead of introducing any (piecemeal) language constructs.

Currently VBx preprocessor is able to understand *some* expressions containing arith operators and type conversion functions (CLng, etc.) so adding support for more functions/constructs here is not surprising, provided that generics source code is not expected to be round-tripped to VBx in first place.

cheers,
</wqw>

----------


## WaynePhillipsEA

> How about augmenting the preprocessor to understand comptime expressions so this would compile
> 
> 
> 
> ```
>         #If isobject(T) Then 
>             set g_myfield=value
>         #Else
>             g_myfield=value                                   
> ...


Unfortunately we wouldn't be able to make that work.  Generics work off the parse trees, but the preprocessor strips out code before it even gets parsed.

We would literally need the equivalent to the C++ if-constexpr to make it work like that:


```
        IfConst isobject(T) Then 
            set g_myfield=value
        Else
            g_myfield=value                                   
        End If
```

----------


## wqweto

> . . . but the preprocessor strips out code before it even gets parsed.


How do you syntax highlight code inside branches of the preprocessor #If then?

I see what the problem is but I always hated how C++/Zig implement IfConst like normal expressions with no clear marking what is evaluated at compile time and what not. Much worse than the way #If and the rest of the VB6 (and C/C++) preprocessor directives are obvious and human readable.

cheers,
</wqw>

----------


## WaynePhillipsEA

> How do you syntax highlight code inside branches of the preprocessor #If then?


In tB, we don't, we just grey-out the whole block. In VBx it is slightly different because they have a tokenizer stage that runs before the real parse run, which allows for highlighting of keywords and some syntax errors, but ultimately the code doesn't get to the fully parsed stage.  You can see this if you enter illegal code in an #If block that isn't included;  VBx will highlight some syntax errors in the tokenizer stage through the IDE (highlighted red), but the parser/resolver/compiler doesn't see them, and compilation can succeed regardless.

----------


## Schmidt

Since Niya brought up the "generics-example"...

 I've modified it a bit, to (primarily) point out a different "nice to have" feature
 (which would be great, if it was introduced).



```
Module modHelloRC6
  Public New_c As New cConstructor
 
  Sub Main()
    Dim Longs   As cArrayList = New_c.ArrayList(vbLong, 1, 2, 3)
    Dim Persons As cArrayList = New_c.ArrayList(vbObject, New cPerson("John"))
  
    Dim L As Long '<- tB does "For Each Auto-Coercing from Variant" already, also with simple types
    For Each L In Longs
        Debug.Print L
    Next
 
    Dim P As cPerson '<- this would work also in VBA/VB6, whereas the above "L As Long" wouldn't
    For Each P In Persons
        Debug.Print P.Name
    Next
  End Sub
End Module

Private Class cPerson
  Public Name As String
  Public Sub New(ByVal Name As String)
      Me.Name = Name
  End Sub
End Class
```

So, whilst the above Code will work "as it is" in tB already (when an RC6-reference is included) - 
I'd like to be able to have "LoopVar-TypeInitializers in For- and For-Each Loops, like below:


```
Module modHelloRC6
  Public New_c As New cConstructor
 
  Sub Main()
    Dim Longs   As cArrayList = New_c.ArrayList(vbLong, 1, 2, 3)
    Dim Persons As cArrayList = New_c.ArrayList(vbObject, New cPerson("John"))
  
    For Each L As Long In Longs
        Debug.Print L
    Next
 
    For Each P As cPerson In Persons
        Debug.Print P.Name
    Next
  End Sub
End Module

Private Class cPerson
  Public Name As String
  Public Sub New(ByVal Name As String)
      Me.Name = Name
  End Sub
End Class
```

Olaf

----------


## Eduardo-

> How about a slightly different operator to control that behaviour instead of LetSet/Assign?
> 
> 
> 
> ```
> MyObject1 := MyObject2
> ```


FWIW, I strongly discourage to introduce not "BASICish" syntax like that.
One of the main features and advantage of BASIC is that it can be understood almost "without studing", BASIC is almost English. It is intuitive.

What does ":=" mean? (intuitively)
"I don't know".

----------


## SearchingDataOnly

@WaynePhillipsEA,

I'd like to know how twinBasic implements JavaScript-like inline-functions(Callback), for example:



```
//Basic forEach
function forEach(array, action) {
    for (var i = 0; i < array.length; i++) {
	action(array[i])
    }
}

// Test forEach
forEach(["Pear", "Apple"], function(name) {
    console.log(name);
});

// Implement reduce
function reduce(combine, base, array) {
    forEach(array, function(element) {
	base = combine(base, element);
    });
    return base;
}
```

Another famous example is C++ *qsort*.

----------


## WaynePhillipsEA

> FWIW, I strongly discourage to introduce not "BASICish" syntax like that.
> One of the main features and advantage of BASIC is that it can be understood almost "without studing", BASIC is almost English. It is intuitive.
> 
> What does ":=" mean? (intuitively)
> "I don't know".


Upon reflection, I think you're spot on, and I've rejected other proposed features for those exact reasons.  I was purely trying to think of alternatives we hadn't considered, but you are right that this one is not BASIC-esque.

----------


## WaynePhillipsEA

> Since Niya brought up the "generics-example"...
> 
>  I've modified it a bit, to (primarily) point out a different "nice to have" feature
>  (which would be great, if it was introduced).
> 
> 
> 
> ```
> Module modHelloRC6
> ...


I like this idea Olaf, and I can't foresee it causing any clashes with existing syntax, so that's definitely a possibility.

It would also be nice if the declared variable was scoped only to the For block, rather than the procedure-scope.

----------


## WaynePhillipsEA

> @WaynePhillipsEA,
> 
> I'd like to know how twinBasic implements JavaScript-like inline-functions(Callback), for example:
> 
> 
> 
> ```
> //Basic forEach
> function forEach(array, action) {
> ...


Yes, Delegate-style function pointers are planned: https://github.com/WaynePhillipsEA/twinbasic/issues/79

----------


## WaynePhillipsEA

This single thread is getting quite long already.  Shame we can't get our own twinBASIC sub-forum here.

----------


## Schmidt

> I like this idea Olaf, and I can't foresee it causing any clashes with existing syntax, so that's definitely a possibility.
> 
> It would also be nice if the declared variable was scoped only to the For block, rather than the procedure-scope.


I've thought about that ("For block-scoping") as well, 
but would rather the scoping remains at function-level, due to constructs like the one below:



```
  'the construct here will only be possible, when P As Person would be scoped to Method-level
  For Each P As cPerson In Persons
    If P.Name = SomeNameToSearch Then Exit For
  Next
  
  If P Is Nothing Then 'P is re-initialized to Nothing, when the loop was "running its full course" (no match found)
    Debug.Print SomeNameToSearch & " was not found!"
  Else 'P is only different from Nothing, when the loop was exited early (via Exit For, because of a match)
    Debug.Print SomeNameToSearch & " was found!"
  End If
```

Difficult decision to make (both "scopings" have advantages) - but the stuff shown above is quite common (at least in my code).

Olaf

----------


## WaynePhillipsEA

> I've thought about that ("For block-scoping") as well, 
> but would rather the scoping remains at function-level, due to constructs like the one below:
> 
> 
> 
> ```
>   'the construct here will only be possible, when P As Person would be scoped to Method-level
>   For Each P As cPerson In Persons
>     If P.Name = SomeNameToSearch Then Exit For
> ...


That's true actually, and will save me from having to make any changes to the scoping  :Smilie:

----------


## mansellan

> I've thought about that ("For block-scoping") as well, 
> but would rather the scoping remains at function-level, due to constructs like the one below:
> 
> 
> 
> ```
>   'the construct here will only be possible, when P As Person would be scoped to Method-level
>   For Each P As cPerson In Persons
>     If P.Name = SomeNameToSearch Then Exit For
> ...


Counter-argument would be that .Net does scope inline declarations like this to the block, and it's occasionally quite nice to be able to reuse a name within the wider scope. For the times when you need the wider scope, you can just declare above the block as before.

I'm ambivilant as to which is best for tB though.

----------


## Niya

GUYS I HAVE FINALLY SOLVED IT!!!

Ok, to recap what I'm talking about for anyone just coming in. Yesterday I raised an issue with the Set keyword clashing with generics in TwinBASIC. Writing generic classes that perform assignments internally created situation where a generic class could not work for both classes and non-classes like Longs, Strings etc as the generic type. This was because assignment between class type variables needed to be performed with the Set keyword and assignment between non-class types must be performed without them. There was no way to perform an assignment that works with both types of assignment.

After much discussion in this thread about it, Wayne Phillips pointed out that I could use IsObject to test whether a variable was an object or not and the program can use that information to decide how to perform the assignment. I tried it and it seemed to work in a little scratch pad application I wrote to specifically test it. I thought I had a workable solution. I went into what I was actually using this for which is a List(Of T) and HashTable(Of String,TValue) implementation I'm working on which is going to be 100% written in TwinBASIC code with no external dependencies. When I went back to the List(Of T) code to implement the IsObject solution, it failed. Turns out that for some reason it doesn't work when the assignments involved arrays of type T. Having already spent the better part of the day already on this, I was too burnt out to start this all over again in an attempt to figure out why arrays are now a problem.

The overall problem was that the TwinBASIC compiler is determined not to allow assignments to be perform with the wrong statement, Let for non-objects variable and Set for object variables. If the compile even smells a possibility of this happening, it will complain. I did come up with a way around it by using a bunch on pointer tricks but they are just curiosities. These tricks are only good for showing off and not good for actual use. I went to bed last night defeated. I wrote it off generics as usable until this thing with Set could be sorted out.

But for some reason when I got up today, I decided to give it one more try and I don't know if it was the sleep I needed or what but in 5 minutes, I came up with a way to solve this problem entirely by removing Set from the equation altogether and it didn't involve any fancy tricks with pointers or anything like this. Turns out you can bypass Set completely with a very easy method. Use a function like this:-


```
    Private Sub SetVarValue(ByRef varToSet As Variant, ByVal value As Variant)
        varToSet = value
    End Sub
```

I'm not even sure why that works as well as it does but it works. That function will allow you to perform an assignment to a variable regardless of if an Object is being assigned or not. Here is the full test program:-


```
Module MainModule

    ' This project type is set to 'Standard EXE' in the Settings file, so you need a Main() subroutine to run when the EXE is started.
    Public Sub Main()
        
        Dim objVal As TestClass = New TestClass
        Dim strVal As String = "BOO!"
        Dim lngVal As Long = 29
        
        Dim objVar As TestClass
        Dim strVar As String
        Dim lngVar As Long
        
        SetVarValue(objVar, objVal)
        SetVarValue(strVar, strVal)
        SetVarValue(lngVar, lngVal)
        
        Debug.Print objVar.Value
        Debug.Print strVar
        Debug.Print lngVar
        
    
    End Sub
	
    Private Sub SetVarValue(ByRef varToSet As Variant, ByVal value As Variant)
        varToSet = value
    End Sub

    
End Module

Private Class TestClass
    
    Public Sub new()
        
    End Sub
    
    Public Property Get Value() As String
        Return "Class Property Value"
    End Property
    
End Class
```

I popped that into the List(Of T) class I'm writing and it works. The List(Of T) class can now work with both class and non-class types with no problem. And it has no problem working with arrays.

----------


## WaynePhillipsEA

> GUYS I HAVE FINALLY SOLVED IT!!!
> 
> Ok, to recap what I'm talking about for anyone just coming in. Yesterday I raised an issue with the Set keyword clashing with generics in TwinBASIC. Writing generic classes that perform assignments internally created situation where a generic class could not work for both classes and non-classes like Longs, Strings etc as the generic type. This was because assignment between class type variables needed to be performed with the Set keyword and assignment between non-class types must be performed without them. There was no way to perform an assignment that works with both types of assignment.
> 
> After much discussion in this thread about it, Wayne Phillips pointed out that I could use IsObject to test whether a variable was an object or not and the program can use that information to decide how to perform the assignment. I tried it and it seemed to work in a little scratch pad application I wrote to specifically test it. I thought I had a workable solution. I went into what I was actually using this for which is a List(Of T) and HashTable(Of String,TValue) implementation I'm working on which is going to be 100% written in TwinBASIC code with no external dependencies. When I went back to the List(Of T) code to implement the IsObject solution, it failed. Turns out that for some reason it doesn't work when the assignments involved arrays of type T. Having already spent the better part of the day already on this, I was too burnt out to start this all over again in an attempt to figure out why arrays are now a problem.
> 
> The overall problem was that the TwinBASIC compiler is determined not to allow assignments to be perform with the wrong statement, Let for non-objects variable and Set for object variables. If the compile even smells a possibility of this happening, it will complain. I did come up with a way around it by using a bunch on pointer tricks but they are just curiosities. These tricks are only good for showing off and not good for actual use. I went to bed last night defeated. I wrote it off generics as usable until this thing with Set could be sorted out.
> 
> But for some reason when I got up today, I decided to give it one more try and I don't know if it was the sleep I needed or what but in 5 minutes, I came up with a way to solve this problem entirely by removing Set from the equation altogether and it didn't involve any fancy tricks with pointers or anything like this. Turns out you can bypass Set completely with a very easy method. Use a function like this:-
> ...


Don't get too excited... that looks like a bug in tB, as it should be trying to call the default prop-let member in that assignment inside SetVarValue if the LHS is an object type.   That will be fixed very soon, and then your code will break.

You could put the IsObject check into the SetVarValue call to switch between the two types of assignments, and that should satisfy the compiler and be correct.  Though of course you are passing the values through Variants for that to work, which as @wqweto mentioned earlier, goes against what you're trying to achieve by using generics.



```
Private Sub SetVarValue(ByRef varToSet As Variant, ByVal Value As Variant)
    If IsObject(varToSet) Then
        Set varToSet = Value
    Else
        varToSet = Value
    End If
End Sub
```

----------


## Eduardo-

BTW, this code:



```
        SetVarValue(objVar, objVal)
        SetVarValue(strVar, strVal)
        SetVarValue(lngVar, lngVal)
```

is also not allowed in VB6 (arguments in parentheses without the Call keyword).

----------


## WaynePhillipsEA

> BTW, this code:
> 
> 
> 
> ```
>         SetVarValue(objVar, objVal)
>         SetVarValue(strVar, strVal)
>         SetVarValue(lngVar, lngVal)
> ```
> ...


It is allowed in tB though, whilst retaining full backwards compatibility.  See the discussion:

https://github.com/WaynePhillipsEA/twinbasic/issues/262

----------


## si_the_geek

> This single thread is getting quite long already.  Shame we can't get our own twinBASIC sub-forum here.


It is fine to create multiple threads in Other Basic, then if/when a twinBASIC forum is created I (or other moderators) will move the threads across.

----------


## Eduardo-

> It is allowed in tB though, whilst retaining full backwards compatibility.  See the discussion:
> 
> https://github.com/WaynePhillipsEA/twinbasic/issues/262


Ah, OK, then could we say that now the Call keyword is entirely optional/obsolete?

----------


## WaynePhillipsEA

> It is fine to create multiple threads in Other Basic, then if/when a twinBASIC forum is created I (or other moderators) will move the threads across.


Good to know, thanks!

----------


## WaynePhillipsEA

> Ah, OK, then could we say that now the Call keyword is entirely optional/obsolete?


I would say _mostly optional/obsolete_.  There will be edge cases, e.g. if a procedure is named the same as a syntax keyword, then the call prefix can still help to disambiguate between the keyword and the procedure name.  But in the majority of cases it should be considered obsolete/optional.

----------


## Niya

> Don't get too excited... that looks like a bug in tB, as it should be trying to call the default prop-let member in that assignment inside SetVarValue if the LHS is an object type.   That will be fixed very soon, and then your code will break.
> 
> You could put the IsObject check into the SetVarValue call to switch between the two types of assignments, and that should satisfy the compiler and be correct.


I would be totally fine with that IsObject logic as long as it prevents the compiler from interfering with what I'm trying to do. The real value here is being able to use Variants on both sides so that the compiler doesn't try to tell me what I can and cannot do. With Variants involved on both sides of the assignment, the compiler cannot make any assumptions, it has to be evaluated at runtime for correctness, which is exactly what I want. The other big win here is that I don't have to refactor my class code, all I have to do is use the function where I'm performing assignments that involve type T. That's a very minor cost to pay in my opinion. 




> Though of course you are passing the values through Variants for that to work, which as @wqweto mentioned earlier, goes against what you're trying to achieve by using generics.


This is true. However, I'm willing to live with that. Generics provide more value than just performance. I'd argue that the bigger pay off is type safety. I'm willing to sacrifice a bit of performance for the type safety that generics give you. If I have a list of Longs, I only want Longs in that list and I would like the compiler to stop me if I ever make this mistake of trying to put in a String. This is a big win for me that helps prevent all kinds of errors in code. If I have to lose a few clock cycles for it, so be it.

This is the sole reason I hate JavaScript with its duck typing nonsense. It spoils an otherwise very beautiful language. It puts too much of a burden on you to always make sure you're using the right data types. There is a lot of value in a compiler that has ways of easing this burden so I can put my mental more towards what I'm actually doing rather than how I'm doing it. This is just my opinion though, there is no right or wrong here. It's just preferences.




> BTW, this code:
> 
> 
> 
> ```
>         SetVarValue(objVar, objVal)
>         SetVarValue(strVar, strVal)
>         SetVarValue(lngVar, lngVal)
> ```
> ...


Oh boy. This is another big discussion. I really don't want to go down that path right now. I'll just say this, like Set, this is another one of those garbage things present in the VB6 language that makes zero sense and adds no value. No programming language I know of would allow something like that. I'm a huge fan of consistency in a programming language, and a function/sub call should always be in brackets. I'm only speculating here but I suspect that VB6 inherited that nonsense from QuickBasic to support Print and statements like it so you can do stuff like this:-


```
    Debug.Print "This is ";
    Debug.Print "one line"
```

Requiring brackets there would make the syntax look too cluttered. Of course I'm just speculating here. I really don't know why BASIC was the only mainstream language that allowed this. Suffice to say, it's confusing as hell when you start switching between writing code in BASIC and some other language such as C. Sometimes you bring back the habit of bracketing your function calls to BASIC and it can become annoying when the compiler stops you and demand that you fix it. I've experienced it and still do to this day when switching between VB6 and VB.Net which is consistent about function call syntax.

----------


## Eduardo-

> I would say _mostly optional/obsolete_.  There will be edge cases, e.g. if a procedure is named the same as a syntax keyword, then the call prefix can still help to disambiguate between the keyword and the procedure name.  But in the majority of cases it should be considered obsolete/optional.


OK, good  :Thumb: .

About brackets (and anything that don't have a function), I prefer not to be required, if the reason is just "because it is required in other languages".
Better other languages learn from BASIC and not BASIC to be polluted with nosense requirements from other languages.
But to optionally accept the syntax (the parentheses without Call) if there is no harm is welcomed IMO.
So people coming from other languages can keep their habits.

----------


## Niya

I have no problem with brackets being optional. I just want the compiler to not complain when I use them.

----------


## Niya

> You could put the IsObject check into the SetVarValue call to switch between the two types of assignments, and that should satisfy the compiler and be correct.


Ok I just tested this and it doesn't work. Whenever Set is used to perform an assignment to a ByRef argument, the value doesn't propagate back to the variable that was passed through that ByRef argument. Guess it's back to the drawing board.

----------


## Niya

Ok I decided to revisit all the fancy point tricks I rejected yesterday and combine it with this idea of using ByRef parameters and came up with this:-


```
    Private Sub SetVarValue(Of T)(ByRef varToSet As T, ByVal value As T)
        If IsObject(value) Then
            '*********************************
            'Set varToSet = value
            '---------------------------------
            'The above Set statement is what the code below ultimately does.
            'however the compiler refuses to compile it because it sees
            'that type T can also be a String or a Long because this function
            'is also used with those types. It assumes that I might be using Set
            'to perform assignments between these non-object types and refuses to
            'compile as a result. We get around the compiler by using pointers
            '*********************************

            Dim obj As object
            Dim obj2 As object
            dim zero as long=0
            
            'Create an illegal object reference
            memcpy(varptr(obj),varptr(value),4)
            
            'AddRef    
            Set obj2 = obj
            
            'Assign the object to ByRef parameter
            memcpy(varptr(vartoset),varptr(value),4)
            
            'Prevent refrence count of object from being decremented when the object
            'variable goes out of scope
            memcpy(varptr(obj),varptr(zero),4)
            memcpy(varptr(obj2),varptr(zero),4)
        Else
            varToSet = value
        End If
    End Sub
```

This method adds the extra burden of needing an API call but at least it's a Win32 API call so no worries about it not being on a Windows system. It's also why I didn't use the function that wqweto showed me yesterday to call AddRef. I do not want to depend on the VB6 runtime being installed for this to work. Also this solution doesn't use Variants and it doesn't require me to refactor generic classes. I think I'm running with this solution. I doubt I will come up with a better way. I have exhausted all options at this point.

Here is the full test code:-


```
Module MainModule
    
    public declare sub MemCpy Lib "kernel32" Alias "RtlMoveMemory"(byval dest as LongPtr,byval src as LongPtr,byval count as Long)
    
    ' This project type is set to 'Standard EXE' in the Settings file, so you need a Main() subroutine to run when the EXE is started.
    Public Sub Main()
        
        Dim objVal As TestClass = New TestClass
        Dim strVal As String = "BOO!"
        Dim lngVal As Long = 29
        
        Dim objVar As TestClass
        Dim strVar As String
        Dim lngVar As Long
        
        SetVarValue(objVar, objVal)
        SetVarValue(strVar, strVal)
        SetVarValue(lngVar, lngVal)
        
        Debug.Print objVar.Value
        Debug.Print strVar
        Debug.Print lngVar
        
    
    End Sub
	
    Private Sub SetVarValue(Of T)(ByRef varToSet As T, ByVal value As T)
        If IsObject(value) Then
            '*********************************
            'Set varToSet = value
            '---------------------------------
            'The above Set statement is what the code below ultimately does.
            'however the compiler refuses to compile it because it sees
            'that type T can also be a String or a Long because this function
            'is also used with those types. It assumes that I might be using Set
            'to perform assignments between these non-object types and refuses to
            'compile as a result. We get around the compiler by using pointers
            '*********************************

            Dim obj As object
            Dim obj2 As object
            dim zero as long=0
            
            'Create an illegal object reference
            memcpy(varptr(obj),varptr(value),4)
            
            'AddRef    
            Set obj2 = obj
            
            'Assign the object to ByRef parameter
            memcpy(varptr(vartoset),varptr(value),4)
            
            'Prevent refrence count of object from being decremented when the object
            'variable goes out of scope
            memcpy(varptr(obj),varptr(zero),4)
            memcpy(varptr(obj2),varptr(zero),4)
        Else
            varToSet = value
        End If
    End Sub
    
End Module

Private Class TestClass
    
    Public Sub new()
        
    End Sub
    
    Public Property Get Value() As String
        Return "Class Property Value"
    End Property
    
End Class
```

----------


## Niya

@WaynePhillipsEA 

One more thing. About what I mentioned earlier about ByRef not working with Set. I'm not sure if there is a bug here but here is some code reproducing the behavior:-


```
Module SecondMain
	
	Public Sub Main()
		
		Dim tc1 As TestClass = New TestClass
		
		Dim tc2 As TestClass
		
		Assign(tc2, tc1)
		
		If tc2 Is Nothing Then
			'This program compiles with no problems but at run time, the assignment
			'will fail by simply not propagating the value of 'dest' inside the Assign sub
			'to the 'tc2' variable that was passed in
			Debug.Print "Failed to assign"
		Else
			
			'The only way it succeeds is if either 'tc1' is also a Variant or if
			'the 'dest' parameter in Assign is of type TestClass.
			Debug.Print "Success"
		End If
		
		
	End Sub

	Public Sub Assign(ByRef dest As Variant, ByVal obj As TestClass)
		Set dest = obj
	End Sub
		
	' add your procedures here
End Module
```

This is a little above my pay grade so I can't even begin to understand what is really happening here. Maybe it's something, maybe it's nothing either way I found it interesting and thought you may want to take a look at it.

I haven't tested this in VB6 btw so I don't know if this is expected behavior.

EDIT:

Just tested it in VB6 and the value propagates so this is definitely a bug or at the very least an oversight since it's violates the aim of backward compatibility with VB6.

----------


## SearchingDataOnly

> Upon reflection, I think you're spot on, and I've rejected other proposed features for those exact reasons.  I was purely trying to think of alternatives we hadn't considered, but you are right that this one is not BASIC-esque.


Indeed, it is not appropriate to use "*:=*" instead of the Set keyword.

Some people say that "*:=*" is not "BASICish" syntax, but in fact, "*:=*" is an existing syntax in VB6, which is used in function parameter calls.

----------


## SearchingDataOnly

For the sentence "*For Each P As cPerson In Persons*", my thinking is this:

(1) In "For Each P As cPerson In Persons", P is "Function-Scoping"

(2) In "For Each *(*P As cPerson*)* In Persons", P is "For Block-Scoping"

*--- Or ---*

Provide "#Region ... #End Region" syntax. If "For Each P As cPerson In Persons" is within the Region, then P is "Region-Scoping", otherwise, P is "Function-Scoping"



```
#Region
For Each P As cPerson In Persons

Next
#End Region
```

----------


## Schmidt

> (1) In "For Each P As cPerson In Persons", P is "Function-Scoping"
> 
> (2) In "For Each *(*P As cPerson*)* In Persons", P is "For Block-Scoping"


I like that actually...
The brackets in (2) kind of underline the "isolated state" of the iterator-variable from the surrounding code.

Olaf

----------


## Niya

> For the sentence "*For Each P As cPerson In Persons*", my thinking is this:
> 
> (1) In "For Each P As cPerson In Persons", P is "Function-Scoping"
> 
> (2) In "For Each *(*P As cPerson*)* In Persons", P is "For Block-Scoping"
> 
> *--- Or ---*
> 
> Provide "#Region ... #End Region" syntax. If "For Each P As cPerson In Persons" is within the Region, then P is "Region-Scoping", otherwise, P is "Function-Scoping"
> ...


I'm not a fan of that approach. Like I said before, I'm big fan of consistency in programming languages. It's not consistent because scoping in BASIC languages is usually denoted by an opening keyword and an End [Keyword] statement. For example, End Sub, End Function, End With, End If. The only exceptions are loops, For...Next and Do...Loop. Brackets are used for array indexing, and grouping expressions and using it for block scoping just doesn't fit. A more consistent approach would be to simply add another compiler directive alongside Option Explicit. Maybe we can call it Option Block On. This would be a very VB way of doing things.

Another more VB way of doing it would be using Function modifiers. This would be somewhat consistent as VB as plenty of those. Friend, Private, Public. However, it's a little less consistent I'm comfortable with since function modifiers typically tell you something about the function's relationship to the everything outside of the function. There is no modifier who's effects are confined only to what's inside the function.

Another very VB way could be to add another declarative keyword in the family of Dim. It's consistent because we already have Dim, Private and Public for declaring variables and these are directly related to variable scoping. One extra would be very consistent with VB's design. Perhaps we could call it DimBlock and when used to declare a variable inside a block it would be block scoped.

These are just a few ideas off the top of my head. I don't know that much about language design so don't think of any of this as a right or wrong thing. These are just my opinions.

----------


## Eduardo-

> Some people say that "*:=*" is not "BASICish" syntax, but in fact, "*:=*" is an existing syntax in VB6, which is used in function parameter calls.


Yes, that syntax was already used by MS for that purpose. It does not mean that it was a good idea, IMO.
Perhaps being so strange to BASIC is a reason why that feature is hardly used.

----------


## Niya

Oh I just remembered, TwinBASIC also has attributes which can act as compiler directives only far more powerful. Attributes could be introduced for block scoping.

----------


## jpbro

What about**:

Function Scope:


```
For Each P As cPerson in Persons 
   If True Then Exit For
Next P

MsgBox P.Name ' Shows Name of First Enumerated cPerson in Persons
```

Block Scope:


```
With Each P As cPerson in Persons 
   If True Then Exit With
Next With

MsgBox P.Name ' Error - Variable Not Defined OR Object/With Variable Not Set?
```

OR perhaps:

Function Scope:


```
Dim P As cPerson   ' Dimmed outside For Block

For Each P in Persons 
   If True Then Exit For
Next P
```

Block Scope:


```
For Each P As cPerson in Persons ' The "As cPerson" Dims the var inside the block, outting it in block scope
   If True Then Exit For
Next P
```

----------


## Niya

Oh yea, before I forget again. Wanted to mention this a long time ago. A proper sizeof operator would be nice. It's a tad bit annoying having to declare a variable just to measure the size of a structure:-


```
	Dim b As MyStruct
	Dim sz As Long = LenB(b)
```

Would be lovely if we could just do this:-


```
Dim sz As Long = sizeof(MyStruct)
```

Like we could in C/C++. Even VB.Net can do it through Type objects. This comes up a lot when you need to allocate memory for a structure but don't actually intend to use the structure at that moment. You just want to know it's size.

----------


## Niya

> What about**:
> 
> Function Scope:
> 
> 
> ```
> For Each P As cPerson in Persons 
>    If True Then Exit For
> Next P
> ...


Hmmm.....the problem I'm seeing that it only considers For...Each blocks. What about If....Then, Do...Loop and With...End With blocks?

----------


## jpbro

One more idea:

Function Scope:


```
For Each P in Persons 
Next
```

Block Scope:


```
For Each Private P in Persons ' Private keyword dims variable with block scope. Maybe "Local" would be better?
Next
```

----------


## Niya

Dim P instead of Private might a little better. Private affects scoping at the project level. It would be a bit confusing using it for block level scoping.

----------


## Eduardo-

My opinion is not to introduce many variants to do more or less the same thing.



```
For Each P As Person In Persons
```

seems something good to introduce, but not with several similar possibilities.

The only discussion IMO would be if the scope should be of procedure level or block level.
But there isn't such thing as block level in VB (and tB) right now, so the discussion of introducing block level variable scope should be a separate and previous discussion I think.

----------


## IndicSoftware

> How about a slightly different operator to control that behaviour instead of LetSet/Assign?
> 
> 
> 
> ```
> MyObject1 := MyObject2
> ```


This is a perfect solution. I like it!

----------


## WaynePhillipsEA

@Niya, I've just released v0.10.4617, the Set-assignment on byref-Variants semantics are now fixed.  So this should work for you:



```
Private Sub SetVarValue(Of T)(ByRef varToSet As Variant, ByVal value As T)
    If IsObject(value) Then
        Set varToSet = value
    Else
        varToSet = value
    End If
End Sub
```

----------


## SearchingDataOnly

> I'm not a fan of that approach. Like I said before, I'm big fan of consistency in programming languages. It's not consistent because scoping in BASIC languages is usually denoted by an opening keyword and an End [Keyword] statement. For example, End Sub, End Function, End With, End If. The only exceptions are loops, For...Next and Do...Loop. Brackets are used for array indexing, and grouping expressions and using it for block scoping just doesn't fit. A more consistent approach would be to simply add another compiler directive alongside Option Explicit. Maybe we can call it Option Block On. This would be a very VB way of doing things.
> 
> Another more VB way of doing it would be using Function modifiers. This would be somewhat consistent as VB as plenty of those. Friend, Private, Public. However, it's a little less consistent I'm comfortable with since function modifiers typically tell you something about the function's relationship to the everything outside of the function. There is no modifier who's effects are confined only to what's inside the function.
> 
> Another very VB way could be to add another declarative keyword in the family of Dim. It's consistent because we already have Dim, Private and Public for declaring variables and these are directly related to variable scoping. One extra would be very consistent with VB's design. Perhaps we could call it DimBlock and when used to declare a variable inside a block it would be block scoped.
> 
> These are just a few ideas off the top of my head. I don't know that much about language design so don't think of any of this as a right or wrong thing. These are just my opinions.


Your opinion is very valuable. As long as no emotional language is used, any discussion of technology is valuable. Looking at problems from different angles, there will be different opinions, which has nothing to do with right or wrong.

I'm a strong supporter of "BASICish" syntax. In my opinion, there are two forms of "BASICish", one is "BASICish" from the perspective of syntax, and the other is "BASICish" from the perspective of design patterns. E.g:

You posted an example of "*generics*", which is a very good example. But in my opinion, "*generics*" is not a "BASICish" design pattern, and the example in Olaf's post#342 is a more "BASICish" design pattern than "*generics*".

In order not to hijack this thread, if I have time, I'll create another thread to discuss "what is really BASICish".

----------


## SearchingDataOnly

> One more idea:
> 
> Function Scope:
> 
> 
> ```
> For Each P in Persons 
> Next
> ```
> ...


I prefer *Local*. However, in order to reduce ambiguity, I think we should cancel "block-scoping variables"

----------


## SearchingDataOnly

> Originally Posted by SearchingDataOnly
> 
> 
> For the sentence "*For Each P As cPerson In Persons*", my thinking is this:
> 
> (1) In "For Each P As cPerson In Persons", P is "Function-Scoping"
> 
> (2) In "For Each *(*P As cPerson*)* In Persons", P is "For Block-Scoping"
> 
> ...


In order to reduce ambiguity, I think we should cancel "block-scoping variables". In other words, we should always just use the following traditional syntax: 



```
Dim P As cPerson
For Each P in Persons 
   
Next P
```

If twinBasic decides to support "block-scoping variables", then the best of both worlds should be: adopt (2), prohibit (1). 
Or, change (2) to jpbro's method: 


```
For Each Local P As cPerson in Persons 

Next
```

----------


## SearchingDataOnly

> Originally Posted by SearchingDataOnly
> 
> 
> @WaynePhillipsEA,
> 
> I'd like to know how twinBasic implements JavaScript-like inline-functions(Callback), for example:
> 
> 
> 
> ...


I just browsed that link and the discussion inside is very valuable.

My purpose is to find a more "BASICish" design pattern to implement function-pointers or Callbacks, but I haven't found the best solution yet.

----------


## Schmidt

> For Each *Local* P As cPerson in Persons 
> 
> Next


I like this as well (to distinguish between "function-level" and "local For-Block"-scope).

As for "other local block-scopes" (as If-Blocks, Do while, etc.)...
here the "localness" could easily be ensured via "normal Dim Statements within a given Block"
(if one wants to go there at all, with "full block-scoping").

For Each is a different animal IMO (as far as "code-blocks" are concerned), 
because any "Opener-Line of a For-Block" always requires the specification of an Iterator-Variable.

And with Option Explicit in place (which goes without saying...), there's therefore always 
the necessity of "extra-Dimming-efforts" in a separate Line...

And that's what we could avoid, when such an "implicit Dimensioning" would be possible in the future
(in the Opener-Line of the For-Block itself).

Don't know, how "other brains work" in this regard - 
but the current "extra-Dim requirement of a For-Iterator-Variable" throws me off quite often.

 Especially when I'm "in the flow"... these iterator-critters are "somehow implicit in thinking" (secondary to the real problem) - 
and a new syntax like the above would "get rid of that secondary problem" in the very same line of code, that addresses "the real task"...
<shrug>

Olaf

----------


## yereverluvinuncleber

```
For Each P As cPerson in Persons ' The "As cPerson" Dims the var inside the block, outting it in block scope
   If True Then Exit For
Next P
```

This looks good to me and I like the idea of block scoping and I am sure it could be shoe-horned into other loop structures with some fiddling. In truth though, I just want TwinBasic to do what VB6 does at the moment, archaic, insane, stupid or otherwise, just so we can move on and get TwinBasic functioning. If this gets us past a sticking point let Wayne choose one. 

An alternative would be to set up a committee like the ECMA group and determine BASICs future direction. I'll nominate Niya and Olaf on that committee and we'll see how it goes.

----------


## jpbro

Block-level variables can be useful in some circumstances, but if we can choose only one then function-level is more useful.

I agree with Niya that the "Dim" keyword is probably the best choice if we can have block-level scoped variables, but I'm also fine with "Local". I definitely prefer English keyword approaches to the non-English syntax (parentheses or :=).

I can see potential backwards compatibility problems with Olaf's idea to treat variables dimmed in If/Do blocks as local scope. Some of us haven't been perfectly disciplined in this regard and may have Dims inside blocks that we're actually relying on to be function-level scoped (looks around nervously). So perhaps an "Option Local Scope" would be useful to turn this feature on? Or maybe a new "Local" keyword will dim a variable with block-level scope. So:



```
Sub Test
   Dim MyVar As Long

   MyVar = 10

   If MyVar > 0 Then
      Local MyVar As Long

      MyVar = MyVar + 1

      Debug.Print MyVar
   End If
   
   Debug.Print MyVar
```

Will output:



```
1
10
```

I do subscribe to Olaf's idea of being able to dimension new vars within the For Each construct though, so I'm fine with any of the constructs that don't require and extra "Dim Foo As Bar" line.

Another thought since we are on the topic. I'm not sure if this is possible, but it would be great For Each with a strongly typed variable would skip Collection members of other types when looping. Consider the following code



```
Option Explicit

Sub Test()
   Dim c As New Collection
   
   c.Add New Class1
   c.Add New Class1
   c.Add New Class2 ' Different Class
   c.Add New Class1
   c.Add New Class1
  
   For Each c1 As Class1 In c   ' Only enumerate the Class1 members of the Collection.
      Debug.Print c1.Id
   Next c1
End Sub
```

Right now this will raise a Type Mismatch Error in VB6 when the loop hits Class2. It would be great if it just skipped the non-Class1 members of the collection, basically performing this code on your behalf:



```
Option Explicit

Sub Test()
   Dim c As New Collection
   Dim c1 As Class1

   c.Add New Class1
   c.Add New Class1
   c.Add New Class2 ' Different Class
   c.Add New Class1
   c.Add New Class1
  
   For Each cx As Object In c   ' Enumerate all members of the Collection.
      If TypeOf(cx) Is Class1 Then
         ' We found a Class1 member, so let's use it
         Set c1 = cx

         Debug.Print c1.Id
      End If
   Next c1
End Sub
```

----------


## Schmidt

> Or maybe a new "Local" keyword will dim a variable with block-level scope. So:
> 
> 
> 
> ```
> Sub Test
>    Dim MyVar As Long
> 
>    MyVar = 10
> ...


I'd subscribe to that idea of "Local instead of Dim" for block-scope vars.
It'd help, to avoid a new "Option Local Scope" - and the special case of: For Each Local P As cPerson In Persons
would make for a "consistent read and meaning" over all.





> Another thought since we are on the topic. I'm not sure if this is possible, but it would be great For Each with a strongly typed variable would skip Collection members of other types when looping. 
> 
> 
> 
> ```
> Option Explicit
> 
> Sub Test()
>    Dim c As New Collection
> ...


My own usage of such "mixed bag-contents" is pretty rare.
When it comes to (plain-data-holding) List- and Container-Objects - these usually have "only one type of Value" (or Key).

Sure, there's of course the Controls (or Widgets) Collections - but that's GUI-hierarchy-stuff 
(where you have no real choice, stuffing different Class-Types into them).

IMO such filtering should better be handled in the Enumerator (IEnumVariant)- returning "right most part" of a For Each Loop.
E.g. I could imagine, to enhance the cWidgets-Class of the RC6-GUI about an additional Enumerator-returning method like:



```
For Each B As cwButton In MyForm.WidgetsByType("cwButton")

Next
```

Instead of the current:



```
Dim oW As Object, B As cwButton
For Each oW In MyForm.Widgets 
  If TypeOf oW Is cwButton Then
    Set B = oW
    ...
  End If
Next
```

Olaf

----------


## yereverluvinuncleber

> Some of us haven't been perfectly disciplined in this regard and may have Dims inside blocks that we're actually relying on to be function-level scoped (looks around nervously).


Yes, can't break existing functionality.

----------


## jpbro

> I'd subscribe to that idea of "Local instead of Dim" for block-scope vars.
> It'd help, to avoid a new "Option Local Scope" - and the special case of: For Each Local P As cPerson In Persons
> would make for a "consistent read and meaning" over all.


Agreed that the consistency of the keyword "Local" is a good idea, and avoiding another Option is nice too. That said, I guess the votes are in and it's up to Wayne to decide what to do (if anything).






> My own usage of such "mixed bag-contents" is pretty rare.
> When it comes to (plain-data-holding) List- and Container-Objects - these usually have "only one type of Value" (or Key).


Yes, it's rare for me also, and while it's not of huge importance it would be a "nice to have" in those rare cases. For my part, I have a paper form designer that can have different types of objects for drawing on the page (textboxes, lines, shapes, images, etc...). I stuff each of these in a PageObjects collection. All of the different classes have interfaces implemented for shared features (like IDrawable, IBox, IShape2D, etc...) but there are cases where I just want to enumerate a specific type of object. It's easy enough to add a method that returns only the CTextBox classes, or the CImage classes though, I just thought it would be a bit easier to do it without all that. I'm not worried much either way, just throwing some ideas out there.





> IMO such filtering should better be handled in the Enumerator (IEnumVariant)- returning "right most part" of a For Each Loop.
> E.g. I could imagine, to enhance the cWidgets-Class of the RC6-GUI about an additional Enumerator-returning method like:
> 
> 
> 
> ```
> For Each B As cwButton In MyForm.WidgetsByType("cwButton")
> 
> Next
> ```


The only thing I don't like about that is the use of a string. If we create our own Widgets and then later change the class name, then that could be a point of failure if we miss any text replacements. What about**:



```
For Each B As cwButton In MyForm.WidgetsByType(New cwButton)

Next
```

Or if B gets dimmed before WidgetsByType gets called, then even better:



```
For Each B As cwButton In MyForm.WidgetsByType(B)

Next
```

----------


## vbrad

> Yes, can't break existing functionality.


VB6 to twinbasic is a one way street (at least if you start taking advantage of the latter's extra functionality?)
That being so it seems like a fairly easy transformation to move all existing lines starting with "Dim " in a procedure to the top
when opening a VB6 project in twinbasic for the first time.

----------


## Eduardo-

> VB6 to twinbasic is a one way street (at least if you start taking advantage of the latter's extra functionality?)
> That being so it seems like a fairly easy transformation to move all existing lines starting with "Dim " in a procedure to the top
> when opening a VB6 project in twinbasic for the first time.


The ability to declare variables at any point in code is not merely semantic, but to my understanding there are minor optimizations by not declaring unneeded variables if a condition (that use the variable) is not met. (Anyway I don't know very much about how that issue works.)

----------


## peterst

In the forbidden land, the forbidden language supports this - variable is automatically declared as For Each scope one if it is not declared before in the procedure:

VB.NET Code:
Private Sub ProcessPersons(persons As List(Of Person))
    For Each p in persons        ' p type is found by the compiler as List(Of T) is explicitly declaring (Of Person)
        ' p is declared scope only as no declaration exists before
        DoSomething(p)
    next
    ' Using p here will not compile
    DoSomething(p)      ' or it will crash if compiler can't catch the problem
End Sub

But if the variable p is declared before For Each, then the function level declaration works:

VB.NET Code:
Private Sub ProcessPersons(persons As List(Of Person))
    Dim p As Person
    For Each p in persons
        DoSomething(p)
    next
    ' Using p here will work fine
    DoSomething(p)
End Sub

If variable is already declared you cannot re-declare (and change its type):

VB.NET Code:
Private Sub ProcessPersons(persons As List(Of Person))
    Dim p As Person
    For Each p as Customer in persons        ' Compile time error as p is already defined
        DoSomething(p)
    next
End Sub

Another example is:

VB.NET Code:
Private Sub ClearAllTextBoxes(frm as Form)
    For Each ctl in frm.Controls.OfType(TextBox)
        ctl.Text = ""
    next
End Sub

OfType(object) in the forbidden language is extension method and it gets the type of the object and filters all items in the collection so it returns only the required type ones. This is more generic as it can be used for any type of objects:

VB.NET Code:
For Each ev in events.OfType(CustomerCreated)
    SendNotification($"New customer. Guid={ev.AggregateGuid}")
Next

I know it is bad to step into the forbidden land as people there are cursed, but sometimes they have good ideas :-)

----------


## mansellan

> ...
> 
> OR perhaps:
> 
> Function Scope:
> 
> 
> ```
> Dim P As cPerson   ' Dimmed outside For Block
> ...


This is how .Net does it, and seems to me to be the least-friction way of doing it. For function-scoping, the existing VB6 syntax is exactly the same. If you want the new twinBASIC block-scoping, just add an "As X" caluse to the For.

----------


## jpbro

I'm just thinking out loud a bit here, so excuse me if this is a bad idea(tm). 

I think another nice convenience feature would be a Nothing-safe If statement. I have some nested objects where it is possible that one or more of the nested objects are not set, requiring boilerplate short-circuiting code like this:



```
If obj1 Is Nothing Then Exit Sub
If obj1.obj2 Is Nothing Then Exit Sub
If obj1.obj2.obj3 Is Nothing Then Exit Sub
If obj1.obj2.obj3.obj4 Is Nothing Then Exit Sub

' All objects are set, continue work
If obj1.obj2.obj3.obj3.someProp > 0 Then
   ' Do Something
End If
```

or perhaps this:



```
Dim myObj4 As Class4

On Error Resume Next
Set myObj4 = Nothing ' In case I've used it before
Set myObj4 = obj1.obj2.obj3.obj4   ' May error if any obj* ref is Nothing, but we've trapped it
On Error Goto 0

If Not myObj4 Is Nothing Then 
   ' If we get here, myObj4 is set, so we can do something useful with it
End If
```


It would be nice if we could shorten this:



```
IfSafe obj1.obj2.obj3.obj3.someProp > 0 Then ' If any of the obj* variables are Nothing then IfSafe evaluates to False
   ' Do Something
End If
```

Thinking about it a bit more though, maybe that approach would open up a can of worms requiring "Safe" versions of Do...While, For...Next, etc... so another approach might be a Safe "Set" keyword:



```
Dim myObj4 As Class4

SetSafe myObj4 = obj1.obj2.obj3.obj4 ' If any nested object ref is Nothing, then myObj4 will be Nothing. If all object refs are something, then myObj4 will be the object returned by .obj4
If Not myObj4 Is Nothing Then 
   ' If we get here, myObj4 is set, so we can do something useful with it
End If
```

Lastly, I'm not sure I like the "Safe" keyword, there's probably a better option, but I hope it's enough to illustrate the point.

----------


## PlausiblyDamp

[QUOTE=jpbro;5532586]I'm just thinking out loud a bit here, so excuse me if this is a bad idea(tm). 

I think another nice convenience feature would be a Nothing-safe If statement. I have some nested objects where it is possible that one or more of the nested objects are not set, requiring boilerplate short-circuiting code like this:



```
If obj1 Is Nothing Then Exit Sub
If obj1.obj2 Is Nothing Then Exit Sub
If obj1.obj2.obj3 Is Nothing Then Exit Sub
If obj1.obj2.obj3.obj4 Is Nothing Then Exit Sub

' All objects are set, continue work
If obj1.obj2.obj3.obj3.someProp > 0 Then
   ' Do Something
End If
```

C#, not sure about VB.Netthough,  has a nice syntax for this. The ?. is used when you want the kind of behaviour you suggest but a normal . is the usual null behaviour.



```
if (ob1?.obj2?.Property > 2)
{
//will get here only if ob1 and obj2 aren't null and the Property is greater than 2
}
```

It is a massive help for writing clearer code, especially when calling members on potentially null objects.

----------


## jpbro

> This is how .Net does it, and seems to me to be the least-friction way of doing it. For function-scoping, the existing VB6 syntax is exactly the same. If you want the new twinBASIC block-scoping, just add an "As X" caluse to the For.


Yeah, I think that way does make a lot of sense, but I also see Olaf's point re: the benefits of being able to skip the extra Dim line (which the Local keyword would eliminate). I'm leaning towards preferring the Local keyword since it could be used inside blocks as well to limit scope, but I'm not feeling incredibly strongly about it one way or another.

----------


## jpbro

> C#, not sure about VB.Netthough,  has a nice syntax for this. The ?. is used when you want the kind of behaviour you suggest but a normal . is the usual null behaviour.
> 
> 
> 
> ```
> if (ob1?.obj2?.Property > 2)
> {
> //will get here only if ob1 and obj2 aren't null and the Property is greater than 2
> }
> ...



Well it's good to know other languages have had a need (and found a solution) for this too! For a BASIC language, I'd prefer something more natural language based then the somewhat esoteric looking "?." but I can also see advantages for that kind of notation. I'm assuming you could mix and match "?." and "." in the same line for references that you don't care a Nothing and for ones where you do, which might be good for certain scenarios. It does start to look a bit "nasty" to my eyes though!



```
if (obj1?.obj2.obj3?.obj4.Property > 2 ) ' Mix of "?." and "."
```

----------


## Niya

Ah. Lots of discussion here I see. A lot to unpack here.

Something came up today and now I have to go play with Xamarin for a bit for some kind of "proof of concept" work. Basically someone wants an Android application so I have to go prove we can do it so we can get that job. I've played with Xamarin in the past but actually writing something useful is an entirely different thing. I have to go dig into it. So I might be scarce from this thread for a while. I don't anticipate that this will take long and when I'm done, I want to get back to this.




> @Niya, I've just released v0.10.4617, the Set-assignment on byref-Variants semantics are now fixed.  So this should work for you:
> 
> 
> 
> ```
> Private Sub SetVarValue(Of T)(ByRef varToSet As Variant, ByVal value As T)
>     If IsObject(value) Then
>         Set varToSet = value
>     Else
> ...


Nice. When I'm done with my hopefully short adventure in the world of Xamarin, we can continue.

----------


## peterst

[QUOTE=PlausiblyDamp;5532590]


> I'm just thinking out loud a bit here, so excuse me if this is a bad idea(tm). 
> 
> I think another nice convenience feature would be a Nothing-safe If statement. I have some nested objects where it is possible that one or more of the nested objects are not set, requiring boilerplate short-circuiting code like this:
> 
> 
> 
> ```
> If obj1 Is Nothing Then Exit Sub
> If obj1.obj2 Is Nothing Then Exit Sub
> ...




VB.NET supports same null checks: ?. and ?() null-conditional operators (Visual Basic)

Example where Disconnect() method is called if _client is not null:

VB.NET Code:
_client?.Disconnect()

The question mark is just used as human question: is the object null (nothing). Or in the example above: is _client nothing?

I think it is more "basic-ish" than other complicated proposals that may arrive.

P.S. Sorry that I use the forbidden starting underscore in variable names in the good old land thread, but it is allowed in the forbidden land :-)

----------


## wqweto

> C#, not sure about VB.Netthough,  has a nice syntax for this. The ?. is used when you want the kind of behaviour you suggest but a normal . is the usual null behaviour.


TB has true IF ternary operator already using syntax similar to this

If(Not obj1 Is Nothing, _
If(Not obj1.obj2 Is Nothing, _
If(Not obj1.obj2.obj3 Is Nothing, _
If(Not obj1.obj2.obj3.obj4 Is Nothing, _
obj1.obj2.obj3.obj4.someProp, 0), 0), 0), 0)

. . . so above expression must be working fine at run-time.

Btw, if ?. is considered then ?! (an "optional bang" operator) and ?? (optional "shortcut ternary") must be considered as well and probably return Empty (instead of Null) for both Null and Nothing values in its LHS.

cheers,
</wqw>

----------


## vbrad

> You never hear a native English speaker say something like "there *is not* nothing over there".


I'm not qualified to have an opinion on what you guys are discussing but I'd just like to say that I know native-English speaking people who say stuff like "Didn't you not?"  :Smilie:

----------


## Niya

> I'm not qualified to have an opinion on what you guys are discussing but I'd just like to say that I know native-English speaking people who say stuff like "Didn't you not?"


No. That's not the same thing. I don't know what actual English professors would call this but saying something like *not nothing*, is basically negating a negative to get a positive. We wouldn't say speak like that. We wouldn't say that "there is *not nothing* over there". We would say "there *something* over there". This works in a spoken language like English but it's too ambiguous for a programming language. The computer don't just need to know if there is something there but it also needs to know what that something is. There is no sense in asking if there is something there if every single time you're going to follow up with asking what is there. It's more efficient to ask if there is a specific thing there since it also answers the question of whether something is there at the same time. This lack of a *something* concept in programming languages is why we negate nothing to represent *something*.

Think about it. Do you ever hear people say, "Is there *not no* in that coffee cup?" No, they would say, "Is there coffee in that cup?" The main point is that for English speakers at least, negating a negative is not something that comes naturally in our thought processes.

----------


## jpbro

I hate to ask this, but for crying out loud guys, this is the only TwinBasic outlet here at vbforums - can we please keep it on topic? Or at least not turn it into a flamewar? It's time to look ahead, the past be darned.

----------


## si_the_geek

Keep it on topic folks, and stay away from personal attacks.

I have deleted most of the posts from today (and a few from a couple of days ago).   

Due to the large quantity of posts today, some valid things have also been removed - I didn't have time to edit multiple posts to keep the valid parts (but thankfully those parts seem to be implied by the posts that remain).



If you want to discuss things that aren't related to twinBasic, create another thread for that discussion - and avoid personal attacks.

----------


## SearchingDataOnly

> Keep it on topic folks, and stay away from personal attacks.
> 
> I have deleted most of the posts from today (and a few from a couple of days ago).   
> 
> Due to the large quantity of posts today, some valid things have also been removed - I didn't have time to edit multiple posts to keep the valid parts (but thankfully those parts seem to be implied by the posts that remain).
> 
> 
> 
> If you want to discuss things that aren't related to twinBasic, create another thread for that discussion - and avoid personal attacks.


In my opinion, apart from the personal attack on Niya's post, I have not seen any personal attacks on other posts in this thread.

Could you send me my deleted posts in a private message? I'll post those posts to another thread of Chit-Chat. Because Niya does not seem to intend to stop making trouble in the VB6 sub-forum, I think it is necessary to have a complete dialogue (or debate) with Niya.

----------


## VB6 Programming

> Because Niya does not seem to intend to stop making trouble in the VB6 sub-forum, I think it is necessary to have a complete dialogue (or debate) with Niya.


To be fair to Niya he has been helpful with twinBASIC on this thread.

I don't think you are likely to ever convince him that VB6 is better than VB.Net but as he is now moving away from VB.Net (to C#) there seems little point in trying.

----------


## SearchingDataOnly

> Because Niya does not seem to intend to stop making trouble in the VB6 sub-forum, I think it is necessary to have a complete dialogue (or debate) with Niya.
> 			
> 		
> 
> To be fair to Niya he has been helpful with twinBASIC on this thread.
> 
> I don't think you are likely to ever convince him that VB6 is better than VB.Net but as he is now moving away from VB.Net (to C#) there seems little point in trying.


Of course, his discussion on the "Set" keyword is very meaningful.

In my opinion, explaining to someone "VB6 is better than VB.Net" is a very strange and stupid thing. Obviously I will not do such a stupid thing. What I just want to explain to Niya is, don't provoke disputes on VB6-related threads, and stop repeating things that all VB6ers understand on VB6-related threads.

----------


## yereverluvinuncleber

[ message redacted]

----------


## si_the_geek

> In my opinion, apart from the personal attack on Niya's post, I have not seen any personal attacks on other posts in this thread.


There were several, to varying degrees.




> Could you send me my deleted posts in a private message? I'll post those posts to another thread of Chit-Chat.


No, that would be a waste of my time.  Not only would they be out of context, but there were also some attacks in there.


It is time for these off-topic posts to stop, keep this thread focussed on twinBasic.

----------


## Shaggy Hiker

> This single thread is getting quite long already.  Shame we can't get our own twinBASIC sub-forum here.


Technically, you pretty much do. There hasn't been this much activity in OtherBASIC for a long time, but TwinBasic (seems like it ought to be TB, not tB) isn't the only driver of that. You can start as many threads as you see fit, and simply add "TwinBASIC:" into the subject line. That should be clear enough for anybody.

----------


## Shaggy Hiker

> Think about it. Do you ever hear people say, "Is there *not no* in that coffee cup?" No, they would say, "Is there coffee in that cup?" The main point is that for English speakers at least, negating a negative is not something that comes naturally in our thought processes.


You don't speak American English. The proper phrase, and one which you do hear a LOT in the US, would be, "Ain't there no coffee in that cup?" If you turn the slang "ain't" into proper English, that sentence becomes: "Is not there no coffee in that cup?" 

I would suggest, therefore, that "Ain't there no coffee in that cup?" is at least as bad as what you say you never hear, but it's in common usage. It's called a double negative. Peopled use them without thinking about the actual meaning, and they are quite common. Whether they use them as double negatives or not doesn't even matter. Speech is what we use it to be.

----------


## Shaggy Hiker

I'd be inclined to close this thread, but ONLY because I think it is time that people on here start using multiple threads for this topic. In some forums (at least .NET, but perhaps others), there is a means to prepend some information to the subject line. The same could be done here. At this time, there appears to be TwinBasic and RadBASIC which are both filling a similar niche. There is also RC6, but that looks like it is a full fledged reference in both TwinBASIC and VB6, and is not a stand alone, at this time.

Some of the posts over the last month have mentioned putting things in the VB6 forum because that's where the VB6 coders are. Why is that the case? The VB6 people are in the VB6 forum because that's where they stay. That forum is for VB6. I would say that TwinBASIC and RadBASIC are not VB6 and don't belong there, but they are the most vibrant, active, new forms of BASIC in existence. You should take over this forum for those languages, and I suspect we could help out a very small amount by adding those prepend labels. I say that this would help out a very small amount because they are rarely used anywhere else, so it seems kind of a forlorn hope to expect that they would be used here. Furthermore, you don't need them to be added to use them. Just start the topic with "TB:" or "TwinBASIC:", or even "[TwinBASIC]". 

The key question then would be whether or not people start coming here. If enough do, then a forum would make sense. Furthermore, there wouldn't be quite the need for the pruning that Si was doing on this thread. 

So: Start more threads in here. Prepend the language you are using, or we could possibly add that feature (I haven't asked, so I don't know what it entails). Show us that, if you build it, they will come. There is nothing saying you have to stick with just one thread.

----------


## Niya

> In my opinion, apart from the personal attack on Niya's post, I have not seen any personal attacks on other posts in this thread.
> 
> Could you send me my deleted posts in a private message? I'll post those posts to another thread of Chit-Chat. Because Niya does not seem to intend to stop making trouble in the VB6 sub-forum, I think it is necessary to have a complete dialogue (or debate) with Niya.


So let me get this straight. Olaf makes an unnecessary attack on a very innocent suggestion peter made and because I called it out, I'm the bad guy? You know, some of you are really starting to rub me the wrong with with your lack of integrity. You know, even when I vehemently disagreed with you guys on some things, I always tried by best not to be disrespectful. I think .Net and everything that came after it is superior to VB6, yet every time I say it, all of you get up in your feelings, lash out and then claim I'm the bad guy. I'm getting real tired of being diplomatic about it. MY VIEWS HAVE NOTHING TO DO WITH YOU, MY OPINION OF YOU OR YOUR WORTH AS A HUMAN BEING. They are just tools and I have strong opinions that one is better than the other. Stop getting in your feelings over it.

----------


## Niya

> To be fair to Niya he has been helpful with twinBASIC on this thread.


There's more to come. I'm doing some light work in C#/Xamarin right now. When I'm done with that, I wanna finish up what I was doing in TwinBASIC.

----------


## vbrad

What if "Other Basic" was moved from "Other languages" to just under "VB6 and earlier". 
Even without all the current interest in TwinBasic and Radbasic, it might be a more appropriate location for it anyway
The subforum currently occupying that spot hasn't had a post since last October. Does it deserve to still be "above the fold"?

----------


## Eduardo-

> What if "Other Basic" was moved from "Other languages" to just under "VB6 and earlier". 
> Even without all the current interest in TwinBasic and Radbasic, it might be a more appropriate location for it anyway
> The subforum currently occupying that spot hasn't had a post since last October. Does it deserve to still be "above the fold"?


I understand you mean something like the Codebank.

FWIW I agree that more people would visit the Other BASIC sub-forum if it was "inside" VB6 and earlier.

But technically it wouldn't be totally correct. I think, to be "correct" it should be something like "Other BASIC derived from VB6" or "Other BASIC compatible with VB6" or something like that.

Also, I want to highlight that some people are coming now to the "Other BASIC" sub-forum because they are receiving notifications by e-mail of new posts on the threads (that's how I am coming) and not because the Other BASIC sub-forum became popular overnight.

Anyway, about myself I wouldn't mind to come to the Other BASIC sub-forum from time to time to see if there is something new as I do now for VB6 and earlier, but don't know about others.

----------


## mansellan

"Better" is always subjective. Is VB.Net, the language "better" than VB6? It depends... VB.Net - the language - is objectively more advanced. It has a unified type system, generics, overloads, delegates. But it's also further away from the metal. There's a VM in the mix, complete with generational garbage collection. For any given use-case, perhaps that's the best fit, perhaps not.

VB6 is "better" in that it compiles to native Win32. No massive framework to depend on or tow around. Simple, deterministic memory management. It can do inline assembly.

This is why I love (and bought into) the concept of twinBASIC - modern source constructs but native code. It's something that .Net (despite several attempts) hasn't ever achieved. It might be better*

*No such thing.

----------


## vbrad

> I understand you mean something like the Codebank.
> 
> FWIW I agree that more people would visit the Other BASIC sub-forum if it was "inside" VB6 and earlier.
> 
> But technically it wouldn't be totally correct. I think, to be "correct" it should be something like "Other BASIC derived from VB6" or "Other BASIC compatible with VB6" or something like that.
> 
> Also, I want to highlight that some people are coming now to the "Other BASIC" sub-forum because they are receiving notifications by e-mail of new posts on the threads (that's how I am coming) and not because the Other BASIC sub-forum became popular overnight.
> 
> Anyway, about myself I wouldn't mind to come to the Other BASIC sub-forum from time to time to see if there is something new as I do now for VB6 and earlier, but don't know about others.


Hi Eduardo
I wasn't really thinking of "inside" [VB6 and earlier] but underneath it, where [Universal Windows Platform and Modern Windows Experience] is now.
Regarding the emails, those are only sent to people who already posted on those threads. New visitors may never see them with [Other Basic] being
so far down the pecking order.
Anyway it was just a thought.

----------


## Eduardo-

> Regarding the emails, those are only sent to people who already posted on those threads. New visitors may never see them with [Other Basic] being
> so far down the pecking order.


Yes, that was my point of the sudden "popularity" of Other BASIC (probably).

----------


## vbrad

> Yes, that was my point of the sudden "popularity" of Other BASIC (probably).


Ah, OK, I misunderstood your point

----------


## Niya

> "Better" is always subjective. Is VB.Net, the language "better" than VB6? It depends... VB.Net - the language - is objectively more advanced. It has a unified type system, generics, overloads, delegates. But it's also further away from the metal. There's a VM in the mix, complete with generational garbage collection. For any given use-case, perhaps that's the best fit, perhaps not.
> 
> VB6 is "better" in that it compiles to native Win32. No massive framework to depend on or tow around. Simple, deterministic memory management. It can do inline assembly.
> 
> This is why I love (and bought into) the concept of twinBASIC - modern source constructs but native code. It's something that .Net (despite several attempts) hasn't ever achieved. It might be better*
> 
> *No such thing.


When I say VB6, I'm talking about about language, IDE and the runtime.

Anyways, I could go in on this but I've already done so many times before so I'm not going to prolong this discussion and derail this thread any further. This is not an attack on you or anything by the way. It's just that I think I've said all I had to say on the topic over the years. There is very little I could say now that would be new information. Everyone should use what they like but what someone likes doesn't change facts. That's all I'm saying. There are tools, frameworks and languages that I think are better in a lot of regards than Microsoft's .Net tools and I have no problem admitting that I'm using an inferior tool. For example, I think Flutter might be a far better platform for creating Android applications than Xamarin/C# but I will still use Xamarin. I just prefer to use it for now since I'm far more familiar with the tech, not because I think it's better. But if I intend to go into Android development seriously, I will use the best tool for the job. None of this is emotional for me. There is no loyalty with me when it comes what tools to use. I used to be like that but as I got older I realized that it is foolish to be too attached to specific tools just because you love them. 

I think over the years, I just became a lot more objective about evaluating things like this. Most people can't be that objective which I think is the source of all the contention here.

----------


## Shaggy Hiker

> What if "Other Basic" was moved from "Other languages" to just under "VB6 and earlier". 
> Even without all the current interest in TwinBasic and Radbasic, it might be a more appropriate location for it anyway
> The subforum currently occupying that spot hasn't had a post since last October. Does it deserve to still be "above the fold"?


That's a good idea. Please repost this suggestion in the Forum Feedback.

----------


## IndicSoftware

> For example, I think Flutter might be a far better platform for creating Android applications than Xamarin/C# but I will still use Xamarin. I just prefer to use it for now since I'm far more familiar with the tech, not because I think it's better. But if I intend to go into Android development seriously, I will use the best tool for the job.


Perfectly said. I also personally believe that we need to use the best tool available for a task in the market. In my case I prefer using B4A instead of any other mobile development tools when it comes to developing apps for Android platform.

I will just narrate a small incidence. A few years back we started developing a product  called AlbumSense (now split into two products AlbumSense and PhotoSense) for a client in VB6. We studied PhotoDemon's code and borrowed quite a lot from it, but as we progressed in our development we started running into problems especially performance related problems in image processing.

So after spending around 4 months on development in VB6. But we had to ditch it and switch to Delphi as it has all the things (read components) that we want. And it was finalized that we want to give one single executable of the software instead of shipping a plethora of supporting libraries (DLLs), etc. with it.

We completed the product development in record time and our client is selling it like hot cakes for a while now.

During the phase when we switched from VB6 to Delphi we had a lot of problem finding assistant codes who knew Pascal. And it was as this time that we got the idea of creating a development tool that will have a huge library of components/controls (over time) and that would allow one to program in multiple languages in the same project and thus was born MixLangz.

----------


## vbrad

> That's a good idea. Please repost this suggestion in the Forum Feedback.


Thanks Shaggy Hiker, I'm glad that you agree! I'll do that right away!

----------


## Niya

> So after spending around 4 months on development in VB6. But we had to ditch it and switch to Delphi as it has all the things (read components) that we want. And it was finalized that we want to give one single executable of the software instead of shipping a plethora of supporting libraries (DLLs), etc. with it.


Well there you go.  :Smilie:

----------


## 2kaud

Way back when, I preferred Delphi over c/c++ as at the time I was a Pascal 'expert' - and it did have all those components. I also preferred Borland c/c++ over Microsoft - until I was forced to use Microsoft... Borland is now Embarcadero but their c++ compilers still have all those components. Pity they don't do a free 'Community' version - just a trial version.

----------


## SearchingDataOnly

Removed...

----------


## yereverluvinuncleber

For Christ's sake blokes. Can you not keep a thread on track? You are honestly all on your own agendas here and each seems to be focussed on solely attempting to win a spurious and pointless argument or poking others to respond.

We know how you feel already. Honestly, can you please let it go and let TwinBasic be the point of discussion on a TwinBasic thread?

See my signature and add your own name to that list and let's move on!

----------


## SearchingDataOnly

> For Christ's sake blokes. Can you not keep a thread on track? You are honestly all on your own agendas here and each seems to be focussed on solely attempting to win a spurious and pointless argument or poking others to respond.
> 
> We know how you feel already. Honestly, can you please let it go and let TwinBasic be the point of discussion on a TwinBasic thread?
> 
> See my signature and add your own name to that list and let's move on!


I'm from an authoritarian country and I'm trying to experience the taste of democracy.  :Wink:

----------


## Arnoutdv

Free speech doesnt mean you have to say everything you think.

----------


## WaynePhillipsEA

> [*]Intellisense does not initiate parameter/return types after typing spacebar (accepts only tab for some reason).


Just to let you know, the spacebar should now be confirming the intellisense option as of v0.10.4966 of tB.

----------


## VB6 Programming

twinBASIC status update:

https://nolongerset.com/twinbasic-up...ugust-22-2021/

----------


## TTn

> Just to let you know, the spacebar should now be confirming the intellisense option as of v0.10.4966 of tB.


Wow thanks, that was quick!   I will take a look tonight to see the progress, I'm working out installer kinks at the moment with msm files.  

Things are going better than I hoped on both projects.  Thank you for keeping VB6 compatibility a high priority.

----------


## TTn

> ... should now be confirming the intellisense option as of v0.10.4966 of tB.


Yes, it does confirm the selected intellisense.  Except, it does not auto-select the closest match.  I have to use arrow keys to select, then type spacebar.

In VB6 i can type the letters:



```
If me.wi {spacebar}
```

We get *Me.Width*.
The word is autocompleted very fast and fluidly.  This is important for the flow of human writing, especially when the words are longer.
Still, this is a big improvement for tB.  Good work getting that sorted.

----------


## Niya

If you're still around Wayne I wanted to make another minor suggestion. String interpolation. Here's an example of how it works in VB.Net:-


```
        Dim name As String = "Kathy"
        Dim age As Integer = 14
        Dim address As String = "121 Pine Street"

        Debug.WriteLine($"{name} is {CStr(age)} years old. She lives at {address}.")
```

Output:-


```
Kathy is 14 years old. She lives at 121 Pine Street.
```

This feature is such a huge help when dealing with Strings in VB.Net. It would be nice if TwinBASIC had something like this if it doesn't already.

----------


## IndicSoftware

> Way back when, I preferred Delphi over c/c++ as at the time I was a Pascal 'expert' - and it did have all those components. I also preferred Borland c/c++ over Microsoft - until I was forced to use Microsoft... Borland is now Embarcadero but their c++ compilers still have all those components. Pity they don't do a free 'Community' version - just a trial version.


Currently there is a community version of C++ Builder available. Please have a look at this.



> https://www.embarcadero.com/products/cbuilder/starter

----------


## WaynePhillipsEA

> If you're still around Wayne I wanted to make another minor suggestion. String interpolation. Here's an example of how it works in VB.Net:-
> 
> 
> ```
>         Dim name As String = "Kathy"
>         Dim age As Integer = 14
>         Dim address As String = "121 Pine Street"
> 
>         Debug.WriteLine($"{name} is {CStr(age)} years old. She lives at {address}.")
> ...


Thanks Niya.  Yes, string interpolation has been discussed and is planned, see https://github.com/WaynePhillipsEA/twinbasic/issues/132

----------


## Cristianlt23

> I may be wrong, but apparently the twinbasic goes further ...



I agree

----------


## OptionBase1

> You don't speak American English. The proper phrase, and one which you do hear a LOT in the US, would be, "Ain't there no coffee in that cup?" If you turn the slang "ain't" into proper English, that sentence becomes: "Is not there no coffee in that cup?" 
> 
> I would suggest, therefore, that "Ain't there no coffee in that cup?" is at least as bad as what you say you never hear, but it's in common usage. It's called a double negative. Peopled use them without thinking about the actual meaning, and they are quite common. Whether they use them as double negatives or not doesn't even matter. Speech is what we use it to be.


Nobody doesn't like Sara Lee.

----------


## VB6 Programming

twinBASIC status update:

https://nolongerset.com/twinbasic-up...ugust-29-2021/

Highlights include Unit Testing support, conditional breakpoints, the Nz() function, and various IntelliSense improvements.

----------


## getgrowing

Hello,
I primly work with MS-Access. If I want to try out something, I make a copy of the file.
I'm not familiar with Source-Control etc. jet.
What is the recommended way to work with Tb Versions of a project?
Thanks for useful links, to learn with.

----------


## VB6 Programming

twinBASIC status update:

https://nolongerset.com/twinbasic-up...tember-5-2021/

Highlights include IntelliSense in the Debug Console, unit testing improvements, and the addition of #Error and #Warning directives.

----------


## SearchingDataOnly

JavaScript has a comma operator, for example:


```
if (a, b, c, d) { 
    ... 
    ...
    return e, f, g, h;
}
```

Maybe twinBasic could add a similar operation, that is, use a colon instead of the comma operator, for example:


```
If (a: b: c: d) Then
...
...
End If
```

The above is equivalent to:


```
Call a
Call b
Call c

If d Then
...
...
End If
```

----------


## Arnoutdv

What an odd syntax, can lead to a lot of confusion

----------


## SearchingDataOnly

> What an odd syntax, can lead to a lot of confusion


The part is a bit confusing, but the whole is clearer. 

Most syntactic sugar is more confusing for beginners, but once they are familiar and used to these syntactic sugars, they seem to rely more and more on syntactic sugar.

----------


## PlausiblyDamp

> The part is a bit confusing, but the whole is clearer. 
> 
> Most syntactic sugar is more confusing for beginners, but once they are familiar and used to these syntactic sugars, they seem to rely more and more on syntactic sugar.


VB.Net has a similar idea using Tuples behind the scenes


```
Imports System.Globalization

Public Module NumericLibrary
    Public Function ParseInteger(value As String) As (Success As Boolean, Number As Int32)
        Dim number As Integer
        Return (Int32.TryParse(value, NumberStyles.Any, CultureInfo.InvariantCulture, number), number)
    End Function
End Module
```

That snippet is from https://docs.microsoft.com/en-us/dot...-return-values

----------


## SearchingDataOnly

> VB.Net has a similar idea using Tuples behind the scenes
> 
> 
> ```
> Imports System.Globalization
> 
> Public Module NumericLibrary
>     Public Function ParseInteger(value As String) As (Success As Boolean, Number As Int32)
>         Dim number As Integer
> ...


VB.NET has a lot of excellent syntactic sugar. Although I will never use VB.NET, I have been absorbing some valuable syntax from VB.NET syntactic sugar.

However, the tuple of VB.NET and the comma operator of JS are completely different concepts, and their uses are also completely different.



```
if (a, b, c, d) { 
    ... 
    ...
    return e, f, g, h;
}
```

The above is equivalent to:


```
a;
b;
c;
if (d){
    ...
    ...
    e;
    f;
    g;
    return h;
}
```

Since a, b, c, d are a group of closely related statements/expressions, putting them in parentheses makes the whole code block clearer: (a, b, c, d)

Similarly, e, f, g, and h are also a group of closely related statements/expressions, so they are also placed in the parentheses: (e, f, g, h)

----------


## Arnoutdv

Hmmm.
I often use the following construct in VB6


```
Public Function myFunction(lInput As Long, sInput As String, ByRef lReturnValue1 As Long, ByRef sReturnValue2 As String) As Boolean
  ' Bla bla
End Function
```

----------


## Zvoni

> Hmmm.
> I often use the following construct in VB6
> 
> 
> ```
> Public Function myFunction(lInput As Long, sInput As Long, ByRef lReturnValue1 As Long, ByRef sReturnValue2 As String) As Boolean
>   ' Bla bla
> End Function
> ```


I use that too.
It's basically the way the C-WinApi is designed: return the result in a Reference, and the function-result is some kind of error-code.

Arnout, for clarity's sake: Your first two arguments should be ByVal! (Not implicit ByRef as it's now)

----------


## Arnoutdv

I know, if you don't specify ByVal or ByRef the default is ByRef :-)

----------


## Shaggy Hiker

I don't see the value of the comma separator. Seems more likely to cause confusion than anything else.

Still, if you want to load every kind of construct you can come up with into a language, why not just use C#?

----------


## VB6 Programming

twinBASIC update:

https://nolongerset.com/twinbasic-up...ember-12-2021/

Highlights include VS Code Extensibility, RGB extraction functions, dropping Finalize(), and a discussion regarding potential typedef support.

----------


## Niya

> twinBASIC update:
> 
> https://nolongerset.com/twinbasic-up...ember-12-2021/
> 
> Highlights include VS Code Extensibility, RGB extraction functions, dropping Finalize(), and a discussion regarding potential typedef support.


Nice update.

The conversation on _typedef_ support was rather interesting. However, I think it's a bad idea, not because of any technical demerit but simply because I don't think this discussion takes into consideration undisciplined programmers. VB6 and BASIC in general tend to attract a lot of non-programmers that bring with them a serious lack of coding discipline. typedefs make it extremely easy to turn even the simplest programs into an unreadable mess. I really don't think something like this belongs in any BASIC language to be honest.

----------


## vbrad

> VB6 and BASIC in general tend to attract a lot of non-programmers that bring with them a serious lack of coding discipline.


I think that's a moot point today
I'd have thought that Python would have long since become the destination of choice for non-programmers looking to do a bit of coding.
And try dabbling in vb.net these days and you get very little assistance. All the microsoft examples are in c#. 
In my brief experience it looks harder to find help for vb.net than vb6
What newbie is going to choose vb.net over c# in those circumstances?

----------


## Niya

> I think that's a moot point today
> I'd have thought that Python would have long since become the destination of choice for non-programmers looking to do a bit of coding.
> And try dabbling in vb.net these days and you get very little assistance. All the microsoft examples are in c#. 
> In my brief experience it looks harder to find help for vb.net than vb6
> What newbie is going to choose vb.net over c# in those circumstances?


You might be right. Who knows. All I know is something as powerful _typedef_ needs to be used responsibly. People who come from unforgiving programming backgrounds like C++ tend to be very respectful of it's power. Perhaps it might be good for TwinBASIC, I don't know. I'm not really leaning hard one way or another. It's just that my first instinct is that it doesn't belong in BASIC. I could be wrong. I guess we'll see what happens.

----------


## Krool

@Niya,
everything can be mis-used. The typedef is like a UDT, just shortcut like. (direct)

----------


## Zvoni

> You might be right. Who knows. All I know is something as powerful _typedef_ needs to be used responsibly. People who come from unforgiving programming backgrounds like C++ tend to be very respectful of it's power. Perhaps it might be good for TwinBASIC, I don't know. I'm not really leaning hard one way or another. It's just that my first instinct is that it doesn't belong in BASIC. I could be wrong. I guess we'll see what happens.


I'm of two minds about TypeDefs:
Reading C-Code it drives me up the walls trying to figure out, what's the "original" type.
Not knowing any better, i think TypeDefs in C were invented because C-Programmers are lazy buggers :-)

OTOH, the example on the page linked to above, defining SubSets of Types is intriguing, so a MyWindow=MyMenu shouldn't compile despite being the same base-type

----------


## Schmidt

> It's just that my first instinct is that it doesn't belong in BASIC.


Like for example, "anonymous functions"?  :Wink: 

Olaf

----------


## 2kaud

> because C-Programmers are lazy buggers :-)


Quite right and c++ ones are worse! Why type begin when you can use { and end instead of } Why use int when you could use I or D instead of double. Typing just gets in the way of coding. Come to think of it, why not just use APL...  :Big Grin:   :Stick Out Tongue:

----------


## Zvoni

IMO, TypeDefs only make sense if you're supposed to code Cross-Platform and/or cross-bitness, to write your code only once.

along the lines of


```
#If Win64 Then
Public Type APointer As UInt64
#Else
Public Type APointer As UInt32
#End If

Public Function GetPointer As APointer
'Bla
End If
```

EDIT: And even this (conditional compilation) is subject to discussion, if this shouldn't be handled by the IDE, say, the chosen compile-target

----------


## Niya

> @Niya,
> everything can be mis-used. The typedef is like a UDT, just shortcut like. (direct)


Like I said, it was just my instinct. The issue of whether typedefs should be included in a BASIC language is not one I'm prepared to go to war over. I'm fine with them being included. They are powerful and when used right can really improve productivity. But it's just so scary to think about how easily they can be abused to create an unreadable mess.




> Like for example, "anonymous functions"? 
> 
> Olaf


A script kiddie just learning the power of programming could do a lot more damage with typedefs than anonymous functions.  :Big Grin:

----------


## Niya

> i think TypeDefs in C were invented because C-Programmers are lazy buggers :-)


Errr...not so fast. They are a great feature *when used with discipline*. I've grown to appreciate them over the years because of it's usage in the Win32 API. They can make things a lot easier to understand when used properly.

For example, take HWND and HBITMAP. Both these things are nothing more than a HANDLE typedef which in turn is a typedef for a void pointer(void*) . This means that both HWND and HBITMAP are just ordinary pointers. But when you encounter HWND while reading a piece of code, you immediately know what is expected, in this case, a handle to a window. Without typedefs, you would have void* all over the place and you could never be sure if a certain function expects a handle to a window or a bitmap. Typedefs can help make it much easier reason about what a piece of code is doing because of the extra information it provides to the one reading the code. Without typedefs, the only other way to do this would be to use classes and structures which are both good options but sometimes it's overkill. Typedefs allow you a way to create new types without actually creating new types which is an incredibly efficient way of solving this problem.

The thing is, it's extremely easy to abuse and if one is not careful, it can make code thoroughly unreadable. It could very well be the most destructive feature ever conceived in the world of programming when used improperly. It requires incredible discipline to use this effectively in a large codebase. The Microsoft guys are very disciplined and still, it sometimes feel like a chore trying to decipher typedefs in their C++ header files. Typedefs are not a feature to treat lightly.

----------


## Zvoni

> Errr...not so fast. They are a great feature *when used with discipline*. I've grown to appreciate them over the years because of it's usage in the Win32 API. They can make things a lot easier to understand when used properly.
> 
> For example, take HWND and HBITMAP. Both these things are nothing more than a HANDLE typedef which in turn is a typedef for a void pointer(void*) . This means that both HWND and HBITMAP are just ordinary pointers. But when you encounter HWND while reading a piece of code, you immediately know what is expected, in this case, a handle to a window. Without typedefs, you would have void* all over the place and you could never be sure if a certain function expects a handle to a window or a bitmap. Typedefs can help make it much easier reason about what a piece of code is doing because of the extra information it provides to the one reading the code. Without typedefs, the only other way to do this would be to use classes and structures which are both good options but sometimes it's overkill. Typedefs allow you a way to create new types without actually creating new types which is an incredibly efficient way of solving this problem.
> 
> The thing is, it's extremely easy to abuse and if one is not careful, it can make code thoroughly unreadable. It could very well be the most destructive features ever conceived in the world of programming when used improperly. It requires incredible discipline to use this effectively in a large codebase. The Microsoft guys are very disciplined and still, it sometimes feel like a chore trying to decipher typedefs in their C++ header files. Typedefs are not a feature to treat lightly.


Hmm, OK, agreed. Haven't looked at it from that POV, since i've never programmed a single line in C or C++.
And you're probably right with discipline at Microsoft.
But since i'm reading (!!) a lot of C-Code (No MS-Code --> writing bindings for custom c-lib in Pascal), it just annoys the hell out of me, when i have to ask "is that an Integer, an unsigned Integer or what?"
And let's not talk about hungarian notation ad nauseum

Yes, everything in life works effectively, if you apply discipline to it.
I'm a skydiver. With no discipline i'd just burn a whole into the sky, and be a danger to me and others
Christiano Ronaldo became the best footballer of the world with what? Correct, discipline.

The problem is, that a lot of people try to use shortcuts, and leave a mess behind.

----------


## Niya

Yep. That's pretty much it.




> Haven't looked at it from that POV, since i've never programmed a single line in C or C++.


You can benefit from it without having to use C/C++ if you ever use Win32 extensively. The most common examples you'd encounter is API functions that take strings. When you see LPWSTR, you immediately know you're expected to pass a pointer to a UTF-16 string. If you see LPSTR, you know immediately that an ANSI string is expected and if you see LPTSTR, you know that the expected string is ANSI if you're on any Windows pre-XP and UTF-16 on any NT based Windows. All of these typedefs boil down to a char*. If this were used instead, all you would know is that a pointer to a character array is expected. Unless explicitly written somewhere, you'd never know what kind of character array is expected.

----------


## Shaggy Hiker

> I think that's a moot point today
> I'd have thought that Python would have long since become the destination of choice for non-programmers looking to do a bit of coding.
> And try dabbling in vb.net these days and you get very little assistance. All the microsoft examples are in c#. 
> In my brief experience it looks harder to find help for vb.net than vb6
> What newbie is going to choose vb.net over c# in those circumstances?


That may just be you, actually. For some reason, I tend to find VB.NET examples even when looking for C#. MS tends to put out both, often on tabbed pages, but I wonder if Google doesn't have a hand in the search results you and I are getting?

----------


## Niya

Here's a thing I got reminded of when I came across this thread. Asynchronous methods. Has there been any discussion about whether asynchronous methods will be implemented in TwinBASIC?

Not only do they exist in .Net(VB and C#), they are also implemented in many languages including Python and JavaScript. Async/Await has become quite a popular paradigm over the last decade and I think their inclusion in TwinBASIC is a very important discussion to be had. And they can be included without breaking compatibility with VB6 in any way.

----------


## Krool

> Here's a thing I got reminded of when I came across this thread. Asynchronous methods. Has there been any discussion about whether asynchronous methods will be implemented in TwinBASIC?
> 
> Not only do they exist in .Net(VB and C#), they are also implemented in many languages including Python and JavaScript. Async/Await has become quite a popular paradigm over the last decade and I think their inclusion in TwinBASIC is a very important discussion to be had. And they can be included without breaking compatibility with VB6 in any way.


Yes there is a open issue in GitHub for that.
https://github.com/WaynePhillipsEA/twinbasic/issues/173

----------


## vbrad

> That may just be you, actually. For some reason, I tend to find VB.NET examples even when looking for C#. MS tends to put out both, often on tabbed pages, but I wonder if Google doesn't have a hand in the search results you and I are getting?


That could well be it because I never look for vb.net stuffn normally. But i have been playing around with it a bit recently
making great progress NOT!

As an example, the following shell command works in vb6 but not in vb.net and I've no idea why



```
        Dim s As String
        s = """C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE"" ""C:\test folder\Project1.Vbp"""

        'VB.NET (2008)
        Shell(s, AppWinStyle.MaximizedFocus) 'System.IO.FileNotFoundException was unhandled
        
        'VB6
        Shell s, vbMaximizedFocus  'works
```

----------


## PlausiblyDamp

> That could well be it because I never look for vb.net stuffn normally. But i have been playing around with it a bit recently
> making great progress NOT!
> 
> As an example, the following shell command works in vb6 but not in vb.net and I've no idea why
> 
> 
> 
> ```
>         Dim s As String
> ...


Does the exception have any detail in it's error message or inner exception as to which file wasn't found?

Also. Net has the Process class amongst others to make launching external applications a lot easier.

----------


## vbrad

> Does the exception have any detail in it's error message or inner exception as to which file wasn't found?
> 
> Also. Net has the Process class amongst others to make launching external applications a lot easier.


Hi PD, thanks for your interest.
The "inner exception:" was empty and no mention of a file name that i could see, (both are present).
The following strings with no arguments also failed with the same exception and with no inner exception text, if that suggests anything.



```
s = "C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE"
        s = """C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE"""
        Shell(s, AppWinStyle.MaximizedFocus)
```

I think I got Process.start() to work at some point but it simply ignored the Command string argument, ie it just opened VB6 with no project selected.

Maybe it's a vb2008 thing?

----------


## Niya

Those old VB6 style things like Shell was provided to make VB6 programmers feel more comfortable with .Net but makes no mistake, doing things that way is strongly discouraged in VB.Net. I'm not surprised that fails for some unknown reason. Process.Start is the way to go.




> Yes there is a open issue in GitHub for that.
> https://github.com/WaynePhillipsEA/twinbasic/issues/173


Ah ok.

----------


## Shaggy Hiker

So...now this thread has wandered into VB.NET???

----------


## Niya

> So...now this thread has wandered into VB.NET???


A lot of TwinBASIC features, both suggested and implemented, are inspired by VB.Net. Generics even use the exact same syntax.

----------


## vbrad

> Those old VB6 style things like Shell was provided to make VB6 programmers feel more comfortable with .Net but makes no mistake, doing things that way is strongly discouraged in VB.Net. I'm not surprised that fails for some unknown reason. Process.Start is the way to go.


Yes but pasting *"C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE" "C:\test folder\Project1.Vbp"* into cmd.exe, works too!
So VB6 and the Windows 10 command line work but vb.net fails?

EDIT:
Process.Start worked in both the following formats:


```
Process.Start("""C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE""", """C:\test folder\Project1.Vbp""")
'and
Process.Start("C:\Program Files (x86)\Microsoft Visual Studio\VB98\VB6.EXE", """C:\test folder\Project1.Vbp""")
```

It failed if I did not wrap the arguments parameter in double quotes because of the space in the address.
It worked with or without the extra double quotes in the firat parameter.

Anyway I'll leave it there, sorry for sidetracking the conversation.

----------


## Niya

To be honest, I couldn't tell you why that fails because in my opinion it would just be a waste of time trying to figure out why since using the Process class is the way to go. When I first moved to VB.Net from VB6, I only used those old VB6 things for like a week or two before I learned to do things the .Net way. There are probably all kinds of bugs and quirks in this old VB6 compatibility namespace.

----------


## vbrad

> To be honest, I couldn't tell you why that fails because in my opinion it would just be a waste of time trying to figure out why since using the Process class is the way to go. When I first moved to VB.Net from VB6, I only used those old VB6 things for like a week or two before I learned to do things the .Net way. There are probably all kinds of bugs and quirks in this old VB6 compatibility namespace.


Actually I don't know that it is a member of the VB6 compatibility namespace. I think it's part of core vb.net if that makes sense and looking at the intellisense just now (sorry!) it doesn't mention accepting arguments in its path whereas the target path in the vb6 function can include arguments.

----------


## Niya

> Actually I don't know that it is a member of the VB6 compatibility namespace.


It's fully qualified name is _Microsoft.VisualBasic.Interaction.Shell()_. The Microsoft.VisualBasic namespace is provided for compatibility with VB6. You will find all of the VB6 stuff in that namespace and it's use is not recommended for development. It was only provided to make migration of code from VB6 to VB.Net less of a chore, though it failed in this regard since the differences between VB6 and VB.Net goes far beyond what is contained in that namespace alone.

----------


## VB6 Programming

twinBASIC status update:

https://nolongerset.com/twinbasic-up...ember-19-2021/

_Highlights include discussions around block scoping and a planned ObjRefCount() function.

_

----------


## vbrad

> It's fully qualified name is _Microsoft.VisualBasic.Interaction.Shell()_. The Microsoft.VisualBasic namespace is provided for compatibility with VB6. You will find all of the VB6 stuff in that namespace and it's use is not recommended for development. It was only provided to make migration of code from VB6 to VB.Net less of a chore, though it failed in this regard since the differences between VB6 and VB.Net goes far beyond what is contained in that namespace alone.


Thanks Niya, I stand corrected (The reason why I'd thought it might not have been was because I hadn't put in any import statements but it had still worked).

----------


## Niya

> (The reason why I'd thought it might not have been was because I hadn't put in any import statements but it had still worked).


Well remember, Microsoft wanted VB6 developers to use VB.Net instead so the extra hassle of having to import it might have been off-putting which is why it is imported by default. They wanted to make the transition as easy as possible. It worked in my case. It made it very easy for me to transition from VB6 to VB.Net and gave me something to rely on until I learned how to do things "the .Net way".

----------


## lfeche

Hello!
Great job!
When will it be possible to upload VB6 projects to TwinBasic?

----------


## Niya

> When will it be possible to upload VB6 projects to TwinBasic?


That is still a ways off. It still needs a GUI engine which is in the works but not completed yet. However, it is already fully capable of executing non-GUI VB6 code. It just cannot yet read VB6's project formats. You'd have to manually copy-paste your VB6 code.

----------


## lfeche

Thanks!

----------


## VB6 Programming

twinBASIC status update:

https://nolongerset.com/twinbasic-up...ember-26-2021/

_Highlights include a sneak peek at building custom form controls, the related dynamic property sheet, and a bunch of screenshots teasing the upcoming features._

----------


## VB6 Programming

twinBASIC GUI/Forms Designer progress:

https://github.com/WaynePhillipsEA/t...iscussions/451

----------


## VB6 Programming

twinBASIC status update:

https://nolongerset.com/twinbasic-up...ctober-3-2021/

_Highlights include a glimpse into the possible GUI release timeline and a discussion about data binding with twinBASIC forms._

----------


## VB6 Programming

Video of the twinBASIC form designer in action, and a simple grid control (less than 100 lines of code for the OnPaint method).

twinBASIC form designer video

_This form designer and cross-platform forms engine based on custom-drawn controls is specifically designed for later supporting multi-platforms.

Later there will be VB6-compatible Forms engine, including implementation of all basic controls and support for ActiveX controls._

----------


## Niya

TwinBASIC is starting to look very sexy! Can't wait to get back to testing it.

----------


## VB6 Programming

twinBASIC update...

https://nolongerset.com/twinbasic-up...tober-10-2021/

_Highlights include an extended preview of the yet-to-be-released form designer and a spirited discussion about whether to fork VS Code to create a dedicated tB IDE._

----------


## VB6 Programming

The first version of the Form Designer and Custom Controls are now in twinBASIC v0.11.

Here is a sample project with a grid control...
https://user-images.githubuserconten...ee2ac68be1.gif

Initially this is only available to those who have pre-ordered a twinBASIC license.

----------


## VB6 Programming

twinBASIC update...

https://nolongerset.com/twinbasic-up...tober-17-2021/

_Highlights include the alpha release of CustomControls, a twinBASIC wiki, and a revived discussion around "Quirks Mode" in twinBASIC._

----------


## Niya

> twinBASIC update...
> 
> https://nolongerset.com/twinbasic-up...tober-17-2021/
> 
> _Highlights include the alpha release of CustomControls, a twinBASIC wiki, and a revived discussion around "Quirks Mode" in twinBASIC._


That quirks mode discussion is interesting. Not sure how I feel about it. On the one hand, all these quirks and bugs in VB6 are no good and need to be gone but on the other hand it's necessary for backward compatibility with VB6. It seems the aim of 100% compatibility with VB6 would demand some sacrifices. Hope it doesn't become so much that TwinBASIC becomes just as broken and painful to use as VB6.

----------


## VB6 Programming

> It seems the aim of 100% compatibility with VB6 would demand some sacrifices.


Backwards compatibility is never as straightforward as it sounds.  But it has to be the overriding aim. Otherwise (as happened with VB.Net) developers simply won't migrate existing apps.

So you have to replicate VB quirks in twinBASIC.

That may sometimes mean you have 2 ways of coding something - the old, quirky, way and a new (more) correct way - each potentially giving different results.

In some cases you may get 2 different results from the same code, depending whether the old or new way is selected. I don't like this, and would prefer the old statements gave the old quirks and new, improved code to give the correct result.

Old quirky statements could be optionally disabled with options/flags, but I think I would still allow them but mark them as 'deprecated'.

----------


## Niya

I think Microsoft already showed us the way when it comes to how to handle this. In VB.Net, they provided a namespace with most of the VB6 stuff that works the way it did in VB6 but you could opt to use the Framework to do it the .Net way.

TwinBASIC could take a similar approach. They could have all the quirky behavior be the default but then they could provide a bunch of modern replacements with no quirks in the form of a new set of classes, or a modules. This way all of the old VB6 programs still work but anyone that wants to get away from the legacy stuff could use the new classes or whatever to opt-in to the new way of doing things. Those of us that left VB6 to go into VB.Net took a similar path. We started by doing things the old way but slowly learned how to do it the modern way.

----------


## PlausiblyDamp

> In some cases you may get 2 different results from the same code, depending whether the old or new way is selected. I don't like this, and would prefer the old statements gave the old quirks and new, improved code to give the correct result.


You also have to contend with code that might need to work either way - if a library exists it might need to accept an "old" data type or a "new" data type that conceptually are the same. Making sure a library can cope with both versions, including all the quirks can quickly start to get complicated.

----------


## Niya

> You also have to contend with code that might need to work either way - if a library exists it might need to accept an "old" data type or a "new" data type that conceptually are the same. Making sure a library can cope with both versions, including all the quirks can quickly start to get complicated.


Yea, this definitely a big problem.

----------


## yereverluvinuncleber

It should always run in quirks mode and any 'advances' or changes to original spec. should be switched on an individual basis, item by item, flag by flag.

Improvements are welcome but not required. The same code compiled to 64bit with quirks should be the minimum.

----------


## VB6 Programming

twinBASIC update...

https://nolongerset.com/twinbasic-up...tober-24-2021/

_Highlights include the addition of 4 new custom control events, ElementTabStop/Index properties, and a Spanish presentation on twinBASIC._

----------


## Episcopal

> I think Microsoft already showed us the way when it comes to how to handle this. In VB.Net, they provided a namespace with most of the VB6 stuff that works the way it did in VB6 but you could opt to use the Framework to do it the .Net way.
> 
> TwinBASIC could take a similar approach.



I totally agree... if it's not too much work for the twinbasic developers.

----------


## VB6 Programming

There have now been over 1000 downloads of the twinBASIC preview.


https://marketplace.visualstudio.com...false#overview

----------


## yereverluvinuncleber

No need to be complicated. 

The superior alternative path is the best one. All VB6 quirks are coded exactly as the originals, with superior alternatives offered in their place. Then all older code will work but ultimately for any new coding the superior alternative will be the one developers will choose automatically.  The better in this case being the enemy of the sufficient... or the quirky.

----------


## Shaggy Hiker

The namespace idea would be a good one. What would be ideal would be the ability to easily toggle on and off the old way would make it easy for somebody to see where they were using the inferior such that they can focus on changing those. Once they have them all changed, they could turn off the inferior way for good. It's good to allow the old way to work, but it's also good to have a means to push people away from it.

----------


## mansellan

Heh, that's almost exactly what MS did with the Net Core transition...

(net framework (net standard) net core)

Net standard was just a bridge. As soon as enough people crossed it, they burned it to the ground.

----------


## Eduardo-

> Once they have them all changed, they could turn off the inferior way for good.


I don't think that will ever happen with VB6 --> tB.
There will keep appearing new programmers (to tB) coming from VB6 for many years.

----------


## VB6 Programming

twinBASIC update...

https://nolongerset.com/twinbasic-up...tober-31-2021/

_Highlights include initial support for a Clipboard object, a new custom control sample (Wayne's TextBox), and support for Return as an alias for Exit Sub._

----------


## Niya

> twinBASIC update...
> 
> https://nolongerset.com/twinbasic-up...tober-31-2021/
> 
> _Highlights include initial support for a Clipboard object, a new custom control sample (Wayne's TextBox), and support for Return as an alias for Exit Sub._


This literally made me laugh:-



> Supporting this feature would break backward compatibility in a very narrow way.  The issue is that a bare Return statement with no matching GoSub in VBx is a runtime error and not a compile error.  So, it is theoretically possible that some madman out there is relying on a bare Return raising a runtime error and when that code gets converted to twinBASIC...and does not raise an error...then his code will stop working.  *But, you know what?  Screw that guy.*


I love this dude, whoever he is.  :Wink:

----------


## Shaggy Hiker

Yeah, that's a good answer. Anybody who is relying on that behavior...has issues.

----------


## VB6 Programming

twinBASIC update:

https://nolongerset.com/twinbasic-up...vember-7-2021/

_Highlights include our first look at a working twinBASIC form, the early makings of inheritance support, and the promise of custom ActiveX control development._

----------


## VB6 Programming

A new release of twinBASIC v0.12.117 is available.

The licence key requirement for the Custom Controls is removed from this version so anyone can test/try it.

See Sample6 for an example of using a form with custom controls.

This shows the Form Designer using custom controls. This is an early implementation of the form designer. 
The intention is to develop this further in 2 ways:
1) to develop a VB6 compatible form designer using all basic controls and supporting ActiveX controls.
2) to support multi-platform (Windows, Linux, Mac and Android) where ActiveX controls aren't supported.

https://marketplace.visualstudio.com...false#overview

----------


## VB6 Programming

twinBASIC update:

https://nolongerset.com/twinbasic-up...ember-14-2021/

_Highlights include temporary removal of the license key requirement for CustomControls and partial inheritance support using Implements ... Via._

----------


## VB6 Programming

*twinBASIC major milestone release - PREVIEW 2 - v0.13.x - 64 BIT SUPPORT*

Full 64-bit compilation support, including EXE/DLL builds, integrated debugger, integrated linker, etc.

To get started, first you need to create a win64 build configuration in your projects. To help you, when you first open your projects in v0.13.1, the IDE will prompt you to create one.

Now you should be able to activate the win64 build configuration.
After selecting win64, you'll be prompted to restart the compiler. After doing so, you'll be debugging and compiling in full 64-bit.

https://github.com/WaynePhillipsEA/t...iscussions/496

64-bit compilation for non-licence holders is allowed, though EXE and DLL compilations will display an embedded twinBASIC splash screen for 5 seconds at startup.  twinBASIC licence holders will of course not be subjected to this.

----------


## VB6 Programming

twinBASIC update...

https://nolongerset.com/twinbasic-up...ember-21-2021/

_Highlights include 64-bit compilation support (no license required!) and a discussion about early binding and reference handling._

----------


## VB6 Programming

*twinBASIC release 0.13.5*

Latest additions to twinBASIC:

Initial support for File I/O statements: Open (Binary / Random modes only), Put, Get 

Implementations for VBA.FileSystem members: FreeFile, EOF, LOF, FileAttr, Loc, Seek, Reset

----------


## Niya

No link this time?  :Frown:

----------


## VB6 Programming

> No link this time?


Links   :Smilie: 

File I/O support

twinBASIC Preview 2 out now

twinBASIC install

----------


## Niya

> Links  
> 
> File I/O support
> 
> twinBASIC Preview 2 out now
> 
> twinBASIC install


I was actually referring to the links to your site with all the "around the web" stuff. I enjoy reading those updates....




> Links  
> 
> File I/O support


The file I/O discussion is pretty interesting. I think Unicode support it should be part of the Open statement syntax for the reasons stated by _bclothier_. It would encourage defensive coding practices that would just be messy.

----------


## VB6 Programming

> I was actually referring to the links to your site with all the "around the web" stuff. I enjoy reading those updates....


?

Are you meaning this site... https://nolongerset.com/

That's not me, it's Microsoft MVP Mike Wolfe's site.  He does a summary every Sunday of the status of twinBASIC.

----------


## Niya

Ah ok.

----------


## VB6 Programming

twinBASIC update:

https://nolongerset.com/twinbasic-up...ember-28-2021/

_Highlights include the first major release of file handling statements and functions in twinBASIC, along with talk of providing a tB license to the Rubberduck project._

----------


## VB6 Programming

twinBASIC update:

https://nolongerset.com/twinbasic-up...cember-5-2021/

_Highlights include the implementation of additional File System features, improved performance for Split and Replace, and a discussion about universal binaries._

----------


## VB6 Programming

File I/O is now supported in twinBASIC with v0.13.30
Experimental support for the Encoding argument has been added to support UTF-8 and UTF-16 as well as ANSI.

twinBASIC are now looking at handling migration from a VB6 project (.vbp).
A VB6-compatible Forms engine, including GUI support, implementation of all basic controls and support for ActiveX controls, is expected (in Alpha) in February.

----------


## yokesee

good job twinBASIC  :Smilie:

----------


## VB6 Programming

twinBASIC update:

https://nolongerset.com/twinbasic-up...ember-12-2021/

_Highlights include the File I/O system reaching feature-complete status, an updated twinBASIC roadmap, and experimental text encoding support._

----------


## Niya

Olaf really can't help himself can he. Someone mentions VB.Net and he is just ready to pounce lol.

Interesting discussion on Tuples though. I don't use them much(though I should) but I think they are a great feature. There's just so many times where you want to return multiple values from a function and it just seems wasteful to define and entire class just for that one function. Tuples solve this problem.

----------


## baka

well, Wayne can add whatever he wishes, since he is the dev,
for me, I can already do that stuff anyway

Sub DoStuff(U As UDTtype)
     U.Name = "MyName"
     U.Age = 20
     U.Income = 50000
     U.Object(1) = "Plate"
End Sub

Sub DoStuff(B() As String)
     B(1) = "MyName"
     B(2) = "YourName"
End Sub

what would be the use? it just feel bloated and non-intuitive.

like this: max, min = maxmin(a, b)

we could just easily do:

Sub maxmin(Byval A As Integer, Byval B as Long, Min As Long, Max As Long)

----------


## yereverluvinuncleber

> Olaf really can't help himself can he. Someone mentions VB.Net and he is just ready to pounce lol.


Actually, from experience I think that applies much more so to you Niya.

Personally, I would prefer if TB would constrain itself to what VB6 does at the moment. That should be the mantra. Introducing new functionality always introduces new complexity, bugs and more importantly, delays. Just make it work, fix the intrinsic bugs that will be created in any case and then only add new functionality when the product is usable. 

We don't need tassles, bells, whistles, basket, foghorn &c. We just want a bike we can ride.

----------


## Niya

You know I really don't understand you guys. Do you guys want TwinBASIC to succeed or not? Like it or not, the programming world has changed since VB6's prime years. People are now programming with tuples, Async/Await. Functional style constructs are also becoming increasingly popular. This means, functions must be first class citizens to support higher order functions. Python is now being touted as the BASIC of the modern age, a language that is simple and easy to learn and it has all of these things. Simplicity is no longer an excuse to avoid these things. Modern programmers are not afraid of these things. If you want TwinBASIC to take off, then you must bring it up to the expected standards of the modern programmer. 

I mean don't you guys want to see a world where TwinBASIC can crack top 10 on one of those indexes you guys like so much like TIOBE? This is what must be done for that to have a chance of happening. Don't you want a vibrant and thriving community akin to other communities like C#, Python and JavaScript? Then you must make the language attractive to the modern programmer. Don't you guys want 100 super talented people like Olaf to come into this community? This is how you attract that talent. You do not do this by artificially crippling your language to the point that it resembles something from the 90s. 

One of TwinBASIC's core missions is 100% compatibility with VB6 and most of these things can be implemented without sacrificing that mission. Come on guys. Stop being so afraid of change.

----------


## Niya

> Personally, I would prefer if TB would constrain itself to what VB6 does at the moment.


As per my post above, this is just a terrible idea if it's permanent. I really hope Wayne doesn't give into this sentiment.

----------


## yereverluvinuncleber

> As per my post above, this is just a terrible idea if it's permanent.


You are the master of the misquote and I've seen you do this before.

I definitely said  - "only add new functionality when the product is usable" and I explained my reasoning but somehow you fail to see 50% of what is said and only misquote in order to... ? well, frankly I don't know, is it to give yourself something to do?

Please, in future don't do that. It annoys.

----------


## Schmidt

> Olaf really can't help himself can he. Someone mentions VB.Net and he is just ready to pounce lol.


That had nothing to do with .NET.
I'd just like it very much, when the language could remain free of unnecessary "features".




> Interesting discussion on Tuples though. I don't use them much...


Nobody is using them much... (aside from a few special, often math-heavy areas).

Tuples are just "dynamically created Mini-Lists" (an aggregation, returnable from a function, or "storable in an outer List") - 
and in VBScript/VBA/VB6 we already have the Array() function, to create such Tuples on the fly.

E.g. if your OuterList is a VB6-Collection, one can easily add (and later retrieve) tuples this way:
Dim OuterList As New Collection, Tuple
OuterList.Add Array(1, 2, 3)
OuterList.Add Array(4, 5, 6)
For Each Tuple In OuterList: Debug.Print Tuple(0): Next

All possible, due to the Variant-Type (which I consider one of the strengths of the language).

Olaf

----------


## Niya

> That had nothing to do with .NET.
> I'd just like it very much, when the language could remain free of unnecessary "features".


To be honest, I really don't agree with this mindset. I've alreavy detailed why about 2 posts ago.




> Nobody is using them much... (aside from a few special, often math-heavy areas).


You are correct but for right now. They aren't that popular a feature but I will be lying if I told you I don't see them showing up more and more when I look up random snippets of code online in other languages. Personally, they are not a feature I'm willing to die for. I would be 100% fine without them. That being said, I think for the good of TwinBASIC, Wayne should not ignore this. Tuples might be necessary if he wants to attract modern talent to his product. Modern programmers expect these things. I think he should implement them.

I get that you guys have your own ways of implementing Tuple-like functionality with the VB6 syntax and base libraries but I cannot envision these young cats out here being enthusiastic about such a primitive way of doing things, especially if they come from environments like Python or C#.

----------


## baka

if people would skip TwinBasic just because theres no tuples they most be very narrow minded.

the reason I would pick TwinBasic is:

- it can replace VB6
- newer compile
- better optimized and faster
- fix DPI and other issues VB6 has
- eventually cross platform
- eventually fully 64bit

if TwinBasic would be:

- Identical to VB6
- tons of .NET & other languages functionalities
- fully support to tuples
- no cross platform
- no 64bit

I would just keep using VB6.

----------


## Niya

> if people would skip TwinBasic just because theres no tuples they most be very narrow minded.


Tuples alone? No. But Tuples along with most other modern features, definitely yes. If all TwinBASIC aimed to be is just a perfect VB6 clone with no improvements to the language. I would not look it it twice nor recommend it to anyone.

----------


## yereverluvinuncleber

> if people would skip TwinBasic just because theres no tuples they most be very narrow minded.
> 
> the reason I would pick TwinBasic is:
> 
> - it can replace VB6
> - newer compile
> - better optimized and faster
> - fix DPI and other issues VB6 has
> - eventually cross platform
> - eventually fully 64bit


Just that...

I have my own list of improvements/additions but I would NEVER muddy the waters at this point and dare to introduce any of them as I want TB/RB to succeed. If that success is jeopardised by the addition of the multiplicity of such small improvements then that is a risk I am not willing to ask anyone to take.

Baka's list above would be in itself a phenomenal achievement.

----------


## yereverluvinuncleber

> Tuples are just "dynamically created Mini-Lists" (an aggregation, returnable from a function, or "storable in an outer List") - 
> and in VBScript/VBA/VB6 we already have the Array() function, to create such Tuples on the fly.
> 
> E.g. if your OuterList is a VB6-Collection, one can easily add (and later retrieve) tuples this way:
> Dim OuterList As New Collection, Tuple
> OuterList.Add Array(1, 2, 3)
> OuterList.Add Array(4, 5, 6)
> For Each Tuple In OuterList: Debug.Print Tuple(0): Next
> 
> All possible, due to the Variant-Type (which I consider one of the strengths of the language).



Olaf, I love the way that you use the tools at hand to solve a situation, combination of brainpower and the understanding of the tool that you have to use in the first place.

I had always perceived the variant type to be one to avoid given my original intention to migrate my programs to VB.NET. However, I am beginning to revisit variants in the light of my less than positive exposure to VB.NET and the potential of the forthcoming replacement TB (and RB). Should I re-evaluate the variant type and take it off my naughty list? I have tried to avoid it when at all possible.

----------


## baka

the route for TwinBasic should be:


1. fully vb6 compatible
2. optimization of all vb6 functionality that need improvement
3. how to add features for different "upgrades" of core VB6 functionality (to keep legacy but also fix different issues VB6 has, like DPI aware)
4. how to easily switch 32 to 64bit. to differentiate between the 2 modes, such as API declaration, type declaration etc.
5. how to easily switch between 32/64/cross platform mode
6. add modern gui, that also help bridge the cross platform mode
7. add sound support, that also can be used in cross platform
8. add support for any monitor changes, this so we can easily adapt the code when monitor is changing resolution etc.
9. other feature that are needed for modern rad development that was not needed 20 years ago. and always keep in mind the cross platform compatibility

when all that is done, and we can start working on projects, that we can release in windows but also other platforms,
when the IDE is stable and the compiled executable is well optimized, at that point, other feature could be added,
now when people are using it, it will also be easier to tell what do we actually need.

like VB6, is done and we know the strong and weak points, and the workarounds to make it work when theres some issue.
so we already know what we would need for VB6. but Im not sure what we need in TwinBasic yet.

----------


## Niya

> the route for TwinBasic should be:
> 
> 
> 1. fully vb6 compatible
> 2. optimization of all vb6 functionality that need improvement
> 3. how to add features for different "upgrades" of core VB6 functionality (to keep legacy but also fix different issues VB6 has, like DPI aware)
> 4. how to easily switch 32 to 64bit. to differentiate between the 2 modes, such as API declaration, type declaration etc.
> 5. how to easily switch between 32/64/cross platform mode
> 6. add modern gui, that also help bridge the cross platform mode
> ...


I agree 100% with all of this. Don't get me wrong. 

What I am saying is that you also cannot ignore some of these requests people are making like Tuples. As a fan of more modern language contracts myself, if I were active over there, I'd be pushing for making functions first class citizens in the language. I don't think I would ever want to use a language long term where this is not the case. I think a lot of people would over look it if it doesn't meet a specific standard which is based on what is already popular in other mainstream languages. TwinBASIC looks very promising so far with features like generics and multi-threading. I would hate to see it to stagnate and not keep pushing for new improvements.

EDIT:-

I'd further state that the only real justification not implementing a feature is such a case that violates the goal of 100% VB6 compatibility. The only potential language improvement I've seen so far that violates this is the removal of that garbage Set statement. The truth is most modern improvements would not prevent TwinBASIC from being VB6 compatible.

----------


## baka

yeah.

its an inspiration for the DEV, when people give feedback and comments and ideas.
right now I feel that the "improvement" should be about the essentials for VB,

such as "Decimal/LongPtr/LongLong" types, that I would need so I dont need to first declare as Variant and after that change its type to Decimal.
that I wouldn't say anything against. I would say: go ahead. since you are already working with data types, why not add a few more?

unicode and other modes, make the gui work with 24/32bit , well, anything that are about improvement of the core VB6 that is 20 years behind.
if VB6 would improve on its own, Im sure we would have all those things already. thats what TwinBasic should focus first.

but only, if the improvement are obvious and not much time-consuming. like: if the DEV is adding graphic rendering, why not just let it be 24/32bit immediately?
it shouldn't post that much extra work. and like the types, if he adds the VB6 types, its not that much extra work to add a few more.

I think theres an order of things, otherwise its easy you mess up, because theres no end of features, u can always find something new to add.
better stay in course and focus on the basics, since the important thing is to "migrate" all of us first, and we will do that when TwinBasic can do what VB6 can do.
after that we will be part of the ride and will give feedback and bug reports when needed.

----------


## Niya

> yeah.
> 
> its an inspiration for the DEV, when people give feedback and comments and ideas.
> right now I feel that the "improvement" should be about the essentials for VB,
> 
> such as "Decimal/LongPtr/LongLong" types, that I would need so I dont need to first declare as Variant and after that change its type to Decimal.
> that I wouldn't say anything against. I would say: go ahead. since you are already working with data types, why not add a few more?
> 
> unicode and other modes, make the gui work with 24/32bit , well, anything that are about improvement of the core VB6 that is 20 years behind.
> ...


I would say though, there should be a cut off point where it's too much. C# is an example of a language that is loaded to the brim with an unrelenting river of features. I don't think any language that derives from BASIC should go that far but it shouldn't remain where it was 20 years ago either. Tuples, Async/Await, easy mult-threading, higher order functions are just some of the more common things I think a modern language should have even if it's derived from BASIC.

----------


## Niya

> But no-one group is saying that...


Olaf is. He doesn't want the language to be changed that much. Perhaps he would correct me on this but it seems to me that if he had his way, then they syntax would not change at all which is exactly what I think is a bad idea.

----------


## Eduardo-

My concern about new features is that...
OK, this assumes that RadBasic will succeed. I think Carles is making progress, but I don't have much information about that now.

So, at the moment we have something that is already working, and well (twinBASIC) and something that we don't know (RadBasic).
So, we can't "ask" for nothing on that basis now.

But assuming that RadBasic will succeed, I would like for the VB6 successors to form something like a "consortium", where they could agree on the language.
Of course I don't mean the I want identical products, but I mean as compatible as possible.
For example, if both languages will add tuples, do it with the same syntax.

twinBasic already added lots of new features and syntax, and some of us have been helping on that process (OK, personally I very little). We discuss things trying to find the best way to do something.
I think, "and what would Carles do?". I don't know, but I think that the best syntax for tW will also be the best for RB.

Carles already stated that his route is (like the ideas of yereverluvinuncleber) first to achieve full replacement of VB6 and only after that to introduce improvements and add new features.
But of course he will have to do that at some point (to add new things and syntax), so my concern is that both languages should be as compatible as possible and more important: the language itself should use same syntax. 
That is my wish, of course, it is my opinion.

OK, it is still too early. 
We'll have to wait until RB is available to the open, and if Carles sticks to the idea of not adding new features until the full replacement is achieved, until then.
But I wanted to express my concern, and my wishes (in advance, for that moment).

----------


## yereverluvinuncleber

I have always suggested something like the ECMA group but for BASIC. However, if you think about having Olaf and Niya on the same group or anyone similar with strong views it would be a continuous battle. You'd have to physically keep the .NOTters out of the room.

VB6 acts as the design for the basis of both products and we would hope that what is good for one is also good for the other. I believe that Carles' approach is the preferable one. It is both an approach and a goal combined and achieving such an early consensus is something that only a one man team can easily achieve. 

Carles and the TB chaps have spoken but I think both of their heads will be down in the code trying to meet their milestones and too busy to work in concert on new functionality. Carles at least will have the benefit of hindsight when it comes to making any decisions on language features as the TB team will have spent their precious time working it all through.

----------


## Eduardo-

> I have always suggested something like the ECMA group but for BASIC. However, if you think about having Olaf and Niya on the same group or anyone similar with strong views it would be a continuous battle. You'd have to physically keep the .NOTters out of the room.


I'm not talking about Niya and Olaf, but Wayne and Carles.
All the others (like us) can be proponent of ideas, express opinions, but don't decide anything.

They could add more people to the "management group" (the consortium) of course, if they want.

----------


## yereverluvinuncleber

> I'm not talking about Niya and Olaf, but Wayne and Carles.
> All the others (like us) can be proponent of ideas, express opinions, but don't decide anything.
> 
> They could add more people to the "management group" (the consortium) of course, if they want.


Yes of course but I was referring to an ECMA-type group that I had previously suggested. I realised from the outset that the idea was/is a non-starter.

----------


## Eduardo-

> Yes of course but I was referring to an ECMA-type group that I had previously suggested. I realised from the outset that the idea was/is a non-starter.


If you put everybody there, yes. 
But I didn't suggest that.

----------


## wqweto

The main proposition of TB is to be able to compile VBx code "as is" with minimal modifications. The other direction of code round-trip is non-essential IMO and I would very much prefer to see more extras implemented and generally going forward.

By stumbling upon *generics* in the early alphas of the compiler it was clear that Wayne's intentions were to bring VBx screaming into modernity whoever likes it or not.

Currently enhancing the syntax with new keywords will *always* bring incompatibility with old code e.g. when I recently migrated an old project of mine had to correct this innocuous looking line of code

GoTo Continue
. . . because Continue is already a keyword in TB and the parser is not clever enough to allow labels to match new keywords -- the extra effort is not worth it or it might be impossible to implement correctly.

The compiler has to decide if

Continue:
. . . is a label (as in VBx) or a logical line with two statements -- first a Continue statement and then an empty one?

cheers,
</wqw>

----------


## Niya

> My concern about new features is that...
> OK, this assumes that RadBasic will succeed. I think Carles is making progress, but I don't have much information about that now.
> 
> So, at the moment we have something that is already working, and well (twinBASIC) and something that we don't know (RadBasic).
> So, we can't "ask" for nothing on that basis now.
> 
> But assuming that RadBasic will succeed, I would like for the VB6 successors to form something like a "consortium", where they could agree on the language.
> Of course I don't mean the I want identical products, but I mean as compatible as possible.
> For example, if both languages will add tuples, do it with the same syntax.
> ...


Well the number #1 goal above all else is VB6 compatibility. I think this could be achieved while giving most people what they want.

----------


## Niya

> The main proposition of TB is to be able to compile VBx code "as is" with minimal modifications. The other direction of code round-trip is non-essential IMO and I would very much prefer to see more extras implemented and generally going forward.
> 
> By stumbling upon *generics* in the early alphas of the compiler it was clear that Wayne's intentions were to bring VBx screaming into modernity whoever likes it or not.
> 
> Currently enhancing the syntax with new keywords will *always* bring incompatibility with old code e.g. when I recently migrated an old project of mine had to correct this innocuous looking line of code
> 
> GoTo Continue
> . . . because Continue is already a keyword in TB and the parser is not clever enough to allow labels to match new keywords -- the extra effort is not worth it or it might be impossible to implement correctly.
> 
> ...


This would make for an interesting discussion. Is the Continue statement worth the incompatibility with projects that use Continue as a line label? I think it is but I'm curious to see any counter arguments to this.

----------


## Eduardo-

> The main proposition of TB is to be able to compile VBx code "as is" with minimal modifications. The other direction of code round-trip is non-essential IMO and I would very much prefer to see more extras implemented and generally going forward.
> 
> By stumbling upon *generics* in the early alphas of the compiler it was clear that Wayne's intentions were to bring VBx screaming into modernity whoever likes it or not.
> 
> Currently enhancing the syntax with new keywords will *always* bring incompatibility with old code e.g. when I recently migrated an old project of mine had to correct this innocuous looking line of code
> 
> GoTo Continue
> . . . because Continue is already a keyword in TB and the parser is not clever enough to allow labels to match new keywords -- the extra effort is not worth it or it might be impossible to implement correctly.
> 
> ...


I don't think it would be difficult to parse, since labels go after a GoTo or a Gosub, and no more (AFAIK, but may be I'm missing something).
If the "Continue" is after a GoTo or a GoSub, then it is a label, and any "Continue" on that procedure means the label and not the new keyword.

But the parser should first search the whole procedure code to see if there is a "Continue" after a GoTo or a GoSub, because the label could be at the beginning.

I'm not sure if it worth the complication, but possible I think it is possible.

----------


## yereverluvinuncleber

> If you put everybody there, yes. 
> But I didn't suggest that.


Nor did I.

----------


## Eduardo-

> Well the number #1 goal above all else is VB6 compatibility.


Yes.




> I think this could be achieved while giving most people what they want.


I have no idea what that means in the context. I was talking about agreeing on the same syntax for new language additions and improvements.

----------


## Eduardo-

> Nor did I.


OK, then IDK what you suggested.

I think that having as many opinions (qualified ones) as you can get, the better.
But the decisions should be made by a few, namely Carles and Wayne.

----------


## Eduardo-

> This would make for an interesting discussion. Is the Continue statement worth the incompatibility with projects that use Continue as a line label? I think it is but I'm curious to see any counter arguments to this.


I think it does, otherwise now in VB6 you have to use GoTo or to set variables and check conditions.

----------


## yereverluvinuncleber

> The main proposition of TB is to be able to compile VBx code "as is" with minimal modifications. The other direction of code round-trip is non-essential IMO and I would very much prefer to see more extras implemented and generally going forward.
> 
> By stumbling upon *generics* in the early alphas of the compiler it was clear that Wayne's intentions were to bring VBx screaming into modernity whoever likes it or not.
> 
> Currently enhancing the syntax with new keywords will *always* bring incompatibility with old code e.g. when I recently migrated an old project of mine had to correct this innocuous looking line of code
> 
> GoTo Continue
> . . . because Continue is already a keyword in TB and the parser is not clever enough to allow labels to match new keywords -- the extra effort is not worth it or it might be impossible to implement correctly.
> 
> ...


I think Carle's approach is simply cleaner and if it gets RB into a position to correspond to Baka's first list then it is a win for us. I can't comment on the technological approach of each team but if all else is equal and the speed of development is the same then RB's approach would seem to be the one that will get them to that point faster.

Wayne is very good to respond to queries, requests and considering new functionality but isn't that slowing him down from the core goals?

----------


## Niya

> I have no idea what that means in the context. I was talking about agreeing on the same syntax for new language additions and improvements.


What I mean is they can give people modern features while still achieving the goal of VB6 compatibility. All I'm saying is that these two goals are not mutually exclusive. 

For example, if I were to use TwinBASIC on a full time basis, I'd want to have higher order functions. It would be one of my biggest wants. I doubt that this would conflict with the ultimate goal of VB6 compatibility. Some people want Tuples and I've seen a whole lot of very interesting suggestions on their GitHub discussions and to my mind, I think most of them can be implemented without impacting the main mission of VB6 compatibility.

----------


## yereverluvinuncleber

> OK, then IDK what you suggested.


I keep wondering why you keep bringing it up...  :Smilie: 

All else agreed.

----------


## Niya

> I don't think it would be difficult to parse, since labels go after a GoTo or a Gosub, and no more (AFAIK, but may be I'm missing something).
> If the "Continue" is after a GoTo or a GoSub, then it is a label, and any "Continue" on that procedure means the label and not the new keyword.
> 
> But the parser should first search the whole procedure code to see if there is a "Continue" after a GoTo or a GoSub, because the label could be at the beginning.
> 
> I'm not sure if it worth the complication, but possible I think it is possible.


Actually there is a solution. Micorsoft's solution to this was square brackets. In VB.Net if you wanted to use a reserved keyword as an identifier, you surround it in square braces like this:-


```
[Continue]
```

Something like this would probably work to solve this problem.

----------


## Eduardo-

> What I mean is they can give people modern features while still achieving the goal of VB6 compatibility. All I'm saying is that these two goals are not mutually exclusive. 
> 
> For example, if I were to use TwinBASIC on a full time basis, I'd want to have higher order functions. It would be one of my biggest wants. I doubt that this would conflict with the ultimate goal of VB6 compatibility. Some people want Tuples and I've seen a whole lot of very interesting suggestions on their GitHub discussions and to my mind, I think most of them can be implemented without impacting the main mission of VB6 compatibility.


VB6 backward compatibility and full replacement (of VB6 main core, I mean the IDE, compiler) is out of the question. Both have been totally clear about the point.

To enhance it, is also well explicitly set on both cases.
The difference is the path, while RB plan is to achieve the full replacement first, tB path is to add new features in the way, and from the beginning.

I say this based on what I read on their websites.

----------


## Eduardo-

> Actually there is a solution. Micorsoft's solution to this was square brackets. In VB.Net if you wanted to use a reserved keyword as an identifier, you surround it in square braces like this:-
> 
> 
> ```
> [Continue]
> ```
> 
> Something like this would probably work to solve this problem.


That won't work for providing backward compatibility.
The VB6 code is already written.

----------


## Schmidt

> Olaf is. He doesn't want the language to be changed that much.


Nonsense.

What I want (doing compiler-development myself), is the developer to concentrate on 1:1 compatibilit first.
That's "hard enough" to do.

Only *after* that goal is reached, extensions to the language should be discussed.
(aside from a few things, which "come cheap" - as e.g. variable initializing in the Dim-Line).

And while discussing such extensions, one should not make the mistake of:
- "intruducing something new", which is already existing

And in case of Tuple-support, we basically already have "full compatibility, to how python handles tuples".
in python, you write:
SomeTuple = (1, 2, 3)
and you access "tuple-members" by specifying a zerobased index:
print(SomeTuple[0])

In VB we would do:
SomeTuple = Array(1, 2, 3)
and access it in a similar way (via ZeroBased Index:
Debug.Print SomeTuple(0)

So, one simple thing a compiler-dev could do (if the goal is, to make it "more python-compatible") - 
is, to make the Array-Function specifier "optional" (which should not be that hard, when a comma-separated list is enclosed by parentheses).
So, that the "new VB" code could be written this way:
SomeTuple = (1, 2, 3) ' or Return (1, 2, 3) which TB already supports for function-results
and access it in a similar way (via ZeroBased Index:
Debug.Print SomeTuple(0) 

Eh voila, python-compatible tuple-support in "new VB"...

As for the *kind* of new features I would like to see (or implement) in a VB6-successor, 
I would always prefer to open it up to the "lower end" - so that it becomes more "C-like".

E.g. an easy way to pre-define Function-Declarations in a Const-Variable - 
then passing this "typed Function-Pointer" along into Routines (as a nice, lowlevel way to support "delegates").

VB6 already *is* as a thin (COM-layer-supporting) abstraction on top of C/C++...
And I would like (in potential new features), when it would "open up a bit more to that lower level" - 
(making it easier to access with less typing-efforts, supported by more compiler-checks).

Olaf

----------


## Niya

> VB6 backward compatibility and full replacement (of VB6 main core, I mean the IDE, compiler) is out of the question. Both have been totally clear about the point.
> 
> To enhance it, is also well explicitly set on both cases.
> The difference is the path, while RB plan is to achieve the full replacement first, tB path is to add new features in the way, and from the beginning.
> 
> I say this based on what I read on their websites.


Ah ok I see what you're getting at. I'm not sure I have much of a strong opinion on differences between tB and RB. I'd have to see what RB is doing to really form a solid opinion.

----------


## Niya

> Nonsense.
> 
> What I want (doing compiler-development myself), is the developer to concentrate on 1:1 compatibilit first.
> That's "hard enough" to do.


That's fair as long as it doesn't just stop there at 1:1 compatibility. That's all I'm saying.




> And in case of Tuple-support, we basically already have "full compatibility, to how python handles tuples".
> in python, you write:
> SomeTuple = (1, 2, 3)
> and you access "tuple-members" by specifying a zerobased index:
> print(SomeTuple[0])
> 
> In VB we would do:
> SomeTuple = Array(1, 2, 3)
> and access it in a similar way (via ZeroBased Index:
> ...


Well I'll say this. For me personally, Tuples aren't something I'll fight to the death for but that doesn't mean others won't. I could personally live without them but I do see their value and I can understand why some may want them. All I'm saying is to give these people a fair hearing.




> As for the *kind* of new features I would like to see (or implement) in a VB6-successor, 
> I would always prefer to open it up to the "lower end" - so that it becomes more "C-like".
> 
> E.g. an easy way to pre-define Function-Declarations in a Const-Variable - 
> then passing this "typed Function-Pointer" along into Routines (as a nice, lowlevel way to support "delegates").
> 
> VB6 already *is* as a thin (COM-layer-supporting) abstraction on top of C/C++...
> And I would like (in potential new features), when it would "open up a bit more to that lower level" - 
> (making it easier to access with less typing-efforts, supported by more compiler-checks).
> ...


This I definitely agree with. Towards this I've always held the opinion that TwinBASIC could be spiced up with strong control over marshalling like we have in .Net where we can control how certain data types are marshalled to and from the Win32 API and other external binaries. 

Another thing I think would be valuable is more access to COM internals specifically with regards to the generation of type libraries. Basically an easy mode MIDL type thing where you can opt for direct control over what is written type libraries when you compile something like an ActiveX DLL. I can't remember specifics today but way back in the day I remember being frustrated by the lack of control over COM from within the VB6 environment.

EDIT: 

I just remembered one. I wanted the ability to specify my own interface IDs for COM interfaces in an ActiveX DLL. I don't remember why I wanted this but I do remember not being able to do this from VB6. This was very long ago mind you so my memory is a bit rusty.

----------


## wqweto

> Actually there is a solution. Micorsoft's solution to this was square brackets. In VB.Net if you wanted to use a reserved keyword as an identifier, you surround it in square braces like this:-
> 
> 
> ```
> [Continue]
> ```
> 
> Something like this would probably work to solve this problem.


Not this does not work (yet) and I just opened issue #563 in the repo.

cheers,
</wqw>

----------


## Niya

> Not this does not work (yet) and I just opened issue #563 in the repo.
> 
> cheers,
> </wqw>


Ah ok.

----------


## axisdj

Hello,

Let me chime in.

I think the first real challenge no one has been able to achieve is very close 99% compatibility with vb6. If this can happen and so far it looks like twinBasic has a very good handle on this, it will allow current vb6 users to migrate, creating a long lasting sustainable framework. This part is super exciting and we all have waited a couple of decades for this. Imagine spending a month or so migrating our apps and maybe even getting them to work on other platforms (64bit/android/mac/linux). This will be so amazing for those of us who make a living selling our vb6 apps.

I think the second point is that maybe some of these modern features may be needed to attract new users to TwinBasic. This will be a secondary but very important factor in a long term sustainable vb6 replacement. 

So keeping features to a 1:1 set with vb6 is probably the most important, but also adding modern features as long as they do not interfere can also help bring new users to the vb6/TwinBasic world.

I am so thankful and excited we may finally get what we need for the people who have large vb6 projects, it is an amazing time to be alive

my 2 cents... happy times!

----------


## Niya

> I think the second point is that maybe some of these modern features may be needed to attract new users to TwinBasic. This will be a secondary but very important factor in a long term sustainable vb6 replacement. 
> 
> So keeping features to a 1:1 set with vb6 is probably the most important, but also adding modern features as long as they do not interfere can also help bring new users to the vb6/TwinBasic world.


This is exactly what I was saying. You get it.

----------


## axisdj

I will add that to Olaf's point, a lot of these 'new' features are noise... and can be accomplished in a much more minimal approach.

BUT

Once programmers are sold the goods, it is hard to convince them otherwise, and if making a few well planned accommodations for the new generation so the platform will survive it is of minimal sacrifice.

I think the old way will still work, and we will have some new stuff, but without the bloat of platforms like .net

----------


## baka

no point having 10 different ways to do the exact same thing.
too many choices and it will just be confusing and harder to learn.

better to pick the function that is easy to understand, (intuitive), and as close possible to the basic language.
if we are starting to add non-basic features, it will just mess with the language itself.

----------


## Shaggy Hiker

I think it should certainly start out as simple as can be while still being complete, but we always add many ways to do the same thing. After all, you could technically do without loop control structures, but instead we have several in every modern language. You don't NEED them, because they don't exist in ASM. They were added because it makes life a LOT easier for everybody. Things like tuples are just an extension of that point: You don't NEED them. In the case of tuples, however, they don't make life a LOT easier for everybody, they make life a bit easier for a few people. 

Everybody will draw the line in different places as to which features are 'clearly essential' versus 'nice, but not necessary'. This tension has arisen over and over whenever anybody talks about a replacement for VB6. You can see it even in this thread over the last couple days. Everyone puts their oar in and pulls in whichever direction they think is best. It's to bad that it's not all in the same direction, but it's also understandable.

----------


## Niya

> Everybody will draw the line in different places as to which features are 'clearly essential' versus 'nice, but not necessary'. This tension has arisen over and over whenever anybody talks about a replacement for VB6. You can see it even in this thread over the last couple days. Everyone puts their oar in and pulls in whichever direction they think is best. It's to bad that it's not all in the same direction, but it's also understandable.


This is a very strong argument for centralized decision making. I'd also add that whoever has the final authority should have an iron will. The biggest challenge I think Wanye would have in all this is saying no. He will have to be able to say no and stand by his decision regardless of any storm of criticism that may come from that. Otherwise you will end up with a huge mish-mash of ideas that don't really work well together because it's trying to be everything to everyone.

----------


## axisdj

> no point having 10 different ways to do the exact same thing.
> too many choices and it will just be confusing and harder to learn.
> 
> better to pick the function that is easy to understand, (intuitive), and as close possible to the basic language.
> if we are starting to add non-basic features, it will just mess with the language itself.


Interesting point.

just thinking out loud here... maybe a guide to say something like:

looking for tuples? here is how to get the same functionality using variants.

or whatever else has a new buzz word, just have examples of how to accomplish the same with current vb6 methods.

I do think sticking to the vb6 minimalism has great value.

----------


## Niya

> I do think sticking to the vb6 minimalism has great value.


I think this should be put to the community to see how others feel about it and then Wayne can make a decision based on the feedback.

----------


## Shaggy Hiker

I think it already has been. All anybody needs to do is look around this forum for the threads on a new VB6 / VB6 replacement. There is always somebody asking for JUST VB6 compatibility, others asking for just that..plus a bit more, and still more asking for a raft of changes.

I'd say that Wayne should do what Wayne is doing.

----------


## baka

Im in a gaming community forum, and theres many developers, and newcomers every month, but also many devs that fails all the time.
one thing that I noticed is that theres no lack of ambition, but not many can withstand the pressure.
theres devs that want to accommodate everyone, and devs that succumb to the masses when the masses complain, even if its just a couple it seems that devs are more focused on the people that complains more than the people that give praise.

I also notice a lot of devs that changes the story, the content to please the complainers until the game is almost unrecognizable from what it was from the beginning. the creative mind, the feel of achievement and fulfillment when you have your own goals is very important, when you change that to instead be dependent to others, it will soon be that you work for someone else and not for yourself. eventually, of what I notice, the games are quite soulless and not that interesting.

to let the dev do whatever he wishes, will not always be what everyone wants, but it will be a game that you can feel its made from a person that enjoyed doing it.

the same we can apply to TwinBasic. its important to have a balance, so its "good feedback" and not "pushing it" that will make the dev feel stressed out from it.

----------


## mansellan

> Like it or not, the programming world has changed since VB6's prime years. People are now programming with tuples, Async/Await. Functional style constructs are also becoming increasingly popular. This means, functions must be first class citizens to support higher order functions. Python is now being touted as the BASIC of the modern age, a language that is simple and easy to learn and it has all of these things. Simplicity is no longer an excuse to avoid these things. Modern programmers are not afraid of these things. If you want TwinBASIC to take off, then you must bring it up to the expected standards of the modern programmer.


Entirely agree. I've mentioned twinBASIC a few times at work (we're a C# shop), and the reply I invariably get is "For the love of $deity, WHY? VB6 died 20 years ago..." Of course I don't agree with that, but like it or not it's the perception of the vast majority of the programming world.

twinBASIC's primary goal is 100% backwards compatibility, and I don't see that ever changing. But the VB6 language has stagnated for 20 years whilst the world around it has moved on. You may not consider that any given new feature is particularly important (personally, I love tuples), but collectively they make the difference between a language that feels modern versus one that does not.

From what I've seen, Wayne is pretty focused on getting to feature-parity with VB6, as can be seen from the roadmap. Bugs get fixed extremely quickly, whereas ideas for language improvements (of which I've created a few...) typically get labelled as discussion items so that ideas can be thrashed out for implementation later on down the road.

The big-ticket item for VB6 parity is UI. Work is progressing on the cross-platform UI engine, which IIUC will form the starting point for a (Windows-only) VB6 / ActiveX compatible forms engine straight after. Things like the forms designer should be completely reusable.

If you don't want to make use of any new language features, there will be an optional legacy mode which will only allow VB6 constructs.

Personally, my hope for twinBASIC is that it becomes the go-to language for creating COM-based applications. 64-bit COM has been possible since forever(ish) with C / C++, but it's not exactly user-friendly. But for that to happen, it has to modernise.

----------


## Niya

> twinBASIC's primary goal is 100% backwards compatibility, and I don't see that ever changing. But the VB6 language has stagnated for 20 years whilst the world around it has moved on. You may not consider that any given new feature is particularly important (personally, I love tuples), but collectively they make the difference between a language that feels modern versus one that does not.


Yea man, this is what I'm saying. VB6 compatibility is important, yea but making TwinBASIC a modern language is equally important, I'd even go as far as saying it's more important in the long term. There is no point without either of these goals. I just get the sense that so many people would be perfectly happy if the language remains largely unchanged which I think is a horrible idea.

----------


## baka

not sure I can agree completely. sure VB6 is old and not updated in 20 years.
if we are talking modern 3D/VR, VB6 is not exactly in the front line.

even so, you can create quite powerful windows program "right now" that can compete with any other languages.
just my game is in many ways that, since the performance is very good and comparing with similar games in my game community its like almost on another level.

why I say that? because I have a executable around 1MB that can do what the other engines requires +100MB to just start it up.
and performance wise, is eating less cpu and runs smoothly.

Im just thinking of how VB6 would be today if they improved it, adding a new compiler and continued optimizing everything.
today VB6 would be a tool that would be on par with C++, and thats what TwinBasic can be. but only if the purpose is to update VB6 of those 20 missing years.

that problem is not the language. Visual Basic 6 is already good, if not great.
the problem is low-level programming, that is what VB6 needs. like C, without it, it would be a garbage of a language.
if we can have access to low-level programming, and create DLL like C can do, it would mean, VB6 would now be on the top, not the bottom of the list.

I dont believe in many features, I believe in a language that opens the door to do stuff so we don't need C/C++ anymore.

----------


## Zvoni

I agree with the general sentiment expressed in this thread: tB should aim for as high as possible compatibility with vb6.

But i also agree with the "extensions" of others:
Cross-Platform
32 / 64-Bit target
...and whatever else people think as "nice-to-have"
As long as those are/stay exactly that: Extensions not interfering with the core/legacy language

What i'm opposed to are "features" going against the "spirit" of (Visual) Basic:
Examples:
 1) change the notation for Arrays to square brackets (like in many other languages): Debug.Print MyArray[i] --> "because it's the way other languages handle this"!
in this example i can understand (somehow) the arguments: is "a(i)" an Access to an Array-Member or is it a function-call with i as an argument?
BUT, it's the way Arrays have been in Basic for decades. Leave it. Period!

2) atrocities like
"a += 1" instead of "a = a + 1"
DON'T!

3) And a lot more.......

What i wouldn't mind seeing in tB:
a) separate operators for boolean and bitwise logic (And yes, i'm aware that this is a can of worms because of the overloaded operators in vb6)
b) bitwise operators in the first place, like ShiftLeft and sisters
c) Do i really have to mention Inheritance?
d) Type-Helpers --> Powerful feature IMO. Extend a Type with a functionality of your own (It's not inheritance!)
e) the full set of native numeric DataTypes: signed/unsigned Numeric Types 
This includes "dynamic" Types depending on the Target-Platform --> e.g. "LongPtr" being 32-Bit unsigned for 32-Bit-Target, 64-Bit unsigned for 64-Bit-Target
f) Write your own operators. With your own operators you're free to use the atrocities i mentioned in "2)" above
g) .... i'm sure i could think of other things, but let's leave it here....

----------


## Eduardo-

> 2) atrocities like
> "a += 1" instead of "a = a + 1"
> DON'T!


I agree that this is an atrocity for VB.
One of the strengths of BASIC language is that it is easily understandable, clear and intuitive.
That vudú syntax is not BASICish.

One can say: then if you don't like it, don't use it.
But when someone wants to learn the language, by buying a book or going to a forum, she will encounter this vudú syntax and can be discouraged to stay on this language.
If someone is looking for a language hard to understand, then better to go to some other ones that are harder.
Most of the languages are for nerds and complicated-minded people, BASIC was one of the few exceptions (so far).
And I think that the success that VB had, had much to do with this (and with being RAD).

----------


## WaynePhillipsEA

As can be seen by the replies here over the last few days, there is no universal agreement on the future direction of the BASIC (VB/tB/RB/whatever) language, and I doubt there ever will be.  This is understandable, especially given the length of time that has passed since VB was last updated.  It is clear that everyone has their own individual opinions and expectations that suits their own specific circumstances.

With twinBASIC the #1 priority is, and always has been, backwards compatibility.  In terms of code-compatibility we're already getting very close to this goal.  As of today, there's not much non-GUI VB code that won't compile in tB, and we've pretty much implemented the full language syntax and the full VBA standard library, barring a few obscure bits.   Today we even added support for importing VBP projects (excluding GUI elements).

Along with the goal of full backwards compatibility, we are of course adding new features to the language, when it feels appropriate to do so.  There is no getting around this;  programming languages have moved on, and so to attract new talent requires bringing some of those new language features to twinBASIC.  The truth is that there are not enough of us old-timers to make twinBASIC successful on our own... we need to attract new talent to use the language, otherwise the long-term success would be at risk.

Many will argue that you can add new features later, but I can assure you: it's just not that easy!  The codebase for a compiler like twinBASIC is massive and complex; if you don't plan for features up-front at the start, the work to add them later is MUCH more involved (to the point where some new features might not even be possible without re-writing significant parts of the compiler).  With tB, a huge amount of effort has gone into designing an efficient and extensible compiler that has the capability to offer any of the features of more modern languages... if and when necessary.

If you want to help steer the future direction of twinBASIC, I can only encourage you to please come over to our github issue tracker and join in with the discussions.  If you've got ideas on what you'd like to see happen, please create a feature-request issue, describing your proposal.  For example, baka mentions more low-level access... please come over and show us in more detail about what you want, and how that might look in practice.   We're a friendly bunch, and I personally really want to hear from you!

I also noted that many of the comments/suggestions here over the last few days are for features that we've already implemented in twinBASIC (e.g. native Decimal/LongPtr/LongLong support, bitwise shifts, boolean logic etc), so I would first suggest checking out twinBASIC, as you may be pleasantly surprised.

----------


## wqweto

> If you want to help steer the future direction of twinBASIC, I can only encourage you to please come over to our github issue tracker and join in with the discussions.  If you've got ideas on what you'd like to see happen, please create a feature-request issue, describing your proposal.  For example, baka mentions more low-level access... please come over and show us in more detail about what you want, and how that might look in practice.   We're a friendly bunch, and I personally really want to hear from you!


Wayne, you might want to come up with some kind of a formal RFC protocol like most other languages use on github (go, rust, python) so that some of the new features in this thread can be formally specified, discussed, amended with new input and then dismissed as absurd :-))

https://github.com/rust-lang/rfcs

cheers,
</wqw>

----------


## Zvoni

> I agree that this is an atrocity for VB.
> One of the strengths of BASIC language is that it is easily understandable, clear and intuitive.
> That vudú syntax is not BASICish.
> 
> One can say: then if you don't like it, don't use it.
> But when someone wants to learn the language, by buying a book or going to a forum, she will encounter this vudú syntax and can be discouraged to stay on this language.
> If someone is looking for a language hard to understand, then better to go to some other ones that are harder.
> Most of the languages are for nerds and complicated-minded people, BASIC was one of the few exceptions (so far).
> And I think that the success that VB had, had much to do with this (and with being RAD).



Ed,

it's the reason why i mentioned writing your own operators.

with own operators available, people can write C in Basic to their hearts content.

But to be honest, in a chinese restaurant i order in english, so there is that.....  :Big Grin:

----------


## Niya

> 2) atrocities like
> "a += 1" instead of "a = a + 1"
> DON'T!


Unlike Tuples, this is one of the things I will fight to the death for. There is no way on God's green Earth I'd ever want to use a language where the only choice is a = a + 1. 

I absolutely love being able to do this:-


```
MyVeryLongVariableOrPropName += 1
```

Instead of:-


```
MyVeryLongVariableOrPropName = MyVeryLongVariableOrPropName + 1
```

Like this is very primitive. 

Thankfully though, Wayne has already implemented some of these more modern assignment operators.

But here's the thing. The people who prefer the classic BASIC way of performing increments, you can still do it. The standard binary operators still work as they always have. There is no need to fight over this specific thing. People like me can use the new operators and the people who don't like it can ignore it. Everyone wins here.

----------


## Eduardo-

> But here's the thing. The people who prefer the classic BASIC way of performing increments, you can still do it.


This is not the point, the point is not to pervert the language as I explained in post #579.
Some of us are not worried about ourselves, but interested in a future massive adoption of Basic language. So the "if you don't like it, don't use it" is a poor excuse.

Nevertheless, I would like to have a shorter way to do a = a + 1, but surely not that one.

I'll repeat myself, one of the strengths of the language is clarity, and += have no place. I'm sorry, as much as you love it.

----------


## Niya

> Some of us are not worried about ourselves, but interested in a future massive adoption of Basic language. So the "if you don't like it, don't use it" is a poor excuse.


Wayne already addressed this point of mass adoption:-



> Along with the goal of full backwards compatibility, we are of course adding new features to the language, when it feels appropriate to do so.  There is no getting around this;  programming languages have moved on, and so to attract new talent requires bringing some of those new language features to twinBASIC. The truth is that there are not enough of us old-timers to make twinBASIC successful on our own... we need to attract new talent to use the language, otherwise the long-term success would be at risk.


In other words, new features like these new operators are a must.




> Nevertheless, I would like to have a shorter way to do a = a + 1, but surely not that one.
> 
> I'll repeat myself, one of the strengths of the language is clarity, and += have no place. I'm sorry, as much as you love it.


This point is also counter to the desire to attract new talent. Other languages already do it like this and having something that feels familiar will go a long way towards attracting new people.

But I'm also curious. What shorthand would you prefer that you think is more BASIC like? The most BASIC way I could think of would be something like this:-


```
Increment(a)
```

Where the argument for Increment is passed by reference. That's about as BASIC as you can get with something like this.

----------


## baka

I agree,

thats the reason we use Basic and not something else.

clarity is what makes me like Basic,
I dont want to have a forum with lots of threads and samples with all that crap.
and thats what we will have in a few years, when the language is so diverse that its not easy to understand anymore.

how can we "help" someone when we are using different syntax to do things? it will just be a mess. and to explain that to newbies? 

and this is just 1 example, Im sure theres tons of stuff like this that will confuse.
but maybe Niya want this to happen? to create a confusing language, so he can start a new fight .NET vs TB in the future.
because a language is not just a language is also a community, forums, and people that help each other. and to do that we need stability and the use of the same syntax.

----------


## Niya

If people find simple operators like += confusing then programming is not for them. I understood what this operator did even when I was 15 years old.

----------


## Niya

Also, this entire argument is pointless because TwinBASIC already has these operators. The decision has already been made.

----------


## jpbro

I'm with Niya on this one, I like +=, etc.. operators . Took almost no time for me to understand when using other languages. They're pretty much ubiquitous across other languages, so any programmer should already encountered and understood them, and new programmers to any language will wind up encountering them wherever they go. They're much faster to use, especially when you have long variable names. And they're in tB already, so let's move on.

----------


## Zvoni

> If people find simple operators like += confusing then programming is not for them. I understood what this operator did even when I was 15 years old.


That's a non-argument if i ever saw one.

I know people who cannot read a single piece of sheet music (you know those weird glyphs on those 5 lines depicting "music"?), but they create music to die for, just by experimenting
("What happens if i press this key on the keyboard? Oh, that sounds really nice").
And that way they learn to "create" music while doing it. And they still can't read (or write) a single note on such a music sheet.

People have different strengths and skills.

and "a = a + 1" is even for a complete non-programmer more understandable than a "a += 1"

But to Wayne's answer: If it's already implemented, then be it!
I agree in that case: If you don't want to use, then don't use it!

I know when i did my transition to FreePascal/Lazarus, i came across this:
"Standard"-Way (as used from Basic): "a:=a+1;"
"Alternative"-Way: "Inc(a);" (The function has an optional second parameter you can pass the "step" to)

As always in life: Many roads lead to Rome.

----------


## Arnoutdv

What about those variants: a++, ++a
Always have to think hard when reading "for" loops in C with a lot of these additional counters

----------


## Niya

> What about those variants: a++, ++a
> Always have to think hard when reading "for" loops in C with a lot of these additional counters


I think this would be overdoing it. the += family is enough in my opinion. However, I'm not against having these additional postfix/prefix operators if that's something people want.

----------


## baka

quite bad argument Niya.
its not about that, I have knowledge of many languages and they all have their own syntax.
my argument was to create a language that has a "basic" syntax and that will make life easier in the future when we share sources.

just += is quite silly to argue and Im fine with it, but when you start adding one, you add two and eventually we have many.
thats the key argument, if you start, when its time to say "its enough"?

if the counterargument is always: but but but this we can do in .net, c#, c, c++, pascal, java, ada, ruby, sql, php, assembler, machine code, hieroglyph, sand script....

are we really talking about TwinBasic or TwinMix?

----------


## Zvoni

> I think this would be overdoing it. the += family is enough in my opinion. However, I'm not against having these additional postfix/prefix operators if that's something people want.



Agreed. That one always confused the hell out of me



```
a = 1
b = a++   'b is now 1, while a is 2
b = ++a   'b and a are now 3
```

----------


## Zvoni

> quite bad argument Niya.
> its not about that, I have knowledge of many languages and they all have their own syntax.
> my argument was to create a language that has a "basic" syntax and that will make life easier in the future when we share sources.
> 
> just += is quite silly to argue and Im fine with it, but when you start adding one, you add two and eventually we have many.
> thats the key argument, if you start, when its time to say "its enough"?
> 
> if the counterargument is always: but but but this we can do in .net, c#, c, c++, pascal, java, ada, ruby, sql, php, assembler, machine code, hieroglyph, sand script....
> 
> are we really talking about TwinBasic or TwinMix?



Exactly.
I know it from the FPC/Lazarus-Forums.
On average, every 3 months comes a (pretty much) new forum-user, asking to *add* the "feature" of curly braces to declare a code-block (instead of using keywords begin/end).
Out of 100 "old" users on that forum, some 70 are going to put the popcorn into the microwave-oven, lean back, put their feet on the table, and watch the comedy-show.
30 of them are going to argue forward and backward about that topic.
Finally, one of the compiler-devs steps in and says:
"Not going to happen! Period! Deal with it! Don't like, it? Then use C/C++ or whatever other of those curly-braces-language"

Agree with baka.
Keep the Basic "Spirit" for the "official" way.

As i said: Implement writing your own operators, and all that stuff would be a non-argument, because everyone could then write his own shortcuts like he/she likes them


```
Public Operator +=(ByVal ALong As Long, Optional ByVal AStep As long = 1) As Long
   Return ALong + AStep
End Operator
```

----------


## Shaggy Hiker

> these more modern assignment operators.


Just to be clear, there's nothing modern about += style assignment operators. They predate VB6 in C.

I've always preferred that operator over the long hand version, as well.

----------


## passel

> ...
> and "a = a + 1" is even for a complete non-programmer more understandable than a "a += 1"
> ...


Perhaps that is true, but I don't know. I can remember way back when we didn't have computers at home, and someone in a class looking at  "a = a + 1" say that didn't make any sense at all, a could never equal a + 1. 
It had to be explained that "=" didn't mean equal in this case, it was an assignment operator that was setting a to the value of a + 1.

BASIC made this clear from the start by using the syntax "Let a = a + 1" so you knew you were doing an assignment.
Eventually, someone decided that people learning to program could also learn that "a = a + 1" is doing an assignment so the "Let" keyword became optional in the later dialects.

Don't sell yourself short. I'm sure it is possible for almost anyone to learn that += is doing an assignment along with a sum.

----------


## Niya

> Just to be clear, there's nothing modern about += style assignment operators. They predate VB6 in C.
> 
> I've always preferred that operator over the long hand version, as well.


Well I mean to say that modern programmers would expect operators like this because modern languages like Python and Rust have adopted them. But yes, you're quite correct. 

Leaving *all* of them out of any modern dialect of BASIC is just foolish. At the very least, some of them should be included. You don't have to go all in and adopt every single one like postfix and prefix operators such as ++ and --. This is where the real confusion would begin. However, I'm not opposed to adding these operators too.

----------


## Niya

> Don't sell yourself short. I'm sure it is possible for almost anyone to learn that += is doing an assignment along with a sum.


Like I said before, I figured out what this operator did at 15 years old. At the time C was still way over my head due to the more advanced concepts involving pointers and memory allocations and whatnot but operators like += or ++ never confused me. I figured out what those did without any problems.

----------


## Eduardo-

> Wayne already addressed this point of mass adoption:-
> 
> In other words, new features like these new operators are a must.
> 
> You must be the king of misrepresentations or, if being well thought out, of misunderstandings. 
> 
> This point is also counter to the desire to attract new talent. Other languages already do it like this and having something that feels familiar will go a long way towards attracting new people.


That's exactly my point: to attract new people.
Yes, the ones coming from other languages that support that awkward syntax will be OK with it. But how many will come from other languages?
VB attracted lot of people that wasn't even programmers. When VB appeared I don't know how many passed from other non-Basic languages to VB. The newcomers were in general new to programming or people that had already a background in Basic.

One of the strengths of Basic is that it is easily understandable, even if you are not a programmer. What would somebody guess it means if he reads a += 1?
Knocks his head on the wall.




> But I'm also curious. What shorthand would you prefer that you think is more BASIC like? The most BASIC way I could think of would be something like this:-
> 
> 
> ```
> Increment(a)
> ```
> 
> Where the argument for Increment is passed by reference. That's about as BASIC as you can get with something like this.


You could do that already in VB6.

It is difficult to find a short and at the same time clear syntax for that, specially if you want to compete with only one character syntax (+).

I could propose:



```
Inc a ' adds 1
Inc a 2 ' adds 2
```

It looks as ASM, but at least it is more straightforward.

My point is not to add syntax until you are sure it is the best choice.
Reasons like "because it will take only half an hour" or "because it will be fun to do" should be ruled out. They are not reasons to evolve a language.

I think there should be some science about how to design a programming language, it cannot be based on hunchs, or because I received a few likes from current followers.

At least, I would like to see a broader discussion about the pros and cons of each alternative, something more serious.

About +=, perhaps it is the best possible option, but let's be more sure about that.

I'll stop worrying, I can't do anything anyway.
May God help the developers to make the best choices.

----------


## Niya

Also, I want to point out a huge contraction in the arguments of the people who are against the addition of these short-hand operators. A lot of you also argue for TwinBASIC to be more low level. You cannot argue for syntax to be simple for beginners while at the same time arguing for more low level control. You guys post a lot of code with VarPtr this or CopyMemory that. This kind of code is not beginner friendly.

I'd also point out that operators are integral to lower level programming. Let me raise an example based on a recent post I made about HRESULTs in the VB6 section. If you wanted to extract the facility code from an HRESULT, you must perform two low level operations. First you must mask out the irrelevant bits around the facility code, then you must shift all 32 bits to the right by 16.

Now lets say in an alternate reality you guys get your wish and Wayne didn't include any new operators. How would we perform this low level operation? We'd have to do it like this:-


```
facility = (errorValue And &H7FF0000) / (2 ^ 16)
```

Do you see a problem here? That code is using division to perform bit shifts. I don't know how many of you know assembly but an integer division operation at the machine code level is quite involved. It is also very slow. However, modern processors also have bit shift instructions which are among the fastest operations a processor can perform. If a higher level language does not include bit shift operators, then you're being denied access to a very powerful tool that could be used for significant performance gains in lower level programming. That same code looks like this in VB.Net which has bit shift operators:-


```
facility = (errorValue And &H7FF0000) >> 16
```

The above would also look the same in just about every modern language. Even Python has them. This is how it would look in Python:-


```
hresult = -2146824582

facilityCode= (hresult & 0x7FF0000) >> 16

print(facilityCode)
```

Which outputs:-


```
10
```

Which is correct.

Python is the furthest thing from a low level language possible. It's entirely interpreted and very sluggish in comparison to languages that produce native code and even they dared to include operators like this.

You guys want to attract new talent to TwinBASIC. They are going to be looking at things like this when weighing their decisions about whether to adopt TwinBASIC or not. No one is going to want to perform a bit shift in 2021 using division.

----------


## Eduardo-

> I could propose:
> 
> 
> 
> ```
> Inc a ' adds 1
> Inc a 2 ' adds 2
> ```


BTW, my proposed syntax can be done too in VB6 if we wanted, or almost:



```
Private Sub Form_Load()
    Dim a As Long
    
    Inc a
    Debug.Print a
    
    Inc a, 2
    Debug.Print a
End Sub

Private Sub Inc(ByRef Var As Variant, Optional ByVal HowMuch As Variant)
    If IsMissing(HowMuch) Then
        Var = Var + 1
    Else
        Var = Var + HowMuch
    End If
End Sub
```

----------


## Eduardo-

> You cannot argue for syntax to be simple for beginners while at the same time arguing for more low level control.


Please don't confuse things.
Simplicity (and clarity) of syntax has nothing to do with level of abstraction.

----------


## Niya

> B attracted lot of people that wasn't even programmers. When VB appeared I don't know how many passed from other non-Basic languages to VB. The newcomers were in general new to programming or people that had already a background in Basic.
> 
> One of the strengths of Basic is that it is easily understandable, even if you are not a programmer.


Let me pounce on this for a moment. I typed in Google, _why is Python so popular_. And this came up as the first link.

Pay particular attention to what the author said here:-



> First and foremost reason why Python is much popular because it is highly productive as compared to other programming languages like C++ and Java. It is much more concise and expressive language and requires less time, effort, and lines of code to perform the same operations.


And this:-



> Python is also very famous for its simple programming syntax, code readability and English-like commands that make coding in Python lot easier and efficient.


This is what BASIC used to be. This is how people would describe BASIC 20 years ago. Python has now taken it's place as the go-to "easy to learn and super productive" language and it *has* these shorthand operators. So it seems that this point about these operators being confusing to beginners and people looking for an easy language has no footing in reality. It didn't stop Python from becoming the most popular language in the world.

----------


## Eduardo-

A couple of other options to consider:



```
Private Sub Form_Load()
    Dim a As Long
    
    AddTo a
    Debug.Print a
    
    AddTo a, 2
    Debug.Print a
End Sub

Private Sub AddTo(ByRef Var As Variant, Optional ByVal HowMuch As Variant)
    If IsMissing(HowMuch) Then
        Var = Var + 1
    Else
        Var = Var + HowMuch
    End If
End Sub
```



```
Private Sub Form_Load()
    Dim a As Long
    
    Add a
    Debug.Print a
    
    Add a, 2
    Debug.Print a
End Sub

Private Sub Add(ByRef Var As Variant, Optional ByVal HowMuch As Variant)
    If IsMissing(HowMuch) Then
        Var = Var + 1
    Else
        Var = Var + HowMuch
    End If
End Sub
```

But the addition of any new keyword will break backward compatibility  :Roll Eyes (Sarcastic):

----------


## Niya

> Please don't confuse things.
> Simplicity (and clarity) of syntax has nothing to do with level of abstraction.


My point is these things are mutually exclusive. You can have either one but you cannot have both. Low level programmers are going to want more tools like bit shift operators which would directly conflict with the wants of the proponents of extreme simplicity.

----------


## Eduardo-

> Let me pounce on this for a moment. I typed in Google, _why is Python so popular_. And this came up as the first link.
> 
> Pay particular attention to what the author said here:-
> 
> 
> And this:-
> 
> 
> This is what BASIC used to be. This is how people would describe BASIC 20 years ago. Python has now taken it's place as the go-to "easy to learn and super productive" language and it *has* these shorthand operators. So it seems that this point about these operators being confusing to beginners and people looking for an easy language has no footing in reality. It didn't stop Python from becoming the most popular language in the world.


If you are *NOT* comparing a Python with the operator with another Python that is the same but lacking the operator, or with another syntax instead, it proves *nothing*.

I think you are easily deceived by fallacious reasoning.

----------


## Niya

> If you are *NOT* comparing a Python with the operator with another Python that is the same but lacking the operator, or with another syntax instead, it proves *nothing*.
> 
> I think you are easily deceived by fallacious reasoning.


No. The entire argument around this is about making the language easier for beginners. What I am trying to point out is that when you take another language that fills the same niche that BASIC does, this niche being a language for beginners, you can clearly see that it didn't hurt that language. People still adopted it. So by that reasoning it is safe to include it in TwinBASIC. If it wasn't discouraging to beginners looking at Python then it wouldn't be for beginners adopting TwinBASIC.

----------


## Eduardo-

> My point is these things are mutually exclusive. You can have either one but you cannot have both. Low level programmers are going to want more tools like bit shift operators which would directly conflict with the wants of the proponents of extreme simplicity.


Again, you keep confusing something with something else that has nothing to do.

Let's put an example: now you can do subclassing in VB6. Intermediate level programmers, and not talking about beginners, won't understand anything if they look a code for subclassing.
Not to mention if they look code with ASM thunks from wqweto, LaVolpe or The Trick.

Offering more low level access, instead of making thinks harder to intermediate level programmers, it would make it easier.

Some subclass that don't crash the IDE, standardized, easier. 
That's an example of how more "low level" things can make the language more understandable and easier.

----------


## Eduardo-

> No. The entire argument around this is about making the language easier for beginners. What I am trying to point out is that when you take another language that fills the same niche that BASIC does, this niche being a language for beginners, you can clearly see that it didn't hurt that language. People still adopted it. So by that reasoning it is safe to include it in TwinBASIC. If it wasn't discouraging to beginners looking at Python then it wouldn't be for beginners adopting TwinBASIC.


You obviously don't have a clue of how the scientific method works.

----------


## Eduardo-

> People still adopted it.


And what was the alternative at that time?

If you make something new, you need to offer something better.

If fact, you have to try to make it the best as you can. Not that "that seems to be good enough, at lest competing with that".

----------


## Zvoni

I get the impression i was not precise enough:
im not opposed to NEW operators (like ShiftLeft and sisters)
Im opposed to operators that are just syntactic sugar, when there already is a perfectly valid way, as in a=a+1

its why i said to offer the possibility to write your own operators. That way those who want a+=1 or a++ can write it, and use it to their hearts content, since i doubt there is any notable difference in speed (compared to Niyas sample with division for shifting bits)

----------


## Niya

> BTW, my proposed syntax can be done too in VB6 if we wanted, or almost:
> 
> 
> 
> ```
> Private Sub Form_Load()
>     Dim a As Long
>     
>     Inc a
> ...


It's not the same thing. A function call carries significant overhead compared to incrementing a variable. Incrementing a variable looks like this at the native code level:-


```
Inc [ebp - 4]
```

A function call would look something like this at the call site:-


```
Push ebp - 4
Call [Inc]
```

Then this would be the actual function, assuming the standard calling convention:-


```
push ebp
mov ebp, esp

mov ebx, [ebp+8] ; Move pointer into EBX
inc [ebx] ;Increment value at the address pointed to by EBX

mov esp, ebp
pop ebp
ret 4 ;Assuming a 32 bit integer parameter
```

That's 6 whole extra instructions just to increment a value at a memory address. 

This is not to say that your idea is bad. For this to be viable performance-wise it would have to be implemented in the compiler itself as an intrinsic function. So whenever it's called the compiler simply generate an *inc* instruction instead of an entire function call.

EDIT:

Also I am assuming the simplest possible implementation of an increment function like:-


```
Public Sub Inc(ByRef b As Long)
    b = b + 1
End Sub
```

If we include all that stuff with Variants and If statements, the overhead would be significantly greater.

----------


## Eduardo-

> It's not the same thing. A function call carries significant overhead compared to incrementing a variable. Incrementing a variable looks like this at the native code level:-
> 
> 
> ```
> Inc [ebp - 4]
> ```
> 
> A function call would look something like this at the call site:-
> 
> ...


I'm quite sure that it that was implemented natively it would not take any extra instruction.
Always missing the mark... and they go like 1000 times.

----------


## Eduardo-

> This is not to say that your idea is bad. For this to be viable performance-wise it would have to be implemented in the compiler itself as an intrinsic function. So whenever it's called the compiler simply generate an inc instruction instead of an entire function call.


That was what we were talking about, didn't we?

----------


## Niya

> That was what we were talking about, didn't we?


You said this:-



> BTW, my proposed syntax can be done too in VB6 if we wanted, or almost:


Which I interpreted to mean that it wasn't needed because you could just write a function to do it. If you actually meant it should be an intrinsic, then you have my apologies for misunderstanding.

----------


## Niya

I also updated that post. I got the assembly slightly wrong because I forgot I was dealing with a ByRef parameter. It was reduced by two instructions but it's still 6 extra instructions.

----------


## Eduardo-

I will try to explain why the reasoning "since people adopted Python, and it has the + operator, then it must be good" is a fallacious argument.
Because things that can seem obvious to someone can be difficult to others.

"people adopted Python", Ok, that's a fact (or a premise).
"Python has the + operator", that's also true.

The + operator is a side feature, some small feature between many other features.
You can not know if the + operator features played a role in favor or against the adoption. You have no way to evaluate the feature separately.

You can say (and you did) that many people adopted the language, even if it had that feature. Yes, that's a fact, but you cannot know how many (if more or less) would have adopted the language if it lacked of the feature, or had some other way to do that.

You can argue that it seems that it wasn't an stopper, because people adopted the language anyway.
OK, and with what did Python compete at the time?
Did it compete with VB6? Of course not, VB6 was discontinued, and didn't work on Linux servers.

A new language need to be better to be adopted, not the same. Now you need to compete with Python (and many others).
So, the real question is, that feature helps in the adoption, or plays against it?

----------


## Eduardo-

> You said this:-
> 
> 
> Which I interpreted to mean that it wasn't needed because you could just write a function to do it. If you actually meant it should be an intrinsic, then you have my apologies for misunderstanding.


OK, sorry too, may be I was not clear.

----------


## Eduardo-

> I also updated that post. I got the assembly slightly wrong because I forgot I was dealing with a ByRef parameter. It was reduced by two instructions but it's still 6 extra instructions.


I think it is nevertheless interesting that it can be done in VB6, even if it is slower. As an alternative when you don't need speed and want to write less.
But it is a different discussion.
Not sure whether it worth to post it in the Codebank.
(I'll keep it in mind in case I have to do a lot of additions to long named variables and don't need super speed).

----------


## Niya

> You can say (and you did) that many people adopted the language, even if it had that feature. Yes, that's a fact, but you cannot know how many (if more or less) would have adopted the language if it lacked of the feature, or had some other way to do that.


This is quite correct. There really is not objective answer to this question as of now. A simple thing like a poll on StackOverflow, Reddit or Quora could probably put this question to bed easily though.




> So, the real question is, that feature helps in the adoption, or plays against it?


You're correct here too. I think it does help and apparently Wayne did as well. But you're right. It is entirely possible that those of us in support of this could be wrong. In the absence of a poll or some kind of census, we can only rely on our intuition and my intuition tells me that this is a must. It would be extremely unproductive to put every single feature to a vote. Sometimes, it's just better to go with your gut for the sake of expediency.

----------


## Niya

> Not sure whether it worth to post it in the Codebank.
> (I'll keep it in mind in case I have to do a lot of additions to long named variables and don't need super speed).


I think it's too simple to warrant a Codebank entry. I think most VB6 programmers are capable of coming up with a function like that on their own.

----------


## Eduardo-

> A simple thing like a poll on StackOverflow, Reddit or Quora could probably put this question to bed easily though.


I don't think so. It doesn't work like that.

You need the ones voting being the same (or close) to the ones making the decision.
So you'll have to go to schools, people making their first steps in programming, and present to the student different alternatives.

It is easy to be biased if you don't apply the right methodology...




> You're correct here too. I think it does help and apparently Wayne did as well. But you're right. It is entirely possible that those of us in support of this could be wrong. In the absence of a poll or some kind of census, we can only rely on our intuition and my intuition tells me that this is a must. It would be extremely unproductive to put every single feature to a vote. Sometimes, it's just better to go with your gut for the sake of expediency.


I don't think that the original VB team at MS made these kind of decisions based on intuitions. They must have studied and discussed pros and cons of each important thing a bit better and more seriously.
They had also feedback from some connected people around, programmers like (I think) Karl Peterson, Randy Birch and others.

----------


## Eduardo-

> I think it's too simple to warrant a Codebank entry. I think most VB6 programmers are capable of coming up with a function like that on their own.


The code is too simple, but you don't usually think about that.
The point there wouldn't be the code, but the idea.
I'm not planning to post it anyway.

----------


## Shaggy Hiker

> BTW, my proposed syntax can be done too in VB6 if we wanted, or almost:
> 
> 
> 
> ```
> Private Sub Form_Load()
>     Dim a As Long
>     
>     Inc a
> ...


Woof. Don't be doing THAT. 

A = A + 1 

Is a single integer addition, one of the simplest and fastest things that CPUs can do. You created an alternative that has a conditional in addition to the addition. You'd be much better off just doing the math than adding in a conditional.

----------


## Eduardo-

> Woof. Don't be doing THAT. 
> 
> A = A + 1 
> 
> Is a single integer addition, one of the simplest and fastest things that CPUs can do. You created an alternative that has a conditional in addition to the addition. You'd be much better off just doing the math than adding in a conditional.


I think I was clear that the purpose was not speed but handiness with long named variables.
Not every code needs to run at the speed of light.

----------


## Shaggy Hiker

> You need the ones voting being the same (or close) to the ones making the decision.
> So you'll have to go to schools, people making their first steps in programming, and present to the student different alternatives.


That's a good idea. I'd like to see more objective comparison attempts of that nature. I've read a couple papers that tried to do something like that around unit testing. Even in the papers, they noted that their methodology left a lot to be desired, but for the test you are proposing, it would really work. When they were comparing Test Driven Development methodology vs other, they had a seriously hard time (or totally failed) to come up with two equivalent groups of students. When it comes to saying "which is easier?" you can readily find totally equivalent groups of students, since you really want to be asking beginners.

----------


## Shaggy Hiker

> I think I was clear that the purpose was not speed but handiness with long named variables.
> Not every code needs to run at the speed of light.


Yeah, I should have read the other responses. However, I've never understood the point about long variables names. If you are working in an environment without intellisense, then it would make sense....but none of us are, so it seems unlikely that ANY of us care about long variable names. You type a couple characters and hit tab.

----------


## VB6 Programming

As Wayne Phillips pointed out earlier, twinBASIC v0.13.36 now allows import from VB6 projects.

Only supported documents are imported (i.e. modules and classes, not forms etc). Once VB6 forms are supported in tB (expected in early February), they will also be imported.
A log of the import process is displayed.

The new import option is in the tB activity panel.

----------


## Eduardo-

> That's a good idea. I'd like to see more objective comparison attempts of that nature. I've read a couple papers that tried to do something like that around unit testing. Even in the papers, they noted that their methodology left a lot to be desired, but for the test you are proposing, it would really work. When they were comparing Test Driven Development methodology vs other, they had a seriously hard time (or totally failed) to come up with two equivalent groups of students. When it comes to saying "which is easier?" you can readily find totally equivalent groups of students, since you really want to be asking beginners.


Yeap, but not easy for small companies or individuals.

----------


## Eduardo-

I found that this code works in VB6:



```
Private Sub Form_Load()
    Dim a As Long
    
    · a
    Debug.Print a
    
    · a, 2
    Debug.Print a
End Sub

Private Sub ·(ByRef Var As Variant, Optional ByVal HowMuch As Variant)
    If IsMissing(HowMuch) Then
        Var = Var + 1
    Else
        Var = Var + HowMuch
    End If
End Sub
```

I was thinking, for the new syntax, what about**:



```
+ a   ' adds 1
+ a 2 ' adds 2
' or
+ a, 2
```

What do you think?
I think that's much better than:



```
a += 1
```

----------


## Eduardo-

> Yeah, I should have read the other responses. However, I've never understood the point about long variables names. If you are working in an environment without intellisense, then it would make sense....but none of us are, so it seems unlikely that ANY of us care about long variable names.


Long variable names is for being explicit and descriptive what they are (or have). In procedures that have many variables it makes the code clearer and easier to understand when you come back later, or for someone else.




> You type a couple characters and hit tab.


In VB6 it is Control+Space.
Anyway you can also copy/paste too.

But your current point contradicts the other point that "VB lacks a short way to increment variables". May be you are not one of the proponents of a new syntax (I don't remember).

----------


## mansellan

> I was thinking, for the new syntax, what about**:
> 
> 
> 
> ```
> + a   ' adds 1
> + a 2 ' adds 2
> ' or
> + a, 2
> ...


I find that syntax really unpleasant (it would probably also be a nightmare to parse in all the settings expressions can exist). Why reinvent the wheel? += (and all its many kin) are ubiquitous, not only in C-like languages, but also FreeBASIC, VB.Net, Java, JavaScript, Python, PHP, Ruby... In fact it would probably be quicker to list the languages that _don't_ implement it!

A developer coming from any of these languages would lament their absence, so why inflict it? These are already implemented in twinBASIC.

----------


## Niya

> So you'll have to go to schools, people making their first steps in programming, and present to the student different alternatives.
> 
> It is easy to be biased if you don't apply the right methodology...


You actually gave me an idea. I don't have to resources to conduct such a census in schools but in 2021 I think it's pretty easy for the average person to conduct something similar online. I'm flirting with the idea of posing this question to a community of *non-programmers* to see what they say.




> I don't think that the original VB team at MS made these kind of decisions based on intuitions. They must have studied and discussed pros and cons of each important thing a bit better and more seriously.
> They had also feedback from some connected people around, programmers like (I think) Karl Peterson, Randy Birch and others.


They decided to not include them in QuickBasic and maintained that all the way up to VB6. Yet they decided to include them in VB.Net. How would you explain this change of policy? Be mindful, that if we are assuming they did put it to vote/discussion when creating VB6, you also have to assume the same for VB.Net.

----------


## Eduardo-

> I find that syntax really unpleasant (it would probably also be a nightmare to parse in all the settings expressions can exist). Why reinvent the wheel? += (and all its many kin) are ubiquitous, not only in C-like languages, but also FreeBASIC, VB.Net, Java, JavaScript, Python, PHP, Ruby... In fact it would probably be quicker to list the languages that _don't_ implement it!
> 
> A developer coming from any of these languages would lament their absence, so why inflict it? These are already implemented in twinBASIC.


Ahh, because many are using it then it is good?

----------


## mansellan

> Ahh, because many are using it then it is good?


Didn't say that. I just said that it's ubiquitous. And thus will likely be expected by a traveler from another language. That's a benefit.

What's the cost? You just don't like the way it looks?

----------


## Eduardo-

> You actually gave me an idea. I don't have to resources to conduct such a census in schools but in 2021 I think it's pretty easy for the average person to conduct something similar online. I'm flirting with the idea of posing this question to a community of *non-programmers* to see what they say.


OK, but please do not design the questions in a way to induce the answer that you want.




> They decided to not include them in QuickBasic and maintained that all the way up to VB6. Yet they decided to include them in VB.Net. How would you explain this change of policy? Be mindful, that if we are assuming they did put it to vote/discussion when creating VB6, you also have to assume the same for VB.Net.


The .Net team has nothing to do with the original VB team.

And it is clear that what they wanted was exactly the opposite: to make programming something for an elite. And they got it.

----------


## mansellan

If it's because it's not human-readable, well... no programming language is entirely intuitive. For modify-and-assign, understanding would take a quick Google search, hitting results from pretty much any language...

https://www.google.com/search?q=what...us+equals+mean

----------


## Eduardo-

> Didn't say that. I just said that it's ubiquitous. And thus will likely be expected by a traveler from another language. That's a benefit.
> 
> What's the cost? You just don't like the way it looks?


In previous posts I expressed that most of the potential newcomers won't probably come from other languages, but from people new to programming.

If else, then let's go everybody to C# or Python, they must have what we want since these are the languages that people are now using.

----------


## Eduardo-

> If it's because it's not human-readable, well... no programming language is entirely intuitive. For modify-and-assign, understanding would take a quick Google search, hitting results from pretty much any language...
> 
> https://www.google.com/search?q=what...us+equals+mean


This is one of the main strengths of Basic, undermining that, is undermining the advantages that it has over other languages.
Yes, it is not totally human readable, but that's mainly for shortness,  a = Int(a) is shorter that a = ConvertToInteger(a), but still kind of human friendly.

----------


## mansellan

> In previous posts I expressed that most of the potential newcomers won't probably come from other languages, but from people new to programming.


That's a very bold assertion. Why would somebody with zero programming experience choose a language that's currently pretty obscure, and likely to remain so for quite a while?

If I were to guess, I'd say that most early-adopters are from one or more of VBA, VB6 or COM. Maybe even some FreeBASIC or VB.Net too. I'd wager that newcomers in 2021 are probably not even very aware of BASIC, let alone tB.

----------


## Niya

> And it is clear that what they wanted was exactly the opposite: to make programming something for an elite. And they got it.


Or maybe they just wanted to upgrade the language. What is it that Olaf likes to say? Occam's razor?

----------


## Eduardo-

> That's a very bold assertion. Why would somebody with zero programming experience choose a language that's currently pretty obscure, and likely to remain so for quite a while?


Because it is easier to learn.
What do you mean by "obscure"?

Unknown, difficult?




> If I were to guess, I'd say that most early-adopters are from one or more of VBA, VB6 or COM.


VBA and VB6 don't have this awkward syntax. 




> Maybe even some FreeBASIC or VB.Net too. I'd wager that newcomers in 2021 are probably not even very aware of BASIC, let alone tB.


I'm thinking much more ahead. My expectation is that Basics will be ubiquitous in the future.
The main problem is that Browsers only interpret JavaScript, but I think that could not be a problem anymore if Web Assembly becomes a standard.

----------


## Eduardo-

> Or maybe they just wanted to upgrade the language.


Seeing the results, I don't think so.




> What is it that Olaf likes to say? Occam's razor?


I know what Occam's razor is but not sure what you are saying.

----------


## mansellan

Actually, this is kind of an issue with C# - it evolves. Constantly. If I were to look at a non-trivial C# 1 application, it would look almost unreadable to me.

The downside is that C# now has a plethora of different syntax options. The (huge) upside is that each version makes it possible to write more concise, more expressive code. Boilerplate gets removed, and the signal-to-noise ratio gets ever better.

I just upgraded a non-trivial app from C#9 to C#10. This release was considered pretty passe in what it added, but it still allowed me to remove thousands of lines of code that became unnecessary (mostly "using" statements). That's a net win for me and anyone else who has to work with the code in future.

And no, I don't propose twinBASIC should go to that extreme. But some modern conveniences are in order.

----------


## Niya

> That's a very bold assertion. Why would somebody with zero programming experience choose a language that's currently pretty obscure, and likely to remain so for quite a while?


This is a very good point. Just type in any programming concept while leaving out any mention of a language into Google. Nearly every single time Python will come up. 

Try this:-
https://www.google.com/search?q=augm...hrome&ie=UTF-8

This is what shows up for me:-


People looking to get into programming would likely run into Python first.

----------


## mansellan

Sorry Eduardo, I'm just not seeing it. When you come to a new language, either as a newcomer or from another language, there are some things to learn. The process for add-and-assign would be:

1. Huh, I haven't seen that before
2. Google
3. Oh Ok, it's just x = x + 1

Total time spent, maybe a minute? What's the problem?

----------


## Niya

> I know what Occam's razor is but not sure what you are saying.


Occam's razor....the simplest answer is likely to be the right answer. We have two answers, only one of which could be correct.

1) They did it because of some massive internal conspiracy to turn BASIC into an elitist language.

2) They did it to improve the language.

Which of these two is the simpler answer.

----------


## Eduardo-

> People looking to get into programming would likely run into Python first.


Yes, and Python didn't exist some years ago, or was obscure.

Of course being so short-sighted can't be changed the world.

Basic has the advantage that you already start with a... not large today, but still kind of big programmers base.

----------


## mansellan

Eduardo, if you want the modify-and-assign syntax that has been implemented in twinBASIC to be removed (replaced?), then you are most welcome to propose that on the GH repo. It would get labelled as a discussion, and the (nascent) community will consider it.

I don't think it would get much support though.

----------


## Niya

> I'm thinking much more ahead. My expectation is that Basics will be ubiquitous in the future.


Again, Python is the most likely to succeed in this future. Do you know what random video showed up in my YouTube feed yesterday. Just out of nowhere....It was a video with a guy showing how to use Python in Excel in place of VBA. He also discussed a possible future where Python could replace VBA and he made a very convincing argument for this possible future by showing how much simpler it is to do certain tasks in Python over VBA.

My ultimate point is this. BASIC had it's time. Microsoft gave up on it to focus on C# and this allowed Python to fill it's niche. It's already lost the war. I'm sorry, but no matter how much we all like BASIC, it will not be ubiquitous in the future. I wish it were. There are some things about Python I really do not like but it seems I'm in a minority. The world wants it and there's nothing we can do about that.

----------


## Eduardo-

> Sorry Eduardo, I'm just not seeing it. When you come to a new language, either as a newcomer or from another language, there are some things to learn. The process for add-and-assign would be:
> 
> 1. Huh, I haven't seen that before
> 2. Google
> 3. Oh Ok, it's just x = x + 1
> 
> Total time spent, maybe a minute? What's the problem?


You usually have to choose between options.
I once had to choose between Delphi and VB.
I liked VB more, I chose it.
What makes you like one over another? You probably don't know what are each individual thing that you like and you don't like, but being easy to read I'm quite sure is one of them.

Yes, when you get used to something, after a time, it becomes "good". 
I'm quite sure, for example, that my aversion to curly braces would go away if I work for several months in a language with curly braces.

Could I work with a language with +=?, yeah, sure, I could also get used to a language with :=\|~.

Anyone could also google that syntax 8if used) and get it in a couple of minutes from google.

But myself I'm not aspiring to be a freak or nerd that understand (unnecessary) difficult things, I want the computer to help me do the things as easy as possible, and so a programming language. I want it to be friendly to me, easily readable.
I would had gone to Assembler otherwise, it was also available (and I already knew a bit of it).

And I don't think I'm alone.
Many, many people that raided into programming with VB in the 90 and 2000 has left when VB was abandoned and "replaced" with the unfriendly newborn. Or they are in Access, Office now.

----------


## mansellan

That's fair enough.

As someone who has to learn big paradigm shifts every 12 months with C# (and huge reams of "magic" being undertaken by the compiler - it literally rewrites your code when you use async), trust me when I say that += won't take long to get comfortable with. It'll look entirely normal after a couple of weeks.

EDIT: Oh, and I don't think anyone's had the temerity to suggest curly braces yet!

----------


## Eduardo-

> Occam's razor....the simplest answer is likely to be the right answer. We have two answers, only one of which could be correct.
> 
> 1) They did it because of some massive internal conspiracy to turn BASIC into an elitist language.
> 
> 2) They did it to improve the language.
> 
> Which of these two is the simpler answer.


Occam's razor is not about the simpler answer but the simpler explanation.
And the simpler explanation, seeing the results and how they opposed to any and every request from the VB community, is that they were not interested in programmers.

----------


## Eduardo-

> Eduardo, if you want the modify-and-assign syntax that has been implemented in twinBASIC to be removed (replaced?), then you are most welcome to propose that on the GH repo. It would get labelled as a discussion, and the (nascent) community will consider it.
> 
> I don't think it would get much support though.


I don't think either. Because most seems to vote what Wayne already said he likes.
And there are how many there, 10?
And I guess that everybody are thinking on themselves (I'm not saying that's a wrong thing), not in a future mass adoption of Basic.
So, what for?

----------


## Shaggy Hiker

> Yeap, but not easy for small companies or individuals.


It would be a pretty good master's project, though. Small, compact, and with interesting and useful results.

----------


## baka

one thing that I dont get. if basic is crap, as Niya is trying to say, why are you here at all?
twin"basic" is about basic, and Im sure the whole idea of twinbasic was to make VB6 a bit more robust for todays needs.
if u think Python is superior. why not just go and let us primitive people be here and believe in "basic".

now we know exactly why u are here, just to mess with us. that kind of people we dont need, go to your Python forum and stay there.

ironically u wrote that people in other forums have called u all kind of things, heavy stuff, and I wonder maybe you made them that angry with your attitude and it seems like you are seeking that here as well.

here we talk about Basic, and that we love Basic, and that we want to "Improve" Basic, not change it to something else, not to add other language and forget about Basic. because TwinBasic IS Basic. get it.

----------


## mansellan

> I don't think either. Because most seems to vote what Wayne already said he likes.


That's really unfair. The debates I've seen have been pretty free ranging and ego free. If you have a killer point to make, it'll get traction. But at the end of the day "I like what I'm used to" is not going to get popular support. The heritage has to be respected, but that can't mean that nothing new can ever be implemented.

----------


## Shaggy Hiker

> But your current point contradicts the other point that "VB lacks a short way to increment variables". May be you are not one of the proponents of a new syntax (I don't remember).


No, I was a proponent, I just thought the 'long names' argument was without much merit.

I agree with whoever felt that the ++ operator was opaque, but I've always liked +=, especially when you can concatenate with &=.

----------


## Eduardo-

> Again, Python is the most likely to succeed in this future. Do you know what random video showed up in my YouTube feed yesterday. Just out of nowhere....It was a video with a guy showing how to use Python in Excel in place of VBA. He also discussed a possible future where Python could replace VBA and he made a very convincing argument for this possible future by showing how much simpler it is to do certain tasks in Python over VBA.
> 
> My ultimate point is this. BASIC had it's time. Microsoft gave up on it to focus on C# and this allowed Python to fill it's niche. It's already lost the war. I'm sorry, but no matter how much we all like BASIC, it will not be ubiquitous in the future. I wish it were. There are some things about Python I really do not like but it seems I'm in a minority. The world wants it and there's nothing we can do about that.


Sorry, I try to see "beyond my eyes". I believe in things that still didn't happen.
I don't care what Google or Tiobe are saying now.
But I don't expect you to understand it.

----------


## mansellan

Just to reiterate:

FreeBASIC and VB.Net have both done this. Hell, classic VB would have if it had survived. There really isn't an argument that it's not BASIC-ish that I can see.

----------


## Shaggy Hiker

@Niya: I tried your search and came up with a wiki page on Augmented Assignment as the top item. After that it was all Python. I'd say that your search is flawed, though. I believe the term is primarily a Python term. I've certainly never encountered it before.

----------


## Niya

> if u think Python is superior. why not just go and let us primitive people be here and believe in "basic".


Actually I prefer BASIC over Python. There are some things about Python that I do not like. I absolutely hate dynamic typing along with the idea of using a variable without declaring it. I'm being forced to learn it right now and there really is no way out for me and the reason for this is because it's penetration is so deep now. It is everywhere.

However, preferences aside. Python isn't really that bad of a language and my personal tastes aside, I think it would be prudent to grab a couple ideas here and there for TwinBASIC. It really can't hurt.

----------


## Eduardo-

> That's really unfair. The debates I've seen have been pretty free ranging and ego free. If you have a killer point to make, it'll get traction. But at the end of the day "I like what I'm used to" is not going to get popular support. The heritage has to be respected, but that can't mean that nothing new can ever be implemented.


I already talked about the point in previous posts, I think the debates should be more abroad, and the alternatives analyzed better, what are the implications, what pros and cons have each one, not choosing in a rush or for wrong reasons.
There should be some professional way to take that kind of decisions, I mean, to design a programming language.

But I'm a bit tired. I was tired already many posts ago.
Do whatever you want (you'll do it anyway).

----------


## Niya

> now we know exactly why u are here, just to mess with us. that kind of people we dont need, go to your Python forum and stay there.


You think I'm messing with you because I'm arguing for the inclusion of  +=  family of operators?

You don't think it should have been included in TwinBASIC but I do. We have a difference of opinion. To classify a difference of opinion as me messing with you seems a bit conceited. I have zero interest in riling you up.




> ironically u wrote that people in other forums have called u all kind of things, heavy stuff, and I wonder maybe you made them that angry with your attitude and it seems like you are seeking that here as well.


The truth is I'm not a yes man. Never have been and this rubs people the wrong way. They just expect me to blindly follow whatever everyone else is saying like I'm some kind of zombie. That is never going to happen. My opinions are just as valid as yours. If you can't deal with that, that is not my problem. You aren't going to bully me into submission either with "heavy stuff" as you say. SDA tried it, uncleber tried it, yet I'm still here. But you can certainly try if you want.

One final point about me "messing" with people. I don't mess with people by trying to present reasoned arguments about my points complete with code snippets and citations. If my goal was to mess with you, I'd flood your inbox with beastiality porn from 20 different accounts. And yes, I have done this to people.

I say the things I say because I actually believe them. It is not to tease people into a frenzy. I will not hold myself responsible if you choose to react poorly to it.

----------


## mansellan

I really would never have imagined that supporting a universally-known operator could be so controversial until I found VBF...

----------


## baka

its how u present your arguments.
if you say:

basic is dead, sorry but nobody is using it, "any other language" is superior basic.

and the next

I like basic, "any other language" is actually not that good

and next

I would like to put this and that into basic

so its all over the place.

I propagate for a clean, stable and strong basic.
how? to always think "what makes VB6 good?" and "what makes VB6 bad?"
and try to keep the good and improve the bad.

the "bad", how to convert it to be "good", so if we want to add a feature, first we need to think:
- the good of VB6, if we include all of it, how would it look.

if we instead use: but python do it like this, or C is doing this way. that means we are just "coping" another language instead of creating one from the existing language we have.

if basic was so bad, why are we still using it?
and its not just that VB6 is bad, but that it was abandoned by many.
just see the pro in this forum that gave us: directx, wia, gdi+, cairo to name a few,
that means VB6 is able, but someone need to give us the tools.
if VB6 was bad it shouldn't be possible. but it is, 20 years after they abandoned it.
that tells us something.

I don't care about +=, but everything else that will be added "without " the thought, "how to make it basic-like" instead of just "copy". because if you just want to copy other languages, why not just go to that language.

----------


## Niya

> I really would never have imagined that supporting a universally-known operator could be so controversial until I found VBF...


It has little to do with the operator. It's the fact that I'm the one supporting it. I'm just a convenient target because I personify what VB6 programmers hate most which is the abandonment of VB6 by Microsoft and the rest of the world. I'm used to it though. It's not the first time I've found myself becoming a villain although it was never my intention. It is what it is.

----------


## Niya

> basic is dead, sorry but nobody is using it, "any other language" is superior basic.
> 
> and the next
> 
> I like basic, "any other language" is actually not that good


I get why you'd be confused. Let's see if I can clear it up. I like BASIC because it's my most used language. I've been writing BASIC code in on form or another since I was something like 10 years old. I'm comfortable with it. I'm familiar with it. This however does not mean I think there aren't better languages. Do you know how many times I've advised people in the VB.Net section to pick up C# instead? I love VB.Net but I think C# is better. I myself still use VB.Net, not because it's better but because I love it.

Let me put it this way:-


```
MeLovinBASIC <> BASICIsBetter
```

Now with regards to TwinBASIC, we are talking about attracting new talent. Our love for the language has no weight whatsoever in this. You want to attract modern programmers, then you must make it attractive. You can do this by looking at what the most popular languages are doing and assimilate ideas from there. You don't do it by trying to re-invent the wheel. You do it by following trends. As far as shorthand operators go, the trend is for modern languages to include them.

Does this clear things up for you about my stance?

----------


## Shaggy Hiker

> It has little to do with the operator. It's the fact that I'm the one supporting it. I'm just a convenient target because I personify what VB6 programmers hate most which is the abandonment of VB6 by Microsoft and the rest of the world. I'm used to it though. It's not the first time I've found myself becoming a villain although it was never my intention. It is what it is.


No, it's because you're sitting there stroking that hairless cat and twirling your moustache.

----------


## Niya

> @Niya: I tried your search and came up with a wiki page on Augmented Assignment as the top item. After that it was all Python. I'd say that your search is flawed, though. I believe the term is primarily a Python term. I've certainly never encountered it before.


No it's not a Python term. The official name for operators like += is augmented assignment operator. It's language agnostic.

----------


## Niya

> No, it's because you're sitting there stroking that hairless cat and twirling your moustache.


Lmao.... :Wink:

----------


## mansellan

> its how u present your arguments...


I'm new here. There's clearly some history to these interactions, so I'll just call it as I see it.

Classic VB was abandoned by Microsoft. That's the only language they did that to. C# was a new invention (some would say a rip-off-with-improvements-of-java), and C++ was allowed to stay mostly native, with diversions and extensions for those that really wanted to use it to target .Net.

VB was kind of thrown to the wolves. All development on COM-native VB stopped in the early 2000s. If you wanted to keep current with VB, you had to move to VB.Net. And that was a big problem, because it ripped the heart out of the language.

VB should have gone the same route as C++ - basically COM-native, but with the CLR there if you wanted to opt-in. In fact, it could have been the perfect middle ground. A bridge between the two, COM by default but easy access to the CLR for those who wanted it.

But remember, this all happened in the early 2000s. Just when Longhorn was emerging. Way before Vista, plans were put in place to make Windows a managed code environment. They tried and failed to remove the COM underpinnings of Windows. But the die was cast.

So I say again - my fondest hope is that twinBASIC is the go-to COM language. The path that Microsoft didn't take. I get that you all hate VB.Net, because CLR. But it does have some nice language improvements, regardless of what it ends up targeting.

----------


## Niya

> No, it's because you're sitting there stroking that hairless cat and twirling your moustache.


Also, it's interesting. You guys almost saw something new today. I was actually in the middle of writing an apology to the VB6 community. I brought up my contentions here with the VB6 community on Reddit and someone pointed something out to me that I never thought of before. I was going to make a post apologizing to the VB6 members with a promise to try my very best to avoid creating conflict by bringing up VB.Net in VB6 topics even in cases where it is 10000% warranted and justified. I was in the middle of writing that post until I saw baka post this:-



> ironically u wrote that people in other forums have called u all kind of things, heavy stuff, and I wonder maybe you made them that angry with your attitude and it seems like you are seeking that here as well.


I took this to mean that he thinks I deserved to be called names and be degraded online simply because I hold views counter to popular opinion. I changed my mind after that. I'm not apologizing to anyone that thinks I deserved to be told that my mom should have swallowed me. 

I'm not angry at baka or anything like that and I don't hate him but I also don't feel good about apologizing to people who think I deserve to be treated like sub-human trash simply because of a difference of opinion.

----------


## baka

yeah, I get that part, 
but the irregularity is what makes it hard to know where you stand. it seems like you enjoy the argument and so you send an arrow when you find a target, and thats fine if you we know where you stand.
the last post showed your stand, but soon you will change tone and we are there again.

I don't think that a language need to accommodate everyone and show "we also got the latest ice-cream taste".
the importance is to show "we can do this with TwinBasic".

when I bought my first PC, it was not because PC was superior Amiga, it was because they did have a 16bit sound card that I needed. 
when I first started VB6 was not because I knew basic, I was more of a pascal guy at that time. it was because it was easy to work with the "new" windows OS, while pascal it felt too complicated in windows so I switched.

theres a lot of languages, so how can TwinBasic survive? it can't just because it shows lots of features.
the only way is a community, easy to get started, availability, sources etc, that will help the language grow
and when guys like Olaf and The trick and others start to release components that can be used to create stuff, it will spread around and eventually even companies will feel its a good idea to try it out.

that is why "fully" compatible is the good strategy here. 
why? because TwinBasic will get many experiences programmers on-board for free, and that will help the language grow.

without vbforums and the "few others before they died" I wouldn't be here.
a community is important, without it, the language will die.

if you try to make TwinBasic something that I can not recognize, I will not get on-board. theres a lot of other languages out there already, like you say, Phyton. I know a bit already, as its used in the gaming community a lot. and its evolving all the time as theres a demand for it. if I create a game using Phyton I will get "accepted" by the masses, as they recognize the engine. 
so, the question is, why should I take a chance on TwinBasic if Phyton is growing in the gaming community? I should just go there?

so, everything is not obvious. just give the language lots of features means nothing.
a inviting GUI, a stable IDE, lots of samples, easy to understand, a forum, experts that are online everyday to give support.

new players? not sure there will be that many before the VB6-programmers are on-board.
and for us to go on-board TwinBasic need to be at least as good as VB6 and familiar.

----------


## Niya

> yeah, I get that part, 
> but the irregularity is what makes it hard to know where you stand. it seems like you enjoy the argument and so you send an arrow when you find a target, and thats fine if you we know where you stand.
> the last post showed your stand, but soon you will change tone and we are there again.
> 
> I don't think that a language need to accommodate everyone and show "we also got the latest ice-cream taste".
> the importance is to show "we can do this with TwinBasic".
> 
> when I bought my first PC, it was not because PC was superior Amiga, it was because they did have a 16bit sound card that I needed. 
> when I first started VB6 was not because I knew basic, I was more of a pascal guy at that time. it was because it was easy to work with the "new" windows OS, while pascal it felt too complicated in windows so I switched.
> ...


Here's the thing baka. I don't disagree with what you're saying here. 100% VB6 compatibility should be the core mission and I have no problem with that. All I'm saying is that it cannot hurt to look around to see what languages like Python are doing and ape some of their stuff. And I happen to think that operators like += should be included. I am not advocating for everything to be adopted, for example, it doesn't need ++, -- or any of that. But the truth is, there are a lot of good features that other language have that TwinBASIC could benefit from without sacrificing the core mission of 100% VB6 compatibility. And this will also aid in attracting new talent from other programming languages who would expect some of these things. That is all I'm saying.

----------


## mansellan

@baka

That's my hope too. VB6, but better.

1. 64-bit compilation
2. Faster execution
3. Cross platform
4. Language improvements

It seems that the only one of these that's causing concern is #4. Bear in mind that the developer is extremely keen to get feedback on the GH repo, and that nothing is set in stone for the language canon until it reaches v1, which seems some way off (the GUI is still in the distance). I've heard talk of RFCs and governance, but bear in mind that this is a very small community right now - it can't really accommodate heavy governance. If you want to help guide the direction, I urge you to get involved in the GH discussions. Maybe later there can be an independent governance committee and standards approval, but for now this is a startup.

----------


## baka

exactly, whats the point on creating twinbasic if theres no new feature.
we need all those low-level operations, but carefully thought to be as close possible the basic-language syntax.
and Im sure Wayne is doing his best to do that.

and I agree that "what are other languages doing that are great that could be useful in twinbasic",
but again, converted into basic-syntax, and carefully thought.

I see it like this:
keep VB6 spirit, everything new need to be evaluated, and if adapted, it need to be converted into basic-syntax.

what I don't like:
I like this C feature, add it now!

its like a english language.
if we start using Italian, Russian, German mixed together, it will be hard to understand:

Trapoco need gehe zu спать.

----------


## jpbro

I just want to say one more thing about the "+=" debate, especially in regard to newcomers. This operator is not much different than saying 1 + 1 or 1 + 2. What is "+"? Shouldn't a true Basic force us to write X = 1 Plus 1? Perhaps we should make it even more natural English and enforce a syntax like "X Equals One Plus One".  Of course not, because we learned as children what symbols like +, =, 1, 2, 3, etc.. mean. I have X school age children who might eventually be part of a new generation of programmers coming to a new generation of Basic. They are taught some programming at school and they have no problem understanding the += operator. AFAIAC it's done, the programming world has decided that it's a useful operator and whether you like it or not, you're wrong if you're on the other side of this one. It's like getting mad about the letter W. You've already lost, so pick a fight you can still win.

----------


## Niya

> I see it like this:
> keep VB6 spirit, everything new need to be evaluated, and if adapted, it need to be converted into basic-syntax.


So I take it that like Eduardo, you'd prefer an intrinsic function like this:-


```
Inc(a, 2)
```

Instead of this:-


```
a += 2
```

Is this what you mean?

EDIT:

Or you could make it a binary operator like this:-


```
a Inc 2
```

This is more BASIC-like too.

----------


## mansellan

> what I don't like:
> I like this C feature, add it now!
> .


I absolutely get that. I've been in the C# world for nearly 2 decades now, but I got my start in VBA, and then VB6.

I understand the BASIC ethos. The B stands for beginner after all - "Make it easy for humans to follow". I wouldn't want to propose anything that prevented that. But generics, overloads, and delegates do exist these days, and to pretend they don't does learners a disservice.

----------


## Niya

> But generics, overloads, and delegates do exist these days, and to pretend they don't does learners a disservice.


You have no idea what a huge deal this is. VB.Net introduced me to so many new concepts I had never imagined I'd ever be able to grasp or find useful.

A big example for me is templates in C++. For years I'd have so much trouble understanding them. Like what is their point, why are they so popular, how can I use them, why didn't they just do it the old fashion way. They used to drive me crazy because they were so alien and confusing to me. When I moved to VB.Net which introduced me to generics, I was finally able to grasp them. This is such a fantastic point you made here.

----------


## baka

I will use

a = a + 2

but I could do

a += 2

as well, if its available.
I told u, I dont care about += its quite simple stuff, and easy enough to understand.
but u need to be careful since that kind of syntax can open up a lot of more complicated one.

anyway I will keep using a = a + 2 since its easy to understand.
for me it means

a = will became a + 2

so its not algebra a = a

a += 2 means:

a plus is equal to 2 
or 
a plus will became 2
or
a plus, (plus what?) is equal to 2

----------


## jpbro

Despite what I said in my last post, I do think feature adoption in a Basic language should be relatively slow - maybe the slowest of any language. Being on the forefront of fashionable syntax is not a good idea. That said, adopting the best time-tested ideas from other languages makes sense, especially if you want to appeal to a new generation of programmers. After all, Basic uses inventions like these.

----------


## Niya

> Despite what I said in my last post, I do think feature adoption in a Basic language should be relatively slow - maybe the slowest of any language.


I can co-sign this. Despite what everyone might think, I'm not advocating TwinBASIC be turned into C#. I just think there should be a common baseline of "must haves" for any language in 2021 and the += family of operators should be among them. Async/Await would be another as we live in a multi-core world now. Both of these can be implemented without sacrificing VB6 compatibility.

----------


## VB6 Programming

> No it's not a Python term. The official name for operators like += is augmented assignment operator. It's language agnostic.


I'm not sure I've ever come across the term 'augmented assignment operator' (until I just googled it). 
I've known them as 'compound assignment operators'.
In real life though surely everyone just calls them assignment operators.

I'd suggest just googling 'assignment operators' would give less Python-biased results.

----------


## Niya

> I'd suggest just googling 'assignment operators' would give less Python-biased results.


Yea, mostly C and JavaScript results showed up for me.

Still, I get a lot of Python results for quite a few language-agnostic queries.

----------


## mansellan

> I can co-sign this. Despite what everyone might think, I'm not advocating TwinBASIC be turned into C#. I just think there should be a common baseline of "must haves" for any language in 2021 and the += family of operators should be among them. Async/Await would be another as we live in a multi-core world now. Both of these can be implemented without sacrificing VB6 compatibility.


Careful... Async/Await is very, very tricky. It pretty much rewrites your code into Begin/End methods. If it finds it needs to do that inside a loop, it has to write an entire state machine for you to capture all the variables you might be using after the await. It's... fiendish.


It could easily divert a single developer (no matter how awesome) into a rabbit hole. Microsoft likely spent millions on it to fix all the edge cases.

----------


## Eduardo-

> I just want to say one more thing about the "+=" debate, especially in regard to newcomers. This operator is not much different than saying 1 + 1 or 1 + 2. What is "+"? Shouldn't a true Basic force us to write X = 1 Plus 1? Perhaps we should make it even more natural English and enforce a syntax like "X Equals One Plus One".  Of course not, because we learned as children what symbols like +, =, 1, 2, 3, etc.. mean. I have X school age children who might eventually be part of a new generation of programmers coming to a new generation of Basic. They are taught some programming at school and they have no problem understanding the += operator. AFAIAC it's done, the programming world has decided that it's a useful operator and whether you like it or not, you're wrong if you're on the other side of this one. It's like getting mad about the letter W. You've already lost, so pick a fight you can still win.


AFAIK, math is taught like this:

a = 1
a = b
a = 1 + 2
a = b + 1
a = a + 1

Do you really think that that changed at school?

What is "natural" is what you do outside programming and you are already familiar before learning programming.

----------


## dee-u

The feature is already there then what is the debate all about? For it to be removed from TB? You guys have debated for pages in this thread, perhaps those who dislike the feature may take it to the creator of TB instead of wasting time debating here.

----------


## mansellan

> AFAIK, math is taught like this:
> 
> a = 1
> a = b
> a = 1 + 2
> a = b + 1
> a = a + 1
> 
> Do you really think that that changed at school?
> ...


a = 1
a = b
a = 3
a = b + 1
a++

FTFY

(and indeed, static analysis tools would have fixed all of these)

----------


## mansellan

> The feature is already there then what is the debate all about? For it to be removed from TB? You guys have debated for pages in this thread, perhaps those who dislike the feature may take it to the creator of TB instead of wasting time debating here.


Yep.

----------


## Niya

> Careful... Async/Await is very, very tricky. It pretty much rewrites your code into Begin/End methods. If it finds it needs to do that inside a loop, it has to write an entire state machine for you to capture all the variables you might be using after the await. It's... fiendish.
> 
> 
> It could easily divert a single developer (no matter how awesome) into a rabbit hole. Microsoft likely spent millions on it to fix all the edge cases.


Oh I'm aware of how it works and how complicated it is internally but it has already become apart of the modern programming lexicon. However, owing to it's immense complexity, I can accept that the developers may have not have the resources to tackle it and on that grounds it would be prudent to avoid attempting to implementing it in TwinBASIC.

----------


## Shaggy Hiker

> It's like getting mad about the letter W.


A long, long, time back, the comic strip B.C. ran a strip where the one-legged character Willy realized that he hated the letter W and anything that started with the letter W (an obvious issue). So, hating the letter W is a thing. I'm curious as to whether or not you picked that letter at random, or if you knew that hating the letter W was a thing?

----------


## Eduardo-

> a++


What kind of math is that? 

Anyway, I posted something wrong because a = a + 1 is not taught at school in math class anyway, a = a + 0 might be.

----------


## mansellan

> What kind of math is that? 
> 
> Anyway, I posted something wrong because a = a + 1 is not taught at school in math class anyway, a = a + 0 might be.


Um, I think you just proved my point? The math they teach at (high) school is equations. Not assignments.

Have you seen the symbols used in higher math? I couldn't begin to understand them. You need special symbol sets just to approximate them. To submit a paper you need LaTeX. And time. Lots and lots of time.

----------


## Shaggy Hiker

> AFAIK, math is taught like this:
> 
> a = 1
> a = b
> a = 1 + 2
> a = b + 1
> a = a + 1
> 
> Do you really think that that changed at school?
> ...


Actually, that's NOT what I remember from school. In school, you are taught this:

1 + 2 = a
b + 1 = a
1 + a = a

It's only in programming that I have seen the assignment go from right to left. In school it was always left to right. That might be what confuses non-programmers, since we reverse what they are used to seeing.

----------


## mansellan

> Actually, that's NOT what I remember from school. In school, you are taught this:
> 
> 1 + 2 = a
> b + 1 = a
> 1 + a = a
> 
> It's only in programming that I have seen the assignment go from right to left. In school it was always left to right. That might be what confuses non-programmers, since we reverse what they are used to seeing.


Might be a NA thing. Never saw assignments in high school in the UK.

----------


## Niya

> Actually, that's NOT what I remember from school. In school, you are taught this:
> 
> 1 + 2 = a
> b + 1 = a
> 1 + a = a
> 
> It's only in programming that I have seen the assignment go from right to left. In school it was always left to right. That might be what confuses non-programmers, since we reverse what they are used to seeing.


Yes, this is how I was taught in school as well.

----------


## Eduardo-

> Um, I think you just proved my point? The math they teach at (high) school is equations. Not assignments.


I have to concede in part.
Now I remember that when I begun learning programming, a = a + 1 seemed a bit strange. Because a = a, not = a + 1.
Still, the notation is familiar.




> Have you seen the symbols used in higher math? I couldn't begin to understand them. You need special symbol sets just to approximate them. To submit a paper you need LaTeX. And time. Lots and lots of time.


OK, but that is something very specialized, not taught at school (where most of the new programmer will come from).

----------


## Eduardo-

Yes guys, I already said that the last line was a mistake.
I have to leave it, at least for now. I'm too tired and make mistakes.

----------


## jpbro

> A long, long, time back, the comic strip B.C. ran a strip where the one-legged character Willy realized that he hated the letter W and anything that started with the letter W (an obvious issue). So, hating the letter W is a thing. I'm curious as to whether or not you picked that letter at random, or if you knew that hating the letter W was a thing?


LOL  :Smilie:  I picked W for personal reasons I guess. I also have a pre-school aged child who is currently obsessed with the (English) alphabet. We have an almost non-stop ABC stuff going on around here. It gave me plenty of opportunity to think about how illogical it seemed that we call it double-U instead of double-V. I didn't investigate too far, but it seemed to fit the current discussion about a hatred of certain symbols.

While we're here, I have an irrational hatred of leading underscores in names (I think it means something in C or C++? Maybe even double-underscores mean something? It drive me nuts). Even naked underscores bother me (e.g. something like (a, _, b) = Something). The weird part is that I'm fine with internal underscores and use them all the time (so something like This_Is_A_Variable scans fine for me). What can I say, I'm an irrational meat computer doing his best.

----------


## jpbro

> AFAIK, math is taught like this:
> 
> a = 1
> a = b
> a = 1 + 2
> a = b + 1
> a = a + 1
> 
> Do you really think that that changed at school?
> ...


I'm ignoring the mistake, but math is absolutely taught differently at younger grades here. There is a certain amount of straight arithmetic like 1 + 1 = 2, there is also a lot of focus on different approaches to finding answers to questions like 532 + 129 = ?. When I was a kid you would do right-left math, but now they do left to right math. So, start with an estimate (500+100+ a bit left over = around 650?). Then do the actual math: 500+100 = 600, 30+ 20 = 50, 2+9= 11. 600+50= 650. 650+11 = 661. Pretty simple, and I find it works quite well across a wide range of large-ish numbers. The way I was taught I'd be carrying numbers and having to maintain a much larger mental state along the way working out a precise answer the whole way through. Interestingly, I started using the left-right approach myself after many years of programming financial(ish) software. It was faster to scan and do quick addition that way compared to the way I was taught.

But they also teach programming now. So things like variable assignments come more naturally at a younger age. All of us here can figure out the answer to this puzzle easily, but not everyone in the general population can. 



```
X = 1
Y = 2
X = X + Y

Does X equal:

A) 1
B) 2
C) 3
```

It's not the symbols that are difficult, it's the idea of a symbol holding a value, and the symbol's value being modifiable by other symbol's values that is difficult. It's second nature to us a programmers, but it's a major mental leap for any newcomer. IMO, it's a much larger mental leap than the meaning of += versus + variable.

----------


## Eduardo-

It was just an example.
Operations with letters are not taught in the first grades.
I think all around the world math must be taught more or less the same way, at least in Occident.
There are trends that change over the years, but I think they change everywhere. And more now, that everything is globalized.

----------


## baka

why are you trying to compare algebra with how basic is assigning values, strings and objects?
we could have an entire discussion alone about that, tell me any language that is strictly following school methodology.

VB is using A = something, as already explained before, " Let A be B ". and its part of VB6 syntax.
its like you are trying to tell that "yes, we found something to complain about and we will use it". 
and your premise is that because VB6 is faulty, it means everything we add is ok. so lets add:

+= , -= , *= , /= , %= , <<= , >>= , &= , ^= , |= , ?: , || , && , == != , < <= > >= , () [] -> . ++ - - etc.

why not, its something you learn in school already.

----------


## Zvoni

The Problem people have with "a = a + 1" in Basic, is that Basic has overloaded the "="-operator:
Assignment AND equality/comparison
Look at other languages
a) Pascal: "=" equal - ":=" assign
b) C/C++: "==" equal - "=" assign
.
.
.
.

I'm not advocating to change it! It's the way Basic is.

I'm still staying with my initial proposal: Offer people to write their own operators

----------


## baka

Zvoni yeah I think you are on the right track.
maybe even a IDE setting. 
we can pick an option where we can change between VB and C Operation modes.
that way people can choose.

the overloaded "=" operator is what I like with VB6. I don't want := or ==, if I liked that I would use that language instead.

----------


## Zvoni

Baka, no need for an IDE setting or whatever.
Since Wayne has already implemented those C-ish operators it's a fait accompli.
No use to cry over spilt milk.

TwinBasic offers NEW (intrinsic) operators we didn't have in vb6? Great! (ShiftLeft etc.)
Did we need those C-ish intrinsic operators, when there is a perfectly valid way of doing things in a "Basic" way? Not really!
BUT, offer to write your own operators, and people can define their C-ish operators to their hearts contents

----------


## VB6 Programming

> The feature is already there then what is the debate all about? For it to be removed from TB? You guys have debated for pages in this thread, perhaps those who dislike the feature may take it to the creator of TB instead of wasting time debating here.


+1

_or do I mean_ +=1

----------


## Eduardo-

> the overloaded "=" operator is what I like with VB6. I don't want := or ==, if I liked that I would use that language instead.


Exactly.




> Offer people to write their own operators


That would be a Babel tower. Everyone with his own syntax.

----------


## wqweto

> The feature is already there then what is the debate all about? For it to be removed from TB?


Now that would be hilarious and explains why cries to "keep it more BASIC-ish" are so funny in this thread.

In most C/C++ compilers there is built-in ASM support which 99.99% of C/C++ programmers never use but I've never heard anyone complaining about it being available like some VB6 developers would like to keep the vNext language simple (and stupid).

cheers,
</wqw>

----------


## yereverluvinuncleber

Rather than all this bickering, why not create a forum poll on a specific language variation that you would like to have, a poll on each that we can bothered to raise. Then we can simply vote on it.

The results could be maintained and could form a sort of blueprint-for-the-BASIC-that-has-yet-to-come.

It wouldn't be binding of course but it might act as a guide to the desires of those who are interested, if nothing more.

----------


## yereverluvinuncleber

Personally, I find that having two or more languages under one's belt and being relatively familiar in both gives you a perspective that change is not always wrong and that compatibility in itself is useful. I often find myself creating polyfills to create missing or obsolete VB6 functions when programming in VB.NET and sometimes even when using .js - and vice versa. 

Curly brackets, semi colons, BEGIN and END statements, ==, += from C, .js or Delphi all make some sort of sense when you have to program in them for a while and become familiar - and not so alien. Sometimes BASIC is more understandable in its brevity, certainly when compared to Delphi. Most often though, it is more verbose but as a result quite understandable, certainly when compared to C. 

BASIC is a good place to start but is important to remember to maintain the ethos of being a beginner language capable of more or less anything with a fair wind. If we just follow that mantra but also allow flexibility. we are still in a good place.

----------


## Zvoni

> Exactly.
> 
> 
> 
> That would be a Babel tower. Everyone with his own syntax.



Your point?
If someone with such "own" syntax asks for support, he can get it in the "official basic" way.

Would be the same as: "Why is my Function not working?" showing only the call to it, but not the code of it.

And now i'm out of this discussion.
It's there, live with it.

----------


## Eduardo-

> And now i'm out of this discussion.
> It's there, live with it.


LOL! I didn't agree to one thing, showing the reason, that is something obvious, and you get offended?

Of course if someone inherits a projects from someone else, in a new job or wherever, and comes to a forum with an unknown custom syntax that the previous programmer invented, this poor new programmer won't get any help.

I don't mean you particularly Zvoni, but reading other posts from other people it seems that some people think that discussing something is bad, it is fighting, that one have to win and others to lose.

What wrong minded... how can you improve something if you don't evaluate each option, brainstorming, having people that think in one way and others in another?

----------


## Zvoni

> LOL! I didn't agree to one thing, showing the reason, that is something obvious, and you get offended?
> 
> Of course if someone inherits a projects from someone else, in a new job or wherever, and comes to a forum with an unknown custom syntax that the previous programmer invented, this poor new programmer won't get any help.
> 
> I don't mean you particularly Zvoni, but reading other posts from other people it seems that some people think that discussing something is bad, it is fighting, that one have to win and others to lose.
> 
> What wrong minded... how can you improve something if you don't evaluate each option, brainstorming, having people that think in one way and others in another?


Ah, Ed.
has nothing to do with you.
I respect opinions of others (even if i don't agree with them), and i'm definitely not offended, if someone disagrees with me, as long as he/she can provide plausible reasons from their point of view (which you did).

And:
Discussion <> Fight

----------


## Eduardo-

> Ah, Ed.
> has nothing to do with you.
> I respect opinions of others (even if i don't agree with them), and i'm definitely not offended, if someone disagrees with me, as long as he/she can provide plausible reasons from their point of view (which you did).
> 
> And:
> Discussion <> Fight


 :Thumb:

----------


## jpbro

> Discussion <> Fight


Maybe we should be able to write Discussion != Fight in Basic. I'm kidding, I'm kidding!

----------


## PlausiblyDamp

> Zvoni yeah I think you are on the right track.
> maybe even a IDE setting. 
> we can pick an option where we can change between VB and C Operation modes.
> that way people can choose.
> 
> the overloaded "=" operator is what I like with VB6. I don't want := or ==, if I liked that I would use that language instead.


The biggest problem with an IDE setting is what happens if you open a project from someone who has their IDE set up differently to yours? Would the code still compile if your IDE was set to not use the += syntax and their code was written that way? If that would be a compile failure then you have instantly caused fragmentation amongst the users, if it would compile then why bother with an IDE setting anyway? Just a thought, probably something Wayne would be best to answer is if tB supports .editorconfig files as a way of managing this kind of thing.

----------


## PlausiblyDamp

> As i said: Implement writing your own operators, and all that stuff would be a non-argument, because everyone could then write his own shortcuts like he/she likes them
> 
> 
> ```
> Public Operator +=(ByVal ALong As Long, Optional ByVal AStep As long = 1) As Long
>    Return ALong + AStep
> End Operator
> ```


The problem you get with that is somebody could then make the += operator do something non-obvious. That could result in the following two examples doing two completely different things...


```
Dim i as Integer = 10
i = i + 5
```

and


```
Dim i as Integer = 10
i += 5
```

The only way you would be able to tell while reading the code is to look at the source of an operator and see exactly what it does. I have seen code like that in C++ (many, many years ago thankfully) that resulted in a very hard to track down bug, lots of swearing, and an utter inability to understand why the original dev chose to do things that way. 

Making += a shorter version for an addition and an assignment is a much safer option.

----------


## baka

> The biggest problem with an IDE setting is what happens if you open a project from someone who has their IDE set up differently to yours? Would the code still compile if your IDE was set to not use the += syntax and their code was written that way? If that would be a compile failure then you have instantly caused fragmentation amongst the users, if it would compile then why bother with an IDE setting anyway? Just a thought, probably something Wayne would be best to answer is if tB supports .editorconfig files as a way of managing this kind of thing.


no, the idea is that C and VB have both the same operations, but they are called differently.

so, a code:

>>=

Right shift assignment

so when in C-mode we have:

a >>= 2 

when u switch to VB mode it will change to

a = RightShift(2) 
or 
RightShift a , 2
or
a RightShift 2

----------


## PlausiblyDamp

> no, the idea is that C and VB have both the same operations, but they are called differently.
> 
> so, a code:
> 
> >>=
> 
> Right shift assignment
> 
> so when in C-mode we have:
> ...


So changing the option would effectively rewrite the relevant parts of the code? Or would it store the code the same way under the hood and just display / translate in the editor based on your IDE choice? Rewriting sounds problematic if you are sharing your code via any source code control system as potentially a minor edit could cause a lot of changes to be saved, making it harder to track down what the actual change was when looking over the history.

----------


## baka

the IDE need to parse anyway when u build/run/compile it.

and its not that u will keep changing modes.
people will have one or the other.

but, theres an option to "parse" the operations between C and VB.
the IDE itself can read both, meaning its possible to combine the 2 modes if one wants.

that means, when I run a project, and I notice, "he is using C mode", I can just click on the "VB-mode" and it will parse the entire project into VB-syntax.

if we are gonna use multiple syntaxes, it should be possible to have one or the other and there need to be a option in settings to be able to do that fast.
to do it manually takes too much time.

otherwise its a one-mans job, and it will be harder to share.

----------


## Zvoni

> The problem you get with that is somebody could then make the += operator do something non-obvious. That could result in the following two examples doing two completely different things...
> 
> 
> ```
> Dim i as Integer = 10
> i = i + 5
> ```
> 
> and
> ...



I know i'm contradicting myself (since i said i'm out of this discussion), but PD responded directly to my post, and i respect PD for his skills and opinion.

PD, everything true you said, but in case someone wrote his own "+="-operator, and he bugged it (e.g. his Return-Line reads "Return ALong - AStep" --> Note +/-),
well, his problem, not mine.
Because frankly: There wouldn't be a difference between his faulty operator or a faulty "classical" function

After following the discussion (not Fight! *g*) about this, I'm more on the ambivalent side now regarding this
(Since women are allowed to change their mind 20 times within 5 minutes, i think i, as a male, am allowed to change my mind once after some days, a fruitful discussion preceeding it):
We have it now as an intrinsic (as Wayne said: It's implemented). I don't have to use it (and i wouldn't since i grew up with "a = a + 1"), but noone should expect help from me asking why his "a += 1" is not working as expected.


EDIT: On a sidenote:
After my transition to FreePascal/Lazarus, i discovered in FPC/Laz that i can overload intrinsic operators.
In my case then it was the "+"-operator, which in FPC is used for addition as well as for String-concatenation.
I was asking on their forum, how i could "shorten" a 


```
MyString:=SomeString+SomeInteger.ToString;   //MyString:=SomeString+SomeInteger; produces an error since FreePascal is strictly typed, no implicit Type-Cast
```

One answer was: 
Overload the "+"-operator, but beware: In this case if something doesn't work as expected, and you ask for help,
*but you don't mention you've overloaded the operator,*
then all gloves are off

----------


## Shaggy Hiker

> While we're here, I have an irrational hatred of leading underscores in names (I think it means something in C or C++? Maybe even double-underscores mean something? It drive me nuts). Even naked underscores bother me (e.g. something like (a, _, b) = Something). The weird part is that I'm fine with internal underscores and use them all the time (so something like This_Is_A_Variable scans fine for me). What can I say, I'm an irrational meat computer doing his best.


I have a dislike of underscores leading or otherwise. It's not irrational, either. That underscore key is one of the most awkward you can type as a touch typist. Not a bit deal in C style languages, since they make so much use of symbols from the Shift+Number key area, but they aren't easy to type. 

The double underscore was a way to indicate a certain type of function in something like MFC C++, if I remember right...but even if I DO remember right, I don't remember what the type of function was that used them. Something like "part of MFC, but not ANSI-Standard C++".

----------


## Shaggy Hiker

Why is FreePascal abbreviated to FPC? It seems like FP would make more sense. The C in there is just chosen as it starts a syllable, not a word. That's not done very often.

----------


## Niya

I actually use leading underscores in my VB.Net programs for class level variables. VB6 doesn't allow it so I use *g_* prefix for class level variables in VB6.

----------


## Zvoni

> Why is FreePascal abbreviated to FPC? It seems like FP would make more sense. The C in there is just chosen as it starts a syllable, not a word. That's not done very often.


FPC = Free Pascal Compiler

----------


## Shaggy Hiker

> FPC = Free Pascal Compiler


Ah. That totally makes sense. Thanks for the clarification.

----------


## VB6 Programming

twinBASIC status update:

https://nolongerset.com/twinbasic-up...ember-19-2021/

_Highlights include support for importing VB6 project files (*.vbp), new MsgBox options, and a spirited discussion about what tB's design priorities should be._

twinBASIC now allowing import from VB6 projects (.vbp) is something many of us have been waiting for.
At the moment, only supported documents are imported (i.e. modules and classes, not forms).  Once form import is supported, and VB6 forms are supported in the GUI (expected February) we should be able to convert existing VB6 apps to twinBASIC.

----------


## dee-u

I tried to "import" a relatively small code with one subroutine, it is a tool to read an xlsx file and spit out a pdf output. After commenting out the codes for the form (disabling buttonts, etc.) it was able to spit out the pdf file just fine! My only concern is it was not able to compile the following code:



```
Screen.MousePointer = vbDefault
```

I am not sure if I need to reference something to make it work, and I don't even know how to make references in TB.

----------


## VB6 Programming

> I tried to "import" a relatively small code with one subroutine, it is a tool to read an xlsx file and spit out a pdf output. After commenting out the codes for the form (disabling buttonts, etc.) it was able to spit out the pdf file just fine! My only concern is it was not able to compile the following code:
> 
> 
> 
> ```
> Screen.MousePointer = vbDefault
> ```
> 
> I am not sure if I need to reference something to make it work, and I don't even know how to make references in TB.




You can report twinBASIC issues at https://github.com/WaynePhillipsEA/twinbasic/issues

I guess this may be dependent on the GUI Forms Editor being completed.

----------


## wqweto

> I tried to "import" a relatively small code with one subroutine, it is a tool to read an xlsx file and spit out a pdf output. After commenting out the codes for the form (disabling buttonts, etc.) it was able to spit out the pdf file just fine! My only concern is it was not able to compile the following code:
> 
> 
> 
> ```
> Screen.MousePointer = vbDefault
> ```
> 
> I am not sure if I need to reference something to make it work, and I don't even know how to make references in TB.


No, there is no reference that can help you with this because TB runtime (all the built-in objects like Screen, App, etc. in VBx) is not complete yet.

Your only option is to replace Screen.MousePointer object properties calls with Screen_MousePointer global properties (in a .bas file in *your* project) and provide empty stubs for these replacements (or reimplement them with API calls).

cheers,
</wqw>

----------


## baka

so, I decided start using TwinBasic.
after installing it, I started coding for my next project.

the first thing is File-IO, so, CurDir, check if file exists and FileLen.

CurDir worked, returned a string,
after that I needed to get the length of a file, using FileLen, but I get an error. no matter if the file exists or not.

since I want to do everything using internal commands (not API as that could make a mess when cross-platform is here)
Im already stuck. after 1 minute of coding... will wait another year then...

----------


## WaynePhillipsEA

@baka   Not seeing any problem with FileLen here (tested with local files and network files), though bear in mind that the File-IO portion of twinBASIC has not long been completed.

Could you show me your code?

----------


## baka

I figure it out.
the CurDir takes the Folder of VSCODE

FileLen(Sys.Root & "\data\initialize.txt")

I changed to

FileLen(Sys.Root & "\..\data\initialize.txt")

(I placed VSCODE in the folder where I will create the project so sys.root = CurDir would give me where VScode is)

here was the error I got when I tried the code:


so, its similar to VB6, I need to check if its in IDE or compiled.

but, how to know this? should I use:

CBool(App.LogMode = 0) 

as I do in VB6? (but it gives me error in TwinBasic)

(I dont care for compatibility, I can use any new commands)

----------


## WaynePhillipsEA

> I figure it out.
> the CurDir takes the Folder of VSCODE
> 
> FileLen(Sys.Root & "\data\initialize.txt")
> 
> I changed to
> 
> FileLen(Sys.Root & "\..\data\initialize.txt")
> 
> ...


Just FYI, in the vast majority of cases, the tB runtime throws a generic E_FAIL error (&H80004005) for all types of failures, which is quite unhelpful... but this is an area we are currently working on, so this will improve greatly over the next few weeks.  The github issue for tracking our progress on this is https://github.com/WaynePhillipsEA/twinbasic/issues/56

----------


## baka

edit: did some research

thx.

so, its similar to VB6, I need to check if its in IDE or compiled.

this method is not working: CBool(App.LogMode = 0)
looking here: https://www.vbforums.com/showthread....ing-in-the-IDE

I found that this is working:



```
Function RunningInVB() As Boolean
'Returns whether we are running in vb(true), or compiled (false)
 
    Static counter As Variant
    If IsEmpty(counter) Then
        counter = 1
        Debug.Assert RunningInVB() Or True
        counter = counter - 1
    ElseIf counter = 1 Then
        counter = 0
    End If
    RunningInVB = counter
 
End Function
```

would be nice to have a "twinbasic" alternative, like IDEmode that returns True or False

----------


## WaynePhillipsEA

> edit: did some research
> 
> thx.
> 
> so, its similar to VB6, I need to check if its in IDE or compiled.
> 
> this method is not working: CBool(App.LogMode = 0)
> looking here: https://www.vbforums.com/showthread....ing-in-the-IDE
> 
> ...


Yes, that's a good idea.  I've just added App.IsInIDE boolean property in v0.13.53.   The update should be available to you via the extensions bar on the left side of VS Code within about 10 minutes.

----------


## baka

just tried it and it work well.
now I don't even need to place that property in a collection, I just call App.IsInIDE when needed. and because its boolean I simply



```
If App.IsInIDE Then
```

thx a lot!  :Smilie: 

now.. continuation of the project.
next will be a bit of file handling and all that.
will report when Im stuck again or theres a feature missing 
(but this time after I do a bit more research)

----------


## yereverluvinuncleber

Why wait one year? Report it and Wayne will most likely fix it within a week or so. Do realise that TwinBasic is heavily Alpha grade and that you should only be using it to test out how and why it fails.

If it does work then be happy otherwise think of a failure as being a valid test that proves a point, something yet to be implemented.

You wouldn't drive a car just 25% complete it its design phase... Where is that rear wheel?

----------


## wqweto

Using App.IsInIDE has its downsides.

We need preprocessor conditional for RunningInIde i.e. instead of this

If App.IsInIde Then
<<lots of code here which is included in final executable>>End If
. . . something like this would be better

#If RunningInIde Then
<<lots of code here to be removed at compile-time>>#End If
. . . so that we don't bloat final executable with debugging code.

I already use this in VBx

Dim bInIde          As Boolean
Debug.Assert SetTrue(bInIde)

If bInIde Then
<<code>End If
. . . and the C2 compiler is smart enough to prune <<code>> when the boolean variable is not set (always false) during native code compile.

We already have TWINBASIC const, might be good idea to add TWINBASIC_DEBUG or similar for while running under the debugger too.

cheers,
</wqw>

----------


## WaynePhillipsEA

There are benefits to both ways... App.IsInIDE gives neater code than conditional compilation IMO.  The optimizing compiler that is coming soon will also be able to prune the redundant code here... I'll make sure that it is treated as a simple inlined constant.

That said, a TWINBASIC_DEBUG compiler constant is also a good idea.

----------


## baka

I see the use, 
for me its usually just the CurDir and maybe some subclassing that I want to avoid during IDE.

so App.IsInIDE is good for my needs, 
that doesn't mean another way should not be implemented

if I would know that I want "specific" stuff called in IDE, that would be nice.
Im thinking of usercontrols where I "simulate" something in IDE, that are not needed once compiled.
(I did have an idea in vb6, where in IDE you use pictureboxes to place pictures around, but compiled, the pictureboxes would be replaced by direct2d rendering, but I never started is, as I dont use usercontrol, it was just an idea that I wanted to do after my game project)

----------


## Niya

> so, I decided start using TwinBasic.
> after installing it, I started coding for my next project.
> 
> the first thing is File-IO, so, CurDir, check if file exists and FileLen.
> 
> CurDir worked, returned a string,
> after that I needed to get the length of a file, using FileLen, but I get an error. no matter if the file exists or not.
> 
> since I want to do everything using internal commands (not API as that could make a mess when cross-platform is here)
> Im already stuck. after 1 minute of coding... will wait another year then...


When I tried it the first time, I found a whole bunch of issues. Just report them and Wayne would fix them as soon as he could. This is one of the biggest areas where the community can actually contribute.

----------


## freeflow

I've noted some heated discussion on this thread about syntax tuples, += etc and I'd like to make some observations

Lets take +=.

Lets take a step back to c (as this has been cited in arguments).  Why did += exist?

Its likely that this was seen as a convenient way of incrementing a variable when iterating over an array. Think about that.

The answer to the question is not if a=a+1, a+=1 or Inc(a) should be used but that the language offers a way of iterating over an array, collection of objects without the need to manage an indexing variable

VBA solves this problem with the 'for each' construct. 

There has also been discussion on tuples and functions as first class objects.  VBA allows both, you just need a bit more boiler plate code to implement the functions.  As for using tuples and simple little functions, this is fine if you are prototyping, i.e just doing a quick look see.  If you are coding for real then both unnamed tuples and adhoc functions should be avoided like the plague.  They have no place in a modern programming language.  This is because unnamed tuples and ad hoc functions cannot be tested.  You only want facilities in your programming language that allow your code to be fully tested before you put it into use.

So please, in your discussions, please try to take a much higher level perspective when considering what does and does not make a good update for twinBasic compared to vba.

For my two pennies worth, and to supplement the discussion of +=, I'd very much like to see the for each statement of twinbasic to be updated to allow multiple items




```
for each myItem1, myItem2,myitem3 in myItems1, myitems2, myitems3
```


as this would remove the annoying requirement to have a indexing variable when iterating over one collection to operate on a matching collection.

But again this may not be high level enough, because it is relatively simple to emulate such a construct by writing zip and unzip functions (zip in the sense of a collection holding pairs from two or more arrays)

Something to mull over during the holiday period.

Cheers.

----------


## wqweto

> Why did += exist?
> 
> Its likely that this was seen as a convenient way of incrementing a variable when iterating over an array. Think about that.


Thinking about it *very* highly unlikely iterating over an array has anything to do with += operatror.

IMO the shortcut exists because on *all* CPU architectures there are ADD and INC instructions and the original C was meant as a thin wrapper over ASM, a kind of portable ASM.

Using similar contrived logic I can surmise that back then in the '70 there were no real arrays and that's why C has pointers to deal with anything that looks like an array :-))

cheers,
</wqw>

----------


## Shaggy Hiker

That doesn't seem to be a reason why += exists, it seems like a reason why ++ exists, which it only does in C syntax. += is nothing more than a shorthand, whereas ++ is an increment operator.

I'd argue that arrays still don't exist, but it's pedantic.

----------


## wqweto

x++ is *INC reg* while x+=5 is *ADD reg, imm* if we are going to make far fetched analogies.

What exactly is is x+=f(x)*g(y) we'll leave to the imagination of the readers.

cheers,
</wqw>

----------


## mansellan

> x++ is *INC reg* while x+=5 is *ADD reg, imm* if we are going to make far fetched analogies.
> 
> What exactly is is x+=f(x)*g(y) we'll leave to the imagination of the readers.
> 
> cheers,
> </wqw>


So I did actually propose this, way back in the day. To me, prefix vs postfix seems entirely logical. But I accept it may not be a natural fit for BASIC.

----------


## baka

theres a reason why its called Basic
but, for me its ok to have += ++ -- == etc, as long theres alternatives,

we have:

Dim A&
Dim A as Long

its the same principle.

----------


## freeflow

The reason for my observation is that in the C programming language ++ and += add/increment based on type of the target variable.  Thus if myVar is an int of 4 then myVar+=1 increments myVar to 5, however, if myVar is a pointer then myVar+=1 adds to myVar the size of the type being pointed to such that myVar now points to the address of the next myVar type.  You wouldn't do this if you were not effectively implementing a for each type mechanism.

----------


## wqweto

> You wouldn't do this if you were not effectively implementing a for each type mechanism.


The reason p++ increments by sizeof(referenced type) is because this is the only way pointer arithmetic makes sense i.e. *p is p[0] (first array item) and *(p+1) is p[1] (second array item) so it makes sense for p++ to point to second array item too (like p+1) so the address in p has to be incremented by sizeof(item type), not a single byte.

Pointer arithmetic is devised long before For Each or any collections/iterators (or any *objects* in first place) were a figment of imagination.

cheers,
</wqw>

----------


## freeflow

We are not arguing about pointer arithmetic but about why += and ++ exist in the first place.  Its about recognising patterns in code.  'For each' may not have been in the scope of the implementors of bcpl, b, c etc, but the pattern exists. Arrays/Matrices existed in maths long before programming came to be so its not surprising that the pattern of pointer arithmetic was recognised and Array syntaxes were introduced into programming languages as a useful notation.   Recognising patterns and formalising them into a more concise syntax is how programming languages develop.  The evolution of 'for each' is of course the map, filter and reduce methods, all of which depend on a pointer to a function, which of course evolved into syntax supporting anonymous functions.

----------


## Shaggy Hiker

That argument makes sense for ++, but not for +=. After all, += is just a shorthand for a = a + N. The long hand version works just the same as the shorthand version, regardless of what a is. That isn't the case for ++, exactly. For one thing, while you could write ++ as a = a + 1, that isn't necessarily the same thing, since the former is INC, while the latter is ADD.

----------


## Niya

> Thinking about it *very* highly unlikely iterating over an array has anything to do with += operatror.


It probably exists because someone thought it's more concise to do *MyLongVar+=1* than *MyLongVar=MyLongVar+1*. I tend to agree. I don't use the latter at all if I don't have to.

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update: December 26, 2021

_Highlights include several improvements to the COM references list, a fix for the hidden dialog windows issue, and many discussions about possible tB features._

----------


## freeflow

If you are working with pointer arithmetic then its more likely that += exists to be able to iterate the first dimension of a 2D array more easily e.g. if your linear allocation of memory represents data organised as an array(0 to 4,0 to 5) then arrayPtr+=5 will iterate 'rows'  (the 0-4 dimension) of the 'Array'.

----------


## Shaggy Hiker

True, but so would arrayPtr = arrayPtr + 5.

----------


## Niya

I find it interesting that some people want to bite my head off when I suggested that including += was a good move because it was not "BASIC-like", yet some of those same people are fighting tooth and nail for having pointers in TwinBASIC. This is hilarious lol

----------


## Eduardo-

> I find it interesting that some people want to bite my head off when I suggested that including += was a good move because it was not "BASIC-like", yet some of those same people are fighting tooth and nail for having pointers in TwinBASIC. This is hilarious lol


You confuse syntax with features.

It seems that for you to be Basic-like is to preserve (and increase?) the shortcomings of VBx.

About syntax: to be Basic-like is to have clarity.

They have nothing to do one thing with the other.

You always confuse everything.

----------


## Niya

When you hear about pointers, BASIC is not what comes to mind. I believe someone also made a point in that thread towards why VarPtr was hidden. Its so that "noobs' can't shoot themselves in the foot or some such thing if I understood correctly. The point I am making is that the concept of raw pointers is not BASIC-like and never was, yet it is still accepted by VB6 programmers. This is why I find it quite odd that some of these same VB6 programmers could complain about += in BASIC.

----------


## Niya

Nevertheless, I'm not really down to fight over this. I just found it interesting. 

What personally think is that the more abilities the language has, the better. Whether it's VarPtr or what Wayne suggested:-


```
MemoryAddress.UnsafeCast(Of Double) = 123.456

   With MemoryAddress.UnsafeCast(Of MyUDT)
      .Value1 = 123
   End With
```

Either is fine in my opinion. You guys can mince this one. I'll just watch  :Wink:

----------


## baka

it should be optional and not mandatory,
thats what I wrote, anything non basic, need to have an equivalent basic syntax, thats it.

preferable also a IDE-command that can switch between the syntaxes, as I explained, 
if you use += I should be able in my IDE, call "convert into basic-mode" and it will parse the project and change += into the basic equivalent, and in the same do the reverse if u want to use that.
or work with both, if u prefer that. its all about choices.

and about pointers, I don't agree.
basic in commodore 64 u could directly manipulate the memory using "poke", and u could call any memoryadresses using the "sys" command.
but they a word not some odd symbols. 
and I don't understand why its not basic. its just an address that the object/variable is located. nothing strange about that.

----------


## Niya

+= is not and never was mandatory. It is a choice. The choice is between a=a+1 or a+=1. So you already have a BASIC and a "non-BASIC" way of doing it. Adding a 3rd way to do this is just polluting the language which is why I am against operators like ++.

----------


## Eduardo-

> This is why I find it quite odd that some of these same VB6 programmers could complain about += in BASIC.


You are still confusing things, but it is already like the 10th time. I'm tired to explain the same thing over and over again.




> When you hear about pointers, BASIC is not what comes to mind. I believe someone also made a point in that thread towards why VarPtr was hidden. Its so that "noobs' can't shoot themselves in the foot or some such thing if I understood correctly. The point I am making is that the concept of raw pointers is not BASIC-like and never was, yet it is still accepted by VB6 programmers.


The subject was discussed on its threat at GitHub.
If you have something to say, you can go there.
But I think what you are saying was already discussed there.

----------


## baka

yeah. but again
if you have non-basic syntax, there should be a way to change it
to have both, it will confuse people, even if both works, I want a converted when I get your source
sure I can create my own parser, but that would mean TwinBasic is already broken if I need that.

and if we have 50 different non-basic crap all over the language, u can not demand people to just know it.
or force people to adapt. thats selfish.

----------


## Niya

> You are still confusing things, but it is already like the 10th time. I'm tired to explain the same thing over and over again.
> 
> The subject was discussed on its threat at GitHub.
> If you have something to say, you can go there.
> But I think what you are saying was already discussed there.


Let's just agree to disagree and move on. I have nothing to add on the discussion of pointers. I just see a lot of contradiction in some of your attitudes on what BASIC should be. That's what I was trying to point out.

----------


## Niya

> to have both, it will confuse people, even if both works


I have to ask. Do you actually believe this to be true? Honest question.

----------


## Eduardo-

> I just see a lot of contradiction in some of your attitudes on what BASIC should be. That's what I was trying to point out.


The contradictions are in your mind.




> and move on.


Yeah, we agree in something.

----------


## baka

yes, it will confuse. 
but most of it, it will create an ugly source.
I want the code to be neat, and += is ugly.
now you want to have that crap syntax, sure, use it if you want, but do not force it on someone else.
I don't want to have it, and if I see it I will be forced to change it. its like OCD, theres no option, you force me to check the entire code to change all that.

for me, its not how basic should look like. 

and as I already wrote, it will create issues in the community when we are using different syntaxes,
you think its a small thing, nothing to argue about, but I tell you, it will get troublesome.

twinbasic already added: <<, >>, +=, -=, *=, \=, /=, ^=, &=, <<=, >>= so its not just +=
that for me is going in the wrong direction. instead of really brainstorming to figure out a "basic" equivalent, the c- like operators where added.
in the end it will just be a handful people using it, 99% will use the basic functionality and the RAD-functionality.

what a couple of you (and Im not really sure you will even use most of it) are doing is to create a master language for your own needs that just a few of you will use.
the other experts will never use twinbasic, they will use c/c++ so in the end, its features that just a handful will use, if ever. maybe its just a wet dream to come true since you wanted to have it, now u got it to the expense of the language itself. for everybody else its just making it confusing.

microsoft could have added, but they didnt. mostly because its not needed for the masses. and the experts will surely use c anyway.

for me, what would have been the best strategy is: create a successor for VB6, and stay in course with the language, and if you add features, they should use basic words, not something else.
now, it seems twinbasic will create his own story, and Im not sure I want to follow that. we will see, but Im not happy about c language mixing. rather don't have those fancy operators than have the syntax like that. I mean, I can still use VB6 and do "almost" anything anyway so its not that its so needed to destroy a language. no thank you.

----------


## Niya

> what a couple of you (and Im not really sure you will even use most of it) are doing is to create a master language for your own needs that just a few of you will use.
> the other experts will never use twinbasic, they will use c/c++ so in the end, its features that just a handful will use, if ever. maybe its just a wet dream to come true since you wanted to have it, now u got it to the expense of the language itself. for everybody else its just making it confusing.


When I moved from VB6 to VB.Net, I picked up the new operators almost immediately. The << and >> operators in particular answered some of my prayers. I always hated having to use division to perform bit shifts in VB6 and I loved that Microsoft finally brought them to Visual Basic. As for the += and -= operators, I picked those up very quickly as well. Unlike the bit shift operators, I didn't actually need them but after a while, I found myself using them exclusively when incrementing variables anyway. 

To be honest, I have never gave much thought to them. To me it seemed like a natural progression. It didn't confuse me nor did it ever feel odd or out of place to me. I think this is where our disagreement fundamentally comes from. I'm used to these operators in a BASIC syntax while you are not. You see this as dragon to be slain while to me it's not even worth mentioning.

I cannot say we will ever agree on this. All I can say at this point is to plead your case to have them removed from TwinBASIC if you guys feel that strongly about it.

----------


## baka

Im not opposed to add Left Shift and Right Shift Operators.
but we could have:

A LeftShift 2
A RightShift 2

instead of << and >>

its the natural way, instead of letting c win again.

thats what I dont like. why do we need to copy c.
if you like c so much, go write c code.

----------


## Eduardo-

> A LeftShift 2
> A RightShift 2


What about**:



```
A LShift 2
A RShift 2
```

I don't remember if that was discussed on GitHub.

----------


## Niya

> A LeftShift 2
> A RightShift 2
> 
> instead of << and >>
> 
> its the natural way, instead of letting c win again.


Ugh  :Sick: 

Imma be honest, that is ugly as hell. However, it is not unprecedented. For example, VB.Net has non-symbolic operators like AndAlso, OrElse. Let's not also forget the classics like the NOT, MOD, AND, XOR and OR operators.

However, I have a question. Why stop there? Why not go all the way and do this will all operators? Instead of:


```
a + b
```

we do 


```
a PLUS b
```

Or 


```
If a EQUAL b then
```

Where is the line drawn?

----------


## Niya

Lets see how this will look in actual code. Lets use this from another post I made:-


```
       code = errorValue And &HFFFFI

        facility = (errorValue And &H7FF0000) >> 16
        severity = Math.Abs((errorValue And &H80000000) >> 31)
        reserved = (errorValue And &H40000000) >> 30
        customer = (errorValue And &H20000000) >> 29
        NTSTATUS = (errorValue And &H10000000) >> 28
        XBit = (errorValue And &H8000000) >> 27
```

Lets see how that would look with the >> operator replaced:=


```
       code = errorValue And &HFFFFI
        facility = (errorValue And &H7FF0000) RShift 16
        severity = Math.Abs((errorValue And &H80000000) RShift 31)
        reserved = (errorValue And &H40000000) RShift 30
        customer = (errorValue And &H20000000) RShift 29
        NTSTATUS = (errorValue And &H10000000) RShift 28
        XBit = (errorValue And &H8000000) RShift 27
```

Now lets take this argument all the way and replace all symbolic operators:-


```
        code Assign errorValue And &HFFFFI
        facility Assign (errorValue And &H7FF0000) RShift 16
        severity Assign Math.Abs((errorValue And &H80000000) RShift 31)
        reserved Assign (errorValue And &H40000000) RShift 30
        customer Assign (errorValue And &H20000000) RShift 29
        NTSTATUS Assign (errorValue And &H10000000) RShift 28
        XBit Assign (errorValue And &H8000000) RShift 27
```

The = assignment operator is replaced with a non-symbolic Assign keyword.

Do you guys honestly think any of this is better? I don't know about you guys but I find that extremely painful to read.

----------


## baka

its not the same, it has been like that since commodore 64 and maybe even earlier.

remember that < stands for "Lesser Than"
so a << would be "Lesser Than Lesser Than"

and thats how basic works. it tells u "this" stands for something and not something else.
like

so, <= would mean Lesser Than Or Equal To
that is how basic work.

while in c u can have == and other odd combinations

@Eduardo- 
yeah, that looks ok as well LShift and RShift I could buy. its a bit shorter.

so @Niya its not about having words to everything, but that it makes sense.
you can combine the words and symbols and you can read it.

like a language

mousetrap = we would understand mouse and trap.
but in c it could mean something completely different.

+-*\^ are already used. so if you want a symbol to create LeftShift, we would need to take something that is not used, and the keyboard is quite limited for that.

----------


## mansellan

> its not the same, it has been like that since commodore 64 and maybe even earlier.
> 
> remember that < stands for "Lesser Than"
> so a << would be "Lesser Than Lesser Than"
> 
> and thats how basic works. it tells u "this" stands for something and not something else.
> like
> 
> so, <= would mean Lesser Than Or Equal To
> ...


Well you could look to what FreeBASIC has for operators: it uses Shl and Shr. But then again, it has +=, ^=, And= Shr=, so... maybe not lol.

Not my call, but I can't see these new operators being removed from TwinBASIC, there's probably as many who like them as dislike them.

Perhaps the thing to do is to write a linter. If you see code that doesn't use your preferred style, just stick the linter on it. And I can run it in the opposite direction afterwards :-)

----------


## Niya

> so @Niya its not about having words to everything, but that it makes sense.
> you can combine the words and symbols and you can read it.


I get what you're trying to say but it just seems so arbitrary and random what is and isn't acceptable. As hard as I try to understand you guys' point of view, I gotta say, I really don't get it. 

I guess there is a fundamental difference between the way we think. Past few years I've become very open-minded and willing to accept changes with little to no fuss. 15-20 years ago I might have been firmly in you and Edurdo's camp but today, it's like whatever to me, you know...bring it on!....I can't find it in me to fuss about tiny things like this anymore. 

This fundamental difference of mind may be the main reason I was able to transition from VB6 to VB.Net with zero problems while others cannot bring themselves to do it. I looked at VB.Net and saw progress, you looked at it and saw betrayal. We see things completely differently. It is what it is I guess.

All in all, I hope you guys get what you want out of TwinBASIC in the end.

----------


## Niya

> 15-20 years ago I might have been firmly in you and Edurdo's camp but today, it's like whatever to me, you know...bring it on!


Just to harp on a little bit on this point. There was a time in my past where I hated seeing VarPtr and CopyMemory in Visual Basic programs because I felt it didn't belong in BASIC and because code like that could actually crash the IDE itself. I felt it was a corruption of the simple, easy to use and learn BASIC language I had grown up with. I used to be like "Pointers? In BASIC? Why don't they go to hell with that! Why are people bringing this C garbage over here!" 

It was only later in life when I got more comfortable and knowledgeable about lower level details like pointers did I realize that my real problem with VarPtr and CopyMemory was that I couldn't understand it. Today, I don't mind it one bit. Now that's a 180 about turn!

----------


## baka

for me its just this:

- when u start borrowing words from other languages it will make your own language not unique anymore and not really the same language anymore

why is it that hard to add "LShift" or "SHL" or "LeftShift" instead of <<
theres no logic.

but Wayne is not a basic guy, he is a c/c++ guy so for him its natural.
but for me, its not. for me its a betrayal for the language itself.

even if .net (that also betrayed basic) just adapted << >>,it doesn't mean that TwinBasic need to follow the .Net dudes.
I thought that TwinBasic was the continuation of VB6 and not .Net

so another betrayal. its the whole reason TwinBasic has a chance to get us VB6 on board because we never bought the .net discount.
if I really liked how .net worked, I would have already migrated and I wouldn't even care for TwinBasic as I would have focus on the later .Net updates.

----------


## mansellan

> for me its just this:
> 
> - when u start borrowing words from other languages it will make your own language not unique anymore and not really the same language anymore
> 
> why is it that hard to add "LShift" or "SHL" or "LeftShift" instead of <<
> theres no logic.
> 
> but Wayne is not a basic guy, he is a c/c++ guy so for him its natural.
> but for me, its not. for me its a betrayal for the language itself.
> ...


These operators were actually added before twinBASIC reached alpha (and before there was a repo to discuss such things). I'm sure it never even occurred to Wayne that they could be controversial, only that they would be useful.

There's a pretty active community on the GitHub repo, with lots of discussion of proposals. When something genuinely splits opinion, there's usually a vote on which way to go. That seems very reasonable to me. If you're not already active there, I'd urge you to join in if you want to help guide its direction.

----------


## Niya

> why is it that hard to add "LShift" or "SHL" or "LeftShift" instead of <<
> theres no logic.


The logic behind this is simple....People are already familiar with the << and >> symbols and what they mean. Those of us that bounce from language to language actually prefer many things remain the same. I love the fact that it's the same in C/C++, VB.Net, C#, JavaScript and Python. I've used all these languages at one point or another and I can personally say that it is SO great when these languages have things like this in common. It takes so much burden out of learning new languages when you can bring much of what you've learned in other languages to whatever language you're learning now.

----------


## Niya

> Not my call, but I can't see these new operators being removed from TwinBASIC, there's probably as many who like them as dislike them.


If TwinBASIC starts attracting people from outside of the VB6 community, it's most likely going to be overwhelmingly supported.

I guess the real question that needs discussing is, do you guys want TwinBASIC to be for just VB6 programmers? Or do you want it to become something more?

----------


## Eduardo-

Niya is talking about things that have been discussed ad-nauseam days ago here in this same thread.

He needs to come in the proper time.

----------


## baka

so, TwinBasic is not the continuation of VB6,
and why the h*ll do we need compatibility, transfer project etc? if in the end its created for the benefit of everyone else?
TwinBasic need to get people from c, c++, c#, java, python and whatever. and why not just create the entire language into that and skip basic?
no point using basic if the mission is to get c/c++ people here, and if they want to be comfortable, why not just use c/c++ language?

and why should c/c++ programmer even care if TwinBasic will be a b@stard of a language that they will hate.
we know that c/c++ people usually sees basic as the kids language, something inferior, and crappy.
so why should they spend time in twinbasic at all?

no, c/c++ people will stay there, as they believe its the master language, and also, everywhere, companies, they require you to know c,c++,c#,java etc,
it takes "a lot" to make a new language successful. so not easy to achieve status. and if you try to please everybody, in the end you get nothing.

so, now we gonna invite everyone.. and in the end nobody will show, at the premiere party. as they will just stay where they are as its the most comfortable place to be.
and while the VB's will be there looking around and thinking. oh well, this was a blast, sitting in the corner area as they where not the vip.

its hilarious that I need to bend down for other languages and in the same time give TwinBasic support.
so, no. I have seen this before, in other kickstarter, where in the end the dev had other plans and it went all to s***.

----------


## mansellan

> so, TwinBasic is not the continuation of VB6,
> and why the h*ll do we need compatibility, transfer project etc? if in the end its created for the benefit of everyone else?
> TwinBasic need to get people from c, c++, c#, java, python and whatever. and why not just create the entire language into that and skip basic?
> no point using basic if the mission is to get c/c++ people here, and if they want to be comfortable, why not just use c/c++ language?
> 
> and why should c/c++ programmer even care if TwinBasic will be a b@stard of a language that they will hate.
> we know that c/c++ people usually sees basic as the kids language, something inferior, and crappy.
> so why should they spend time in twinbasic at all?
> 
> ...


@baka, @Eduardo, you both seem very angry, and I'm not sure why.

But I think I need to stop now.

----------


## Niya

> so, TwinBasic is not the continuation of VB6,
> and why the h*ll do we need compatibility, transfer project etc? if in the end its created for the benefit of everyone else?
> TwinBasic need to get people from c, c++, c#, java, python and whatever. and why not just create the entire language into that and skip basic?
> no point using basic if the mission is to get c/c++ people here, and if they want to be comfortable, why not just use c/c++ language?
> 
> and why should c/c++ programmer even care if TwinBasic will be a b@stard of a language that they will hate.
> we know that c/c++ people usually sees basic as the kids language, something inferior, and crappy.
> so why should they spend time in twinbasic at all?
> 
> ...


Hey man. You're taking this a little too personal. We're talking about a programming language here. No need to get so worked up over this. People are going to have opinions that differ from yours and there really is no right and wrong here. Try to relax and take it for what it is.

----------


## Shaggy Hiker

I would say that the reason that >, <, +, and = make sense to us is because we learned them in grade school. There was a time when those symbols didn't mean a thing to us, we just learned a common meaning at such a young age that we don't remember learning them. They don't have inherent meaning. We had to learn them. Did I learn = before I learned the word equals? I don't remember, but I think probably not. I remember learning math, though only vaguely, but I learned to read before I have any memory. 

We can do the same thing for any other operator. Personally, I prefer Or to |, but that is partially because I use | for other things, not necessarily in programs. For me, with the background that I have, >> and << are as familiar to me as +, =, and so on. However, LeftShift isn't more familiar than using Equals in place of =, it's just that we learned the meaning of = so far back in our lives that it's second nature. Any other operator could be the same. On the other hand, if you use LShft or SHL, then you aren't really replacing a meaningless symbol with words. Instead, you'd be replacing a meaningless symbol with a meaningless symbol. You'd have to KNOW what SHL meant. It is no more obvious than <<. So, if you want to use words, LeftShift or ShiftLeft would be readable whereas an abbreviation has to be learned just the same as a symbol has to be learned.

----------


## Niya

> @baka, @Eduardo, you both seem very angry, and I'm not sure why.


The VB6 community has carried emotional baggage from the perceived betrayal by Microsoft because they abandoned VB6 for VB.Net. I kinda get it since I resisted for quite a while before I moved to VB6 but once I moved over, I got over it real fast. However, the people who didn't migrate have carried that hurt for decades now and those emotions bleed out in discussions like this.

This is actually not an uncommon phenomenon. I've seen a particular nasty one on a C forum where a guy went to war with the whole forum because he couldn't use his DOS real mode programming skills in modern protected mode operating systems like Windows. It was bizarre as hell but I saw many of the same arguments in that thread. Much like many here argue for the purity of VB6 and it's way of doing things, this guy was arguing for the "purity" of operating systems where programmers should be allowed to interface with hardware directly. He had a bunch of assembly code he wrote back in the 80s that was just useless in Windows because Windows doesn't allow you to just do what you want. He was furious at this and no one could convince him that his code was outdated and unneeded. 

I also remember this exact same type of thing happening when Starcraft 2 was released. Half the people in the these gaming communities went nuts because it wasn't the original Starcraft. There were people that actually complained that it wasn't "real" or "pure" because they used 3D graphics instead of outdated sprite based graphics. They also didn't see any of the improvements as improvements but as Blizzard not caring much like we see people here saying that Microsoft doesn't care. 

I've seen this behavior over and over and over again. This is an extremely common theme of the human experience. There's always a section of people that hate change and perceive it as a betrayal by the movers and shakers when they enforce changes.

The point is, when the old meets the new, you're going to get some strong emotions and people losing their damn minds, whether it's VB6 vs VB.Net, Starcraft vs Starcraft 2 or Windows vs DOS.

----------


## baka

its your words, multiple times u write similar to this:

- attracting people from outside of the VB6 community
- People are already familiar with the << and >> symbols and what they mean. 

always "outside", and what "you" like.
so, VB6 need to adapt to you, because you are used to that.
and VB6 that u abandoned, now you want a TwinBasic.Net
you don't care about VB6 at all, you just want to have it your way.
of course you are calm, you are getting what you want.
a TwinBasic that is like .Net

the betrayal is that now I need to code like you want it,
and that for me is hurting, because that means, .Net won. we gonna go your way.

so, all the BS about making TwinBasic the next VB6 was all just talk.
it was just to lure the VB community into it to get support, for the ultimate needs are the outsiders, the .net people.
here u have a new tool to play with.

and you are advocating it. pleased with yourself that u won.

----------


## Niya

I wasn't there when Wayne put >> or += in the language. That had nothing to do with me.

If you want to talk about what I like, then lets talk about the Set statement. When I was testing TwinBASIC a few months ago, I advocated strongly for it's removal in this very thread because it clashed with generics and was causing a bunch of problems with some code I was writing. After some back and forth, it was decided by Wayne that Set cannot be removed without serious consequences to the bottom line of VB6 compatibility. I accepted that. I think the Set statement is utter garbage yet I didn't get what I want and I'm not losing sleep over it. It is what it is. 

Ultimately, this isn't about me. If it was about me, getting rid of Set would have been at the top of my list. It's the number #1 thing in my opinion that is hurting TwinBASIC language wise. If this were in my hands, I wouldn't care if removing it broke 1000 VB6 projects, it would have been gone gone gone. So don't assume so casually that TwinBASIC has everything I want. TwinBASIC is still more VB6 than anything else despite operators like += and >>.

----------


## Niya

Look at the comment section of this video:-
https://www.youtube.com/watch?v=vSSNYa_xYmo

I asked:-



> Quick question....Are unsigned integer types implemented in your compiler? Does your compiler have types like C's unsigned int?


This was my earliest interaction with Wayne. Look at what I asked about....unsigned types. I didn't even mention operators. 

In fact, here is another video where someone expressed similar views to you:-
https://www.youtube.com/watch?v=-mBxtFQxLNs

Here is the comment in question:-



> It looks good, but please don't add things like 'Value /= 4', that's not Basic.
> The idiocrasy of Basic is that it is a language understable by human, it is almost English. Allowing things like that undermines the language.
> You can say: well, if you don't like it, don't use it. But when people find this kind of code on internet, may be discouraged to learn the language because it will seem hard to understand. It makes the code less readable.
> I would think thoughtfully before adding new features and allowing new syntax, and I guess the original VB6 developers also did that way.
> Great work and I wish you best of success!!


To which Wayne replied:-



> Hi Juan,
> 
> Thanks very much for your opinions.
> 
> 
> My personal opinion is that assignment operators do have their place in the language.  As you've probably noted, we are adding several of the more useful features as found in VB.NET, and this is one of them.  
> 
> However, I can totally appreciate that from a "purist" perspective that having them in the language may be a little controversial.  
> 
> ...


I really had nothing to do with the new operators at all. I hadn't even thought about it until Zvoni brought it up earlier in this thread. I just have an opinion that happens to align with the decisions that were already made. Your fight is not with me.

----------


## mansellan

@Shaggy Hiker,

You've mentioned a few times that this thread is getting lenghty. Would you mind if I start reposting twinBASIC language proposals in this forum as new threads, prefixed with [twinBASIC]? I feel like there's some great discussion to be had here that's just not getting captured on the repo

----------


## Niya

I guess what I'm trying to say baka is that I'm the wrong target to take your wrath out on. My effect on TwinBASIC's development is very limited. I reported a bug and and there and made a couple suggestions. TwinBASIC would have still had what it has with or without me. I'm just giving my opinions but you guys have the actual power to steer TwinBASIC in whatever direction you want. Wayne is doing this for you guys, not for me.

If certain types of discussions come up, yea I will chime in sure but that's all it is, discussion. You can either agree or disagree. You guys need to speak up on what you want or don't want to the developers, not to me, if you want to see actual change.

----------


## mansellan

> The VB6 community has carried emotional baggage from the perceived betrayal by Microsoft because they abandoned VB6 for VB.Net. I kinda get it since I resisted for quite a while before I moved to VB6 but once I moved over, I got over it real fast. However, the people who didn't migrate have carried that hurt for decades now and those emotions bleed out in discussions like this.


That's understandable. Microsoft _did_ abandon VB6 for VB.Net, no question.

But now there's a way forward. 64-bit. Cross-platform without a VM. It's frankly incredible. But we're arguing over _operators_? Really?

----------


## Niya

> But now there's a way forward. 64-bit. Cross-platform without a VM. It's frankly incredible. But we're arguing over _operators_? Really?


Yea, I don't get it either but I can't say that I'm surprised. You just get used to it after a while.

----------


## mansellan

LeftShift
LShift
LeftS
Shl

None of these things are as readable to me as <<. And probably 99% of programmers out there.

These operators are _ubiquitous_. Nearly every other language out there uses them. Everyone else out there knows what they mean. It's not enough to say that "popularity doesn't mean correctness" or that they're not "BASIC-y" enough (despite other BASIC dialects adopting them). You have to explain why YOU are right and EVERYONE ELSE is wrong. If your argument is that VB6 didn't have them, that's insufficient.

Readability is subjective. BASICness is intangible. Explain why we should go your route.

----------


## Eduardo-

> @baka, @Eduardo, you both seem very angry, and I'm not sure why.
> 
> But I think I need to stop now.


I'm not angry. But Niya comes here after a week or two with arguments that have already been answered and discussed.
And he made reference to me, when he talked about the Pointers thread. That's why I had to come into, in a discussion that I considered I had nothing to add already.

Summarizing my position about the += operator, I feel it as un-basic. 
And it seems that I'm not alone in the opinion. Still, I'm not sure who is right or what is the best idea. I acknowledge the need of a new, shorter operator for making increments.
It is only that += seems too unnatural. 
Still, I don't have a better proposal, other than Inc VariableName 5 that doesn't seem too good either.

----------


## WaynePhillipsEA

Wow.  Just...  wow.

I can't believe this argument is still going on.  For those that feel so strongly that assignment operators (+= etc) shouldn't be in the language, or that << should be LShift or whatever, please come over to github and make the suggestion to remove or change them.  I can promise you, your voice will not be ignored!  It will be discussed, and then it will probably come down to a vote.




> so, TwinBasic is not the continuation of VB6,
> and why the h*ll do we need compatibility, transfer project etc? if in the end its created for the benefit of everyone else?
> TwinBasic need to get people from c, c++, c#, java, python and whatever. and why not just create the entire language into that and skip basic?
> no point using basic if the mission is to get c/c++ people here, and if they want to be comfortable, why not just use c/c++ language?
> 
> and why should c/c++ programmer even care if TwinBasic will be a b@stard of a language that they will hate.
> we know that c/c++ people usually sees basic as the kids language, something inferior, and crappy.
> so why should they spend time in twinbasic at all?
> 
> ...


I've always said that backwards compatibility is the number 1 priority with twinBASIC.  You simply have no idea the lengths that we have gone to, and continue to go to, to try to achieve 100% backwards compatibility, every single day... for every single decision we consider in detail the backwards compatibility aspect.   As has been said before, all new features added to the language are entirely optional and there is a planned 'Legacy mode' switch that will turn off every new feature and provide strict VB6 (/VBA7) language syntax whilst still allowing you to compile to 64-bit.

----------


## Niya

Well there you have it guys, from the main developer himself. Instead of biting my head off for my opinions, go over there and make big noise. Here is this link.

----------


## freeflow

The following makes interesting reading

https://codedocs.org/what-is/b-programming-language

extract




> Circa 1969, Ken Thompson[2] and later Dennis Ritchie[3] developed B basing it mainly on the BCPL language Thompson used in the Multics project. B was essentially the BCPL system stripped of any component Thompson felt he could do without in order to make it fit within the memory capacity of the minicomputers of the time. The BCPL to B transition also included changes made to suit Thompson's preferences (mostly along the lines of reducing the number of non-whitespace characters in a typical program).[2] Much of the typical ALGOL-like syntax of BCPL was rather heavily changed in this process. The assignment operator := changed to = and the equality operator = was replaced by ==.
> Thompson added "two-address assignment operators" using x =+ y syntax to add y to x (in C the operator is written +=). This syntax came from Douglas McIlroy's implementation of TMG, in which B's compiler was first implemented (and it came to TMG from ALGOL 68's x +:= y syntax).[2][4] Thompson went further by inventing the increment and decrement operators (++ and --). Their prefix or postfix position determines whether the value is taken before or after alteration of the operand. This innovation was not in the earliest versions of B. According to Dennis Ritchie, people often assumed that they were created for the auto-increment and auto-decrement address modes of the DEC PDP-11, but this is historically impossible as the machine didn't exist when B was first developed.[2]

----------


## baka

yeah, and since nowadays we don't have memory limits, we don't need to make compact programming.
I can understand that, if u have 4k memory, u can't do that much before its all filled up, u need to program in a way that will take as little memory possible.

----------


## PlausiblyDamp

> yeah, and since nowadays we don't have memory limits, we don't need to make compact programming.
> I can understand that, if u have 4k memory, u can't do that much before its all filled up, u need to program in a way that will take as little memory possible.


Compact language syntax and runtime memory usage aren't really related. Yes in early versions of c ++ and +1 mapped to different Cpu instructions but that hasn't been the case for decades. Any decent compiler would produce the same result regardless of language subtleties.

X += 1, x++, and x = x + 1 would all be treated the same in a decent compiler. The syntax is for the benefit of the programmer.

----------


## yereverluvinuncleber

I am a VB6er, almost dyed-in-the-wool. I have programmed in javascript and I am quite used to the C-style operators there. When I am programming in .js I tend to use the proper methods or the old BASIC style and it does not worry me one jot as to whether some other programmer, versed in B or C-style syntax, thinks that my code is rubbish. I easily intertwine both styles and as long as they both work in .js (and they mostly do) then I have been content.

That should work the other way around for me too. I will continue to use the BASIC operators even if others are available. With regard to >> and RSHIT(sic) - both would suit me fine but I doubt if I'd ever have the opportunity to use either.

----------


## baka

PlausiblyDamp that was my point.
that, its not important anymore, for decades, 
but the syntax is still here, that part didnt evolve when computers got more memory.

so my point is that using those abbreviations is not a "this is how you code", but "this is how they created the syntax in the first place to save space and you are still using it for compatibility"
and thats also my argument why Basic "don't" need to implement such things, we can use LShift without worries.

I ask myself. Do I want Basic to Evolve? To be a language that is onpar with c++? hell yeah I want that. but I also want the language itself, the syntax to evolve and show we can do it our way.
its not that "its not basic'ish" to use pointer or shift this and that, I want it to be "it is basic" to use pointers and shift that and the other, but we use our own words for it.

----------


## freeflow

You don't ever want to be like c++. BY all means have the same high level functionality as c++ but don't evolve the way c evolved to c++, to get not be trapped by being afraid to move on from syntax that is a hindrance, even if it means breaking changes.  If you'd like to see a path along which you might evolve VBA you could take some hints from the Nim programming language which has kindly done away with all those annoying 'end xxxx' as well as refraining from using the dreaded '{ code block} ' as well as allowing the very neat syntax sugar of allowing function( a,b,c) to be written as a.function(b,c) (and other variants)

----------


## jpbro

In case any one is interested in migrating an existing VB6 project to tB, I've posted my experiences here: https://www.vbforums.com/showthread....=1#post5550066. Hopefully it will help other tB newbies avoid some of the little bumps in the road I hit, but overall it was a surprisingly pleasant migration.

----------


## Niya

> In case any one is interested in migrating an existing VB6 project to tB, I've posted my experiences here: https://www.vbforums.com/showthread....=1#post5550066. Hopefully it will help other tB newbies avoid some of the little bumps in the road I hit, but overall it was a surprisingly pleasant migration.


Wayne did a very good job with TwinBASIC. It is as true a successor to VB6 as I've ever seen! Most non-UI VB6 code just works in TwinBASIC with little to no changes. Even entire libraries like Olaf's RichClient works.

----------


## Shaggy Hiker

> @Shaggy Hiker,
> 
> You've mentioned a few times that this thread is getting lenghty. Would you mind if I start reposting twinBASIC language proposals in this forum as new threads, prefixed with [twinBASIC]? I feel like there's some great discussion to be had here that's just not getting captured on the repo


That would be GREAT! There is no good reason why there is just ONE thread on TwinBasic. Having more threads, especially with that prefix, would show the interest that exists in the project. If there are enough threads like that, it might become it's own sub-forum. 

It is probably possible to have that prefix added to the set of prefixes. There are prefixes that can be used for Visual Studio, and there's the [RESOLVED] prefix, so it's a feature. That's not something that I can do, though, you'd have to ask Steve Jones.

----------


## Shaggy Hiker

I culled this thread, and perhaps a bit too excessively. I realize that people have strong opinions about this. I realize that people have strong opinions about other members of the forum. I have strong opinions, as well. However, this is a good thread. It will stay a good thread as long as people argue about the language and not about one another.

----------


## baka

well I will follow the mods decision...

anyway in Bit Manipulation #396 https://github.com/WaynePhillipsEA/t...iscussions/396

theres some discussion about c-operators. and specifically Left/Right Shift (for now)

- some enjoy the c-operators
- some think we should have a basic-variation
- some think if we add a basic-variation it will pollute

well, I don't think that way, but I posted that I was even willingly accept a compromise, if they don't want to have specific functions for basic,
the suggestion was a "container", example:

cOperator.LeftShift A,2
cOperator.RightShift A,2
cOperator.LeftShiftAssign A,2

that can be used instead of all the c-operators.
and that can be filled with all kinds of operation and math stuff.
at least its not that much "polluted", instead just 1 container that has multiple choices.

even so, I would still like 
LShift A,2
and maybe even
LShift A,2, True (for assignment) or A = LShift(A,2)

----------


## jpbro

> Wayne did a very good job with TwinBASIC. It is as true a successor to VB6 as I've ever seen! Most non-UI VB6 code just works in TwinBASIC with little to no changes. Even entire libraries like Olaf's RichClient works.


Yes he has done a great job, I'm very impressed so far. Certainly the most promising thing I've seen with regard to a future for existing VB6 code.

----------


## Niya

> LShift A,2


This is assembly language syntax. The SHL and SHR assembly instructions use this exact syntax. In other words, we are just replacing C syntax with assembly syntax. This is not BASIC.




> A = LShift(A,2)


This implies a function call. A bit shift operation at the machine code level is a single instruction but a function call is made up of several instructions. In fact let me show what it will look like at the machine code level. Assuming the standard calling convention and all data types and parameters are 32 bit integers, you will get this at the call site:-


```
push dword 2 ;; Push the value 2 onto the stack
push dword [ebp - 16] ;; Push A onto the stack
call [LShift] ;; Call the left shift function
```

This would be the LShift function:-


```
push ebp
mov ebp, esp

mov eax, [ebp + 8] ;; Copy first parameter into EAX register
mov ecx, [ebp + 12] ;; Copy the second parameter into the ECX register
shl eax, CL ;; Perform the left shift on EAX

mov esp, ebp
pop ebp
ret 8 ;; Clear the stack and return. Return value is in EAX
```

The above may not be 100% accurate but it's going to look something like that. That's 11 instructions for something that can be performed in 1 instruction.

Now you may be tempted to suggest that LShift be implemented as an intrinsic function however, this would also undermine the argument of keeping it BASIC. Intrinsic functions are a C thing. There are no true intrinsic functions in VB6 that I am aware of. Introducing intrinsic functions into TwinBASIC would make it more like C.




> cOperator.LeftShift A,2
> cOperator.RightShift A,2
> cOperator.LeftShiftAssign A,2


This is even worse because not only are we involving function call overhead, as shown above but a whole lot of extra stuff for handling method calls on objects(VTABLES, this pointers and whatnot). We could easily be looking at 20+ instructions just to perform a simple bit shift here.

----------


## Niya

However, let me throw you a bone. If you insist on not having >> or <<.....just replace those symbols with something wordy like what we have with NOT, AND, OR and MOD. That is the only way that makes sense and it is consistent with what is expected of BASIC.

----------


## baka

not really. u are not thinking carefully here.
a "compiler" can translate it into anything.

its not that what you code will be exactly that in native code.

so, if I write:

MakeShiftLeftTheBasicWay A, 2, False

the compiler can "translate that" to

A << 2

and go from there.

----------


## Shaggy Hiker

You're probably right that a compiler can do the right thing. Still, I think what Wayne suggested with the ability to toggle the feature on and off would make most people happiest. That would go against the wishes of those who feel it will pollute, but you can't have it all ways, and this way would be as many ways as possible.

After all, there are things in Basic that have been dragging on, and need to keep dragging on, despite most everybody realizing they aren't a good idea. Some of those ought to goto, but they won't.

----------


## Niya

> MakeShiftLeftTheBasicWay A, 2, False





> the compiler can "translate that" to
> A << 2


These two things are not the same. One is a function call syntax and the other is a binary operator. How would that clumsy syntax work when you have to do something like this:-


```
        Dim r, g, b As Byte
        Dim intColor As Integer

        r = 45
        g = 100
        b = 27

        intColor = b Or (CInt(g) << 8) Or (CInt(r) << 16) Or (&HFFI << 24)
```


Simple, effective and straight to the point.

Didn't Shaggy already warn us about veering off the actual discussion to throw insults? Let's be civil here. I have opinions, just like you do. We are just having a discussion about a programming language. This is nothing personal.

----------


## Niya

I think I'll pay a little visit to GitHub later. Give you something to really be vexed about.

----------


## Shaggy Hiker

Take the high road. Wayne has his hands full as it is. I can't imagine that he isn't dismayed by some of the arguing going on here.

This is why I feel no previous attempt at a replacement to VB6 ever went anywhere: The people who want it, want it VERY badly, but they all want something slightly different...and are willing to fight to the point of destruction for what they want. Eventually, the person(s) working on the alternative got fed up with intransigent demands and decided to go do something less vexing. 

I have an opinion on the operators, as well. I haven't shared it because it's not something I care about. Of the options suggested, I feel that LeftShift (or ShiftLeft) and << are the best alternatives (along with the right shift versions), but I don't care (my preference is one of those two alternatives). Every language has some anachronisms. C has case sensitivity, basic has Set and goto, and so on. We live with the quirks until they become endearing features. But I still don't care. If Wayne were to put it to a vote, I wouldn't vote because I don't care enough to attempt to influence the outcome by even that little bit. Let those who do care vote.

However, despite the passion people feel for the direction of a programming language, we need to be able to lose a fight graciously. If you can't do that, you end up in a debilitating, existential, battle over every little thing. Not only is that not good for either party, it's not good for TwinBasic in general.

----------


## yereverluvinuncleber

We'll take what TB and RB have to offer us. It is not a democracy but we are living in good times for VB6 and we should not forget it.

----------


## Eduardo-

> However, despite the passion people feel for the direction of a programming language, we need to be able to lose a fight graciously. If you can't do that, you end up in a debilitating, existential, battle over every little thing. Not only is that not good for either party, it's not good for TwinBasic in general.


I'm in that position. I said my opinion, that I acknowledge it is as biased as the opinion from any other person is, I made all the argumentation, and that's it.

I admit (to myself and here) that I could be wrong.
My point is that I don't want Basic to become jargon as I see in other languages.

About the << >> operators, those are rarely used anyway. These kind of operations are not needed frequently.

----------


## Eduardo-

> We'll take what TB and RB have to offer us. It is not a democracy


Also true, so why to take it too hard if you can't decide anything.

----------


## vbrad

> I've always said that backwards compatibility is the number 1 priority with twinBASIC.  You simply have no idea the lengths that we have gone to, and continue to go to, to try to achieve 100% backwards compatibility, every single day... for every single decision we consider in detail the backwards compatibility aspect.


Thank you Wayne, I'm very glad that this is the case. 
I want to be able to open my existing code in a living, evolving, language.
Whatever syntactical decisions are made there, I'm sure I can live with.

----------


## Shaggy Hiker

> My point is that I don't want Basic to become jargon as I see in other languages.
> 
> About the << >> operators, those are rarely used anyway. These kind of operations are not needed frequently.


I have that very complaint with the C family of syntaxes, and have made the point several times on this forum. My objection isn't so much readability as typability. Being a touch typist, getting to those symbol keys is pretty awkward. Interestingly, >> and << are an exception to this, since they happen to be above a pair of very accessible keys. I'd never really noticed that before, though. I really should like [] and {}, as they aren't so badly placed (the pinkie is a remarkably good typing finger), but I've never really liked them. I should prefer them to () and yet I don't. Funny thing, that.

I suppose it just goes to show that habits can be formed. My fingers know where the letters are, and where () are, but I have never formed a habit around most of the symbols on the number keys. 

You make a good point about bit shift operators being very rarely used. I really LIKE to use them, when I can, but it sure is a rare event. I've always appreciated how very fast the left and right shift operations are on the x86 architecture. It doesn't matter anymore, but it was mighty nice back in the early 90s. I had a quick approximation of the Pythagorean Theorem that used those. It wasn't totally accurate, but it was far faster than a couple multiplications, let alone a square root operation.

----------


## Arnoutdv

> Thank you Wayne, I'm very glad that this is the case. 
> I want to be able to open my existing code in a living, evolving, language.
> Whatever syntactical decisions are made there, I'm sure I can live with.


Same here!

----------


## freeflow

Just curious and for a bit of teasing




> These two things are not the same. One is a function call syntax and the other is a binary operator. How would that clumsy syntax work when you have to do something like this:-
> Code:
> 
> 
> ```
> Dim r, g, b As Byte
>         Dim intColor As Integer
> 
>         r = 45
> ...


By my reckoning that means intColor is b.  But preferably I'd want a compilation error for trying to Or a Byte and an Integer (which in VBA is 16 bits if I'm not mistaken, Long is 32 and long long is 64)

----------


## baka

he didnt dim it correctly

Dim r, g, b as Byte is actually Dim r as variant, g as variant, b as byte
and why do you make it byte, when u need it as integer and the result needs to be integer:

I would code it as:



```
Dim r%, g%, b%, intColor%

r = 45: g = 100: b = 27
intColor = b or (g << 8) or (r << 16) or (255% << 24)
```

----------


## Niya

Pay closer attention. That is VB.Net code, not VB6. 

VB6 doesn't have bit shift operators. Integers are 32 bits and Dim statements only require you to specify the type once for all variables declared in VB.Net.

----------


## Niya

> But preferably I'd want a compilation error for trying to Or a Byte and an Integer


That is a bit over zealous. A Byte aligns bitwise to the least significant byte of an Integer so it's a valid operation. But if you're paranoid, you can CInt it too to be explicit. The compiler does it implicitly without CInt.

----------


## Shaggy Hiker

I'm paranoid. I don't think I'd do either of those. I believe I'd use Color.FromARGB().

----------


## Niya

> I'm paranoid. I don't think I'd do either of those. I believe I'd use Color.FromARGB().


That does something different. Color.FromARGB converts an Integer to a Color structure. The code I posted is an example of how that Integer may be created in the first place. This is the full test code:-


```
        Dim r, g, b As Byte
        Dim intColor As Integer

        r = 45
        g = 100
        b = 27
        intColor = b Or (CInt(g) << 8) Or (CInt(r) << 16) Or (&HFFI << 24)

        Dim cl As Color = Color.FromArgb(intColor)

        Debug.WriteLine($"Color structure A = {cl.A.ToString} R = {cl.R.ToString} G = {cl.G.ToString} B = {cl.B.ToString}")
```

Output:-


```
Color structure A = 255 R = 45 G = 100 B = 27
```




> I would code it as:
> 
> 
> ```
> Dim r%, g%, b%, intColor%
> ```


You typically treat RGBA colour fields as 8 bit unsigned integers.

----------


## baka

https://github.com/WaynePhillipsEA/t...iscussions/396

----------


## wqweto

Notice that there is no vote to remove << and >> which is common-sense.

Of course I voted "NOT BOTHERED either way" as I don't mind weird BASIC operators/functions for which there is no equivalent operator in C/C++.

It's Wayne's chore now to implement NPV and PPmt functions down to the last dot and minus.

But who knows, in the next iteration of C++ language they might decide to use ¯\_(ツ)_/¯  operator for NPV equivalent :-))

cheers,
</wqw>

----------


## Niya

> Of course I voted "NOT BOTHERED either way" as I don't mind weird BASIC operators/functions for which there is no equivalent operator in C/C++.


I voted in opposition to adding them. It's just unnecessary noise in my view. I'd also add that having multiple operators that do the *exact* same thing in a programming language is just madness. No other language does this.

----------


## WaynePhillipsEA

Thanks everyone.   I do find this debate fascinating, and appreciate all those that have voted.




> It's Wayne's chore now to implement NPV and PPmt functions down to the last dot and minus.


All the financial functions are already implemented.  Feel free to test them though in case we missed any edge cases!

----------


## wqweto

> All the financial functions are already implemented.  Feel free to test them though in case we missed any edge cases!


+1 and LOL

Now that's sheer determination on getting 100% compatibility :-))

cheers,
</wqw>

----------


## VB6 Programming

> But who knows, in the next iteration of C++ language they might decide to use ¯\_(ツ)_/¯  operator for NPV equivalent :-))


I'll vote for a *¯\_(ツ)_/¯*  operator anyday  :Wink:

----------


## Shaggy Hiker

Isn't that just a RegEx string?

----------


## techgnome

> I voted in opposition to adding them. It's just unnecessary noise in my view. I'd also add that having multiple operators that do the *exact* same thing in a programming language is just madness. No other language does this.


Really? You sure about that? Count me the number of ways you can concatenate strings in VB.NET ....

-tg

----------


## Niya

> Really? You sure about that? Count me the number of ways you can concatenate strings in VB.NET ....
> 
> -tg


The + and & operators are not the same, they cannot be used interchangeably. You cannot add two numbers using the & operator. Having two operators that are aliases for each other is just insane and unnecessary bloat.

----------


## 2kaud

Isn't part of the problem is that there is no 'standard' for the Basic language? C/C++ are ISO standard(s), Fortran has it's standard. But what's Basic? I could 'invent' a new language and call it say zBasic and it could look quite different to existing versions of 'Basic' but still be called 'Basic'. I first came across this issue when I wrote Basic applications for mini-computers in the 1970's/80' and each version was different in some way. I don't program in Basic any more, but isn't it time that 'Basic' became a standard?

----------


## yereverluvinuncleber

> Isn't part of the problem is that there is no 'standard' for the Basic language? C/C++ are ISO standard(s), Fortran has it's standard. But what's Basic? I could 'invent' a new language and call it say zBasic and it could look quite different to existing versions of 'Basic' but still be called 'Basic'. I first came across this issue when I wrote Basic applications for mini-computers in the 1970's/80' and each version was different in some way. I don't program in Basic any more, but isn't it time that 'Basic' became a standard?


I am really for and against that idea, I proposed it earlier, my suggestion was a ECMA-style group that decided on the changes, direction for the language. However, given the characters here and the levels of opposition to almost anything proposed it might be a slanging match. 

However, with Wayne seemingly running the show as an intelligent, benign and benevolent dictator (no slur or criticism intended) we are probably in a good place, ie. he listens, he knows his stuff but ultimately we don't have much of a choice. It works.

With a properly constituted group - it requires recognition to work, I mean if we constituted a group, no-one has to listen, anyone could still do what they wanted. The "BASIC advisory board" might be the best we could come up with a voting method to decide things. That is roughly what we are creating here.

----------


## VB6 Programming

> However, with Wayne seemingly running the show as an intelligent, benign and benevolent dictator (no slur or criticism intended) we are probably in a good place, ie. he listens, he knows his stuff but ultimately we don't have much of a choice. It works.


I think Uncle Bert has got it right here.  We can all have our say, we can even vote, but Wayne decides.

----------


## Niya

> However, with Wayne seemingly running the show as an intelligent, benign and benevolent dictator (no slur or criticism intended) we are probably in a good place, ie. he listens, he knows his stuff but ultimately we don't have much of a choice. It works.


Lets not forget the most important quality of benevolent dictator.....the ability to say no. This would keep it from going off the rails into all kinds of wild and crazy territory. Trying to please everybody never works.

----------


## Niya

> Isn't part of the problem is that there is no 'standard' for the Basic language? C/C++ are ISO standard(s), Fortran has it's standard. But what's Basic? I could 'invent' a new language and call it say zBasic and it could look quite different to existing versions of 'Basic' but still be called 'Basic'. I first came across this issue when I wrote Basic applications for mini-computers in the 1970's/80' and each version was different in some way. I don't program in Basic any more, but isn't it time that 'Basic' became a standard?


Forgive me as I might be wrong here, but is it not true that anybody can submit something to be part of an ISO standard? If this is true then it's rather interesting that no one has done it for BASIC as of yet.

----------


## 2kaud

> Forgive me as I might be wrong here, but is it not true that anybody can submit something to be part of an ISO standard? If this is true then it's rather interesting that no one has done it for BASIC as of yet.


Yes - it needs to be done via your National Member. See https://isoupdate.com/resources/6-st...-iso-standard/


Hold the front page! Stop the Presses!!

There is an ANSI/ISO Basic standard - INCITS/ISO/IEC 10279-1991 (R2005)
https://www.iso.org/standard/18321.html
https://webstore.ansi.org/standards/...102791991r2005

However I don't know how useful these are due to their age. Perhaps those currently involved in Basic development might like to contact the ISO and find out what's happening re revision to the basic standard and how to contribute to its active development.

----------


## Niya

> There is an ANSI/ISO Basic standard - INCITS/ISO/IEC 10279-1991 (R2005)
> https://www.iso.org/standard/18321.html


Wow. This is the first I've seen of that. You always hear about C standards but never about this. Very interesting indeed.

----------


## Shaggy Hiker

I remember the standardization process for C++. It was about as contentious, though much drier, than the discussion around TwinBasic. Following that came the revision of the C standard in 1999. You need an active process to keep those standards evolving.

----------


## yereverluvinuncleber

or revolving in our case.

----------


## 2kaud

The Basic working group is WG8 under SC22 (C is WG14, C++ is WG21). Apparently, it is no longer active. See http://www.open-std.org/jtc1/sc22/

If anyone wants to pursue Basic standardisation, then I suggest in the first instance they contact the Chair of SC22 (which covers all computer languages) for information http://www.open-std.org/jtc1/sc22/docs/contacts

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update January 2, 2022

_Highlights include a feature to generate missing implementations, minor improvements to the Reference List UX, and some spirited debates._

----------


## Niya

Well based on the current state of the votes, it seems the language will remain unpolluted by the addition of aliases for the << and >> operators. So this issue has been resolved.

I know not everyone wanted this and I know a few people here have grown to hate me during this course of this conversation but I personally enjoyed the discussion. It was very enlightening. I just wish people wouldn't get so emotional. I also want you guys to know that despite your hatred for me, I hold no animosity in my heart towards any of you. I have no hate for baka or Eduardo. I respect you both but it doesn't mean I will just keel over and just agree with everything you say. I apologize if during the course of this I went too far but I do not apologize for my opinions and hopefully we can find a way to peacefully co-exist on these boards.

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update January 9, 2022

_Highlights include error messages that now match VBx, a twinBASIC Discord server, and a teaser about twinBASIC's potential as a VBA replacement._

----------


## georgekar

I would like to see lambda functions as I did in M2000 Interpreter:
https://georgekarras.blogspot.com/20...-in-m2000.html

Each "lambda" function is an object which have two parts: The function and the list of closures.
We can define closures at the definition stage for lambda, and that will be new or copies of variables of same scope at the definition.

Also tuple:  a=(1,2,3,4) like a=Array(1,2,3,4). The empty tuple: a=(,). One item tuple: a=(1,). We can use #functions like Print a#sum(). 
Also cons()
a=(1,2,3,4,5)
b=Cons(a, (6,7,8), a)
Print b

And car() and cdr()
a=((1,2), (3,4), (5, 6))
b=Car(a)
Print Car(b)  ' 1
Print Car(Car(a))   ' 1
Print Cdr(Car(Cdr(Cdr(a))))  ' 6

----------


## wqweto

Have you ever tried Common Lisp?

You have all of these requested features there unlike any BASIC language known to mankind :-))

cheers,
</wqw>

----------


## georgekar

So, CAR and CDR is property of LISP?
I think BASIC must go higher, including these which I propose in previous reply.

----------


## Niya

> You have all of these requested features there unlike any BASIC language known to mankind :-))


The term "prior art" is throw around lot at GitHub. There is such prior art in VB.Net for lambdas.

----------


## vbrad

As someone who's been wishing for a vb6 upgrade/replacement for well over a decade (not far off two actually) I really wish discussions about desired new features would just go away.
Until twinbasic can open all existing vb6 projects it's no more interesting to someone invested in vb6 than any other language.
I'm contributing to twinbasic, albeit only financially, but I'd prefer if people would leave Wayne to get on with the great job he's doing.
Once compatibility is achieved that's the time to start adding all the new goodies.

----------


## Niya

> As someone who's been wishing for a vb6 upgrade/replacement for well over a decade (not far off two actually) I really wish discussions about desired new features would just go away.
> Until twinbasic can open all existing vb6 projects it's no more interesting to someone invested in vb6 than any other language.
> I'm contributing to twinbasic, albeit only financially, but I'd prefer if people would leave Wayne to get on with the great job he's doing.
> Once compatibility is achieved that's the time to start adding all the new goodies.


Wayne already ready made it very clear that new features *must* be considered up front. If it's put off for later, it may be far more difficult to implement them. Here is the post. More specifically he said:-



> Many will argue that you can add new features later, but I can assure you: it's just not that easy!  The codebase for a compiler like twinBASIC is massive and complex; if you don't plan for features up-front at the start, the work to add them later is MUCH more involved (to the point where some new features might not even be possible without re-writing significant parts of the compiler).  With tB, a huge amount of effort has gone into designing an efficient and extensible compiler that has the capability to offer any of the features of more modern languages... if and when necessary.


There is no getting away from this.

----------


## 2kaud

> Wayne already ready made it very clear that new features *must* be considered up front. If it's put off for later, it may be far more difficult to implement them. Here is the post. More specifically he said:-
> 
> 
> There is no getting away from this.


As someone who previously has been involved with OS and compiler development, I absolutely agree with this. Time spent on the design is time well spent and will almost certainly be recouped during the coding phase. Major changes to the design once significant coding has been done often requires large amounts of code to be thrown away and re-written - delaying the project beyond the small extra design time that would have been spent.The more complex the project (like TB), the more the need for up-front in-depth design before much production coding is undertaken. Not doing this is, IMO, a recipe for disaster and often helps to explain why some projects get so far and then no further and peter-out.

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update January 16,2022

_Highlights include the CompileIf attribute and IsObject function for generics, an experimental package manager, and 10 Guiding Principles of twinBASIC._

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update January 23,2022

_Highlights include the introduction of TWINPACKs and the TWINSERV package manager, IntelliSense improvements, and easier reporting of twinBASIC bugs._

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update January 30,2022

_Highlights include a sample project demonstrating the WaynesGrid control and a timeline update for the release of (some) native Win32 controls._

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update February 6,2022

_Highlights include the milestone release of WinForms functionality, control inheritance, ReadOnly class properties, and twinPACK updating documentation._

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update February 13,2022

_Highlights include a new Settings filter bar and WinForms Controls Package updates included by default with future twinBASIC extension updates._

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update February 20,2022

_Highlights include checkbox-style list boxes, native Winforms progress bar and image controls, and an option to align controls to grid in the form designer._

The current twinBASIC version is 0.14.28

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update February 27,2022

_Highlights include multiple form designer improvements and a *BIG* announcement about the future of the twinBASIC IDE._

The current twinBASIC version is 0.14.36

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update March 6, 2022

_Highlights include a sneak peek at the new twinBASIC IDE (currently under development) and a brief comparison between RAD Basic and twinBASIC._

----------


## VB6 Programming

A sneak peek at the new twinBASIC IDE...

New twinBASIC IDE

A simpler and more VB6-like IDE - available soon  :Smilie: 

_twinBASIC programming just gets better and better_

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update March 13,2022

_Highlights include another sneak peek of the upcoming twinBASIC IDE and a special announcement regarding Access DevCon Vienna 2022._

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update March 20,2022

_Highlights include a cryptic update on the new IDE's release date and a possible twinBASIC solution to the oft-delayed Access modern browser control._

_And the new IDE?_ "Not long to wait now, hang on in there 😁"

----------


## Niya

I thought about posting this on the TwinBASIC GitHub but due to it's very informal and imprecise nature, I think here is the better place to post it.

A video just came across my recommended videos in YouTube:-
https://www.youtube.com/watch?v=qvFG8J7SUDE

Now the video itself is not what I'm trying to direct attention to. It's a very light hearted video meant perhaps to elicit some laughs. What really caught my attention was the comments. I spent about 30 minutes just reading the comments. The comments were mostly centered on JavaScript of course but there were also but there were a number of comments and mini-discussions on how it compares to other languages.

It reminded me of this thread and a couple over on GitHub, particularly our fierce debates on how to attract outsiders and how people would feel about specific features and what should be included and what shouldn't. Reading the comment section of that video was like waking the pulse of the body of expectations modern programmers have for programming languages. I think it would be valuable just to casually browse the comments it to see what modern programmers like and what they don't like. I found it enlightening. There were some things that that even surprised me.

----------


## VB6 Programming

New twinBASIC IDE...

New twinBASIC IDE demo

Not long to wait now  :Smilie: 


_twinBASIC programming just gets better and better_

----------


## VB6 Programming

The expected release date of the new twinBASIC IDE is *Tuesday 29th March*


New twinBASIC IDE demo

----------


## Niya

Cool.  :Wink:

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update March 27,2022

_Highlights include a release date for the twinBASIC IDE and plans to open-source the IDE's source code._

*The twinBASIC IDE is scheduled for release on Tuesday, March 29, 2022*

----------


## Niya

Whoa that was fast. How does Wayne do these things so quickly. I thought an IDE would have been at least a year away.

----------


## vbrad

> Whoa that was fast. How does Wayne do these things so quickly. I thought an IDE would have been at least a year away.


It's incredible! It really gives you hope that he has the ability to create the genuine successor for vb6.

----------


## VB6 Programming

For the early birds...   BETA 1 of the twinBASIC IDE is now available...

----------


## VB6 Programming

​*The new twinBASIC IDE is now available.*
_This is a custom-written twinBASIC IDE - not the VS Code IDE that was used previously.
_This is a more VB6-like IDE for twinBASIC programming.


_To install:_

*twinBASIC IDE LATEST BETA  is now available:* - See posts below for more details.
Download from here...   https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from the local folder.

If you're NOT using Windows 11, you might need to  download and install the WebView2 Runtime (32-bit). When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
Download it here:   https://tinyurl.com/twinbasicwebview2runtime
(in case of difficulty download from here https://developer.microsoft.com/en-u...wnload-section - you want "Evergreen Standalone Installer" > "x86")
Some products, like Office 365, now pre-install WebView2 for you, so you might not need this step. - See post #883 for more details.


Report any issues here https://github.com/WaynePhillipsEA/twinbasic/issues/772


See twinBASIC IDE for further details.

_The new IDE is a big step forward for twinBASIC programming. And now with ActiveX support in twinBASIC forms too._

----------


## SearchingDataOnly

It seems that the following links cannot be opened in China:
https://tinyurl.com/twinbasicwebview2runtime

Could you provide an alternative link? Thanks.

----------


## WaynePhillipsEA

> It seems that the following links cannot be opened in China:
> https://tinyurl.com/twinbasicwebview2runtime
> 
> Could you provide an alternative link? Thanks.


You might find that the WebView2 runtime is already installed on your machine.  It seems that it has come pre-installed with Office 365 for the last year or so, so many will already have it installed.   If you run the twinBASIC EXE (from the second link) and it does nothing, then it will be due to the missing WebView2 runtime.  If that's the case you can try to download it at the following alternative link: 

https://developer.microsoft.com/en-u...wnload-section
(you want "Evergreen Standalone Installer" > "x86")

----------


## WaynePhillipsEA

BETA 2 is now available:
https://www.twinbasic.com/downloads/...IDE_0.15.2.zip

Changes;
- improved: all panels are now resizable, and their states are restored when the IDE is reloaded
- improved: some minor theme tweaks
- improved: escape key will now cancel editing a variable value in the VARIABLES panel
- improved: after importing from a VBP file, the IMPORT_LOG.txt file is now opened automatically
- fixed: importing a VBP file would show duplicate entries in the PROJECT EXPLORER 
- fixed: DEBUG CONSOLE auto-scrolling sometimes got out-of-sync
- improved: debugging experience, with less code-editor flickering
- fixed: DEBUG CONSOLE not being able to access local variables from the debugged callframe
- fixed: compiler bug involving non-ANSI UDTs being passed ByVal to As Any arguments [FullValueRider]
- added: 'Ask before delete files' IDE option (default: true)

----------


## SearchingDataOnly

> You might find that the WebView2 runtime is already installed on your machine.  It seems that it has come pre-installed with Office 365 for the last year or so, so many will already have it installed.   If you run the twinBASIC EXE (from the second link) and it does nothing, then it will be due to the missing WebView2 runtime.  If that's the case you can try to download it at the following alternative link: 
> 
> https://developer.microsoft.com/en-u...wnload-section
> (you want "Evergreen Standalone Installer" > "x86")


After installing WebView2, twinBasic can run normally. Thank you, WaynePhillipsE.

----------


## SearchingDataOnly

> BETA 2 is now available:
> https://www.twinbasic.com/downloads/...IDE_0.15.2.zip
> 
> Changes;
> - improved: all panels are now resizable, and their states are restored when the IDE is reloaded
> - improved: some minor theme tweaks
> - improved: escape key will now cancel editing a variable value in the VARIABLES panel
> - improved: after importing from a VBP file, the IMPORT_LOG.txt file is now opened automatically
> - fixed: importing a VBP file would show duplicate entries in the PROJECT EXPLORER 
> ...


Very outstanding and amazing work.

----------


## jpbro

@SearchingDataOnly - I think the Run button is for running a procedure from a line of code where the caret (sic, cursor) is? Not sure because there is no tooltip, but there is such an button in the VS Code version. Try clicking the Round "Preview" button instead - it doesn't look like a button, which is a bit confusing.

----------


## SearchingDataOnly

> @SearchingDataOnly - I think the Run button is for running a procedure from a line of code where the caret (sic, cursor) is? Not sure because there is no tooltip, but there is such an button in the VS Code version. Try clicking the Round "Preview" button instead - it doesn't look like a button, which is a bit confusing.


Yes, you are right. Thank you jpbro

----------


## SearchingDataOnly

@WaynePhillipsEA:

In the process of testing, I found several phenomena:

(1) I dbl-clicked the Cmd button on MyForm, and the twinBasic smoothly entered the "Control1_Click" procedure in the code window. However, if I *dbl-click MyForm*, the twinBasic does not enter the code window, that is, does not enter the procedure related to the MyForm event. It seems that MyForm events can only be selected on the "Events" tab next to the properties window.

(2) "Save Project" cannot save newly created projects. However, after reopening twinBasic, in the "New-Samples-Recent" window, the Recent tab will still display the last saved "project name and path". If I open this "project name and path", twinBasic displays the following information:
(1) Error reading file
(2) bad file format: invalid header
(3) here 1 failed
Then, twinBasic stops working and goes into a long "Please Wait..." suspended state. Maybe it's just a copyright protection mechanism specific to the beta version.

(3) The *default names* of the controls on MyForm should not be "Control1", "Control2", "Control3", etc. It would be better if the default names could be the same as the VB6-controls.

----------


## WaynePhillipsEA

> @WaynePhillipsEA:
> 
> In the process of testing, I found several phenomena:
> 
> (1) I dbl-clicked the Cmd button on MyForm, and the twinBasic smoothly entered the "Control1_Click" procedure in the code window. However, if I *dbl-click MyForm*, the twinBasic does not enter the code window, that is, does not enter the procedure related to the MyForm event. It seems that MyForm events can only be selected on the "Events" tab next to the properties window.
> 
> (2) "Save Project" cannot save newly created projects. However, after reopening twinBasic, in the "New-Samples-Recent" window, the Recent tab will still display the last saved "project name and path". If I open this "project name and path", twinBasic displays the following information:
> (1) Error reading file
> (2) bad file format: invalid header
> ...


Thanks @SearchingDataOnly.   (1) and (3) are now fixed and will be included in BETA 3 coming later today.  I haven't been able to reproduce (2) yet.

----------


## WaynePhillipsEA

BETA 3 is now available:
https://www.twinbasic.com/downloads/...IDE_0.15.3.zip

- improved: IDE minimize/maximize/restore and window sizing/positioning is now allowed (some known resizing issues remain)
- fixed: double clicking on a form design was not opening the default event [VBF:SearchingDataOnly]
- improved: default names of newly added controls now match VBx [VBF:SearchingDataOnly]
- improved: added tooltips to the toolbar icons
- fixed: Ln/Col status bar text no longer visible if the code editor is not visible 
- added: FormBorderStyleConstants.vbSizableNoTitleBar enumeration (now used by the IDE)

----------


## WaynePhillipsEA

BETA 4 is now available:
https://www.twinbasic.com/downloads/...IDE_0.15.4.zip

- fixed: close button not at the very right edge of the window [jpbro]
- fixed: click again on a top-level menu should cancel it [jpbro]
- fixed: escape should cancel menus [jpbro]
- fixed: form designer context-menus not at expected position [aliensoftGB]
- fixed: switch between form/code not working [aliensoftGB]
- added property TextBox._Default [DefaultMember] [wopag]
- added property HScrollBar._Default [DefaultMember]
- added property VScrollBar._Default [DefaultMember]
- added property Timer._Default [DefaultMember]
- added property OptionButton._Default [DefaultMember]
- added property ListBox._Default [DefaultMember]
- added property Label._Default [DefaultMember]
- added property ComboBox._Default [DefaultMember]
- added property CheckBox._Default [DefaultMember]
- 'Standard EXE' is now the first and default entry in the initial project-selector dialog
- modal dialogs will now reposition upon IDE window resize, and will scale smaller if content won't fit
- fixed: StrComp handling of empty strings now matches VBx [ https://github.com/WaynePhillipsEA/twinbasic/issues/767 ]
- changed: rearranged the toolbar icons, in preparation of becoming context-aware

----------


## WaynePhillipsEA

BETA 5 is now available:
https://www.twinbasic.com/downloads/...IDE_0.15.5.zip

- fixed: resolution of UDTs problem, involving ordering of implicit ANSI<->UDT conversions, causing link-time failures [ https://github.com/WaynePhillipsEA/twinbasic/issues/777 ]     
- fixed: resetting the compiler doesn't reset the total error count
- improved: F12 key is now mapped to go-to definition

----------


## WaynePhillipsEA

BETA 6 is now available:
https://www.twinbasic.com/downloads/...IDE_0.15.6.zip

- improved: added IDE option of 'Restore State Of Code Editors On Opening Project'
- improved: added keybinding for CTRL+K: Comment Selection
- improved: added keybinding for SHIFT+CTRL+K: Uncomment Selection
- improved: added keybinding for SHIFT+CTRL+F: Find in files (project)
- fixed: Escape key not working in Find popup monaco dialog
- fixed: Enter key not working in Find popup monaco dialog
- improved: reduced the effect of the dimmed overlay when menus are visible
- improved: form designer control selector dropdown was glitching when focused
- fixed: problems with library references were not being reported
- fixed: unimplemented DAP message of "custom/buildUnregisterFailed" on DllUnregister failure
- added: experimental FULL SCREEN mode for the code/designer area, using F4 key to toggle

----------


## vbrad

I'm very impressed.
This makes it really easy for someone like me to try out twinbasic.
One downside of that is that it's possible for me to find bugs such as code doesn't work quite as expected.


```
 Private Sub Command1_Click() Handles Command1.Click
        If Me.BackColor = vbRed Then
        	Me.BackColor = vbBlue
        Else
            Me.BackColor = vbRed
        End If
    End Sub
```

----------


## WaynePhillipsEA

Thanks @vbrad, glad you like it.

That bug did get reported a few days ago.    It will be fixed in BETA 8 tomorrow, but here is a fix for now:



```
    Private Declare PtrSafe Function RedrawWindow Lib "user32" (ByVal hwnd As LongPtr, ByVal lprcUpdate As LongPtr, ByVal hrgnUpdate As LongPtr, ByVal fuRedraw As Long) As Long
    Private Sub Command1_Click() Handles Command1.Click
        If Me.BackColor = vbRed Then
        	Me.BackColor = vbBlue
        Else
            Me.BackColor = vbRed
        End If

        RedrawWindow Me.hWnd, 0, 0, RDW_ERASE Or RDW_INVALIDATE
    End Sub
```

----------


## vbrad

> Thanks @vbrad, glad you like it.
> 
> That bug did get reported a few days ago.    It will be fixed in BETA 8 tomorrow, but here is a fix for now:
> 
> 
> 
> ```
>     Private Declare PtrSafe Function RedrawWindow Lib "user32" (ByVal hwnd As LongPtr, ByVal lprcUpdate As LongPtr, ByVal hrgnUpdate As LongPtr, ByVal fuRedraw As Long) As Long
>     Private Sub Command1_Click() Handles Command1.Click
> ...


Thanks Wayne, you're a busy man!

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update April 3,2022

_Highlights include the release of the new IDE and an announcement about twinBASIC's role at the upcoming Access DevCon Vienna conference._

----------


## WaynePhillipsEA

BETA 7 is now available:
https://www.twinbasic.com/downloads/...IDE_0.15.7.zip

- added: project setting of 'Startup Object'
- changed: F5 key behaviour to match VBx, invoking the designated Startup Object
- changed: F6 key now executes the code under the cursor when in the code editor, or previews the active form in the form designer
- removed: MainModule from 'Standard EXE' project, as we no longer require the Sub Main bootstrap
- improved: full screen mode (F4) now includes a titlebar with min/max/close and exit full screen buttons
- improved: rearranged toolbar icons and added undo/redo buttons
- fixed: global variables were not always reset by the debugger when a debug session was terminated [ https://github.com/WaynePhillipsEA/twinbasic/issues/778 ]
- fixed: (WinNativeForms) Form.Refresh now includes the RDW_ERASE flag in call to RedrawWindow
- fixed: RaiseEvent argument validation too strict [ https://github.com/WaynePhillipsEA/twinbasic/issues/773 ]
- fixed: missing Optional attribute on ListBox.AddItem and CheckBox.AddItem from original VB6.OLB [ https://github.com/WaynePhillipsEA/twinbasic/issues/776 ]

----------


## vbrad

Great work, thanks

----------


## WaynePhillipsEA

BETA 8 is now available:
https://www.twinbasic.com/downloads/...IDE_0.15.8.zip

- fixed: undo/redo buttons on the toolbar were not properly visible with the LIGHT theme active
- fixed: regression, internal form Create event not firing, leading to Form.Load event being lost [EduardoVB]
- improved: tweaked the front page opening dialog
- added: IDE option of 'Focus The Recent Tab On IDE Startup' (default: false)
- improved: 'New Project' / 'Open Project' / 'Open Recent' / 'Close Project' menu options are now implemented

----------


## yokesee

very good work

----------


## WaynePhillipsEA

Thanks everyone.

BETA 9 is now available:
https://www.twinbasic.com/downloads/...IDE_0.15.9.zip

- fixed: the Save dialog before opening a new project now offers a 'Discard Changes' option [ https://github.com/WaynePhillipsEA/twinbasic/issues/786 ]
- improved: all modal dialogs now accept ESCAPE key to cancel or close
- improved: verbized modal dialog action buttons
- added: (WinNativeForms) Form.Unload event
- fixed: closing the IDE now checks the project dirty state and requests to save changes if necessary

----------


## SearchingDataOnly

@WaynePhillipsEA:

(1) About Save-Button:
- Open twinBasic, create a new project (Standard EXE)
- Click the "Save" button on the Toolbar, the twinBasic does not prompt to save the "new project"

(2) About Save-Proect:
- Create a new project (Standard EXE)
- Add a button to MyForm
- Click the close button in the upper right corner of the twinBasic main window, then twinBasic can't exit, the system prompts "SAVE PROJECT FAILED"

(3) twinBasic doesn't seem to support control-array.

(4) It's recommended to change MyForm to Form1, and change "This is MyForm" to "Form1"

----------


## WaynePhillipsEA

> @WaynePhillipsEA:
> 
> (1) About Save-Button:
> - Open twinBasic, create a new project (Standard EXE)
> - Click the "Save" button on the Toolbar, the twinBasic does not prompt to save the "new project"
> 
> (2) About Save-Proect:
> - Create a new project (Standard EXE)
> - Add a button to MyForm
> ...


Thanks...
1) Yes, that's a bug when there are no changes made to a new project.  I'll get that fixed.

2) I can't reproduce that, but I note that it you had an issue saving in earlier versions, so it is probably related to that.  After clicking the close button, we get prompted to save, and clicking the Save button results in the Save file dialog showing, and then save works and the window closes correctly here.  I haven't had any other reports of the save problem, so I'm not sure why that's not working for you at the moment.

3) Correct.  Forms-GUI support is still ongoing so there are some missing features.

4) Yes, this is planned and will probably be done in the next update.

----------


## WaynePhillipsEA

BETA 10 is now available:
https://www.twinbasic.com/downloads/...DE_0.15.10.zip

- added: IDE option of 'File Explorer: Single-Click Preview' (default: true)
- added: 'Run the code at the cursor position / Preview the form' toolbar button (running man) to match the F6 function key
- improved: 'Standard EXE' renamed form 'MyForm' to 'Form1' to match VBx
- fixed: clicking the Save toolbar button after creating a new project without making any changes did not prompt to save the project
- fixed: 'startup object' set to '(none)' not working correctly with F5/Start button
- fixed: 'startup object' set to 'Sub Main' not working correctly with F5/Start button
- fixed: 'startup object' will now use the PredeclaredId instance, if that attribute is set on the Form
- improved: error handling and notification around project file saving

----------


## SearchingDataOnly

@WaynePhillipsEA:

(1) When saving the project, if the project file already exists, twinBasic does not prompt "The project file already exists, do you want to overwrite it?"

(2) First place a Frame1 into Form1, and then place a CommandButton1 in Frame1. Then drag Frame1 with the mouse. At this time, CommandButton1 does not move with Frame1. That is, Frame1 did not become the container for CommandButton1.

----------


## WaynePhillipsEA

> @WaynePhillipsEA:
> 
> (1) When saving the project, if the project file already exists, twinBasic does not prompt "The project file already exists, do you want to overwrite it?"
> 
> (2) First place a Frame1 into Form1, and then place a CommandButton1 in Frame1. Then drag Frame1 with the mouse. At this time, CommandButton1 does not move with Frame1. That is, Frame1 did not become the container for CommandButton1.


Thanks.

1) I'll get that fixed.

2) Frame is not supported yet.  (the control exists, but the container functionality is not yet implemented).

----------


## yokesee

sometimes it happens to me.
The ide gets stuck in an infinite loop on the loading screen.
close with the task manager, the next times it is opened this window appears.

greetings and great job

----------


## WaynePhillipsEA

BETA 11 is now available:
https://www.twinbasic.com/downloads/...DE_0.15.11.zip

- fixed: Settings 'Startup Object' now doesn't show '(none)' option if the build type is 'Standard EXE'
- improved: Outline panel now offers filtering options via the ellipses button (filters: Class Fields/Module Variables/Enumerations/User Defined Types/DLL Declares/Constructors/Properties/Procedures/Variables/Parameters)

----------


## WaynePhillipsEA

BETA 12 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_12.zip

- added: Outline panel alphabetical sort option (via the ellipses menu)
- fixed: context menu position will now be repositioned if it extends past the bottom or right edge of the viewport

----------


## VB6 Programming

twinBASIC status update:

twinBASIC update April 10, 2022

_Highlights include 7 (!) new releases of the twinBASIC IDE and twinBASIC solving a difficult problem for a popular MS Access open-source addin._

----------


## SearchingDataOnly

@WaynePhillipsEA:

Three tiny imperfections:

(1) In design mode, the style of ComboBox is win10-style, but the style of ListBox is xp-style.

(2) In the code window, after entering "dim i as long", press the "Space-Bar", and then try to press the "Enter" key. But at this point, the system seems to prohibit pressing the "Enter" key.
(Note: In the VB6 code window, "Space-Bar" is a common key for selecting "drop-down list items")

(3) In the code window, after entering "dim sMsg as string", press the Enter key, at this time, the "*string*" becomes "*String*", and then press the "Enter key" again, the cursor moves to the next line. (That is to say, you need to press the Enter-key 2 times)

(Note: The VB6 code window only needs to press the "Enter key" once to achieve a similar effect, that is, automatically change "*dim sMsg as string*" to "*Dim sMsg As String*"

(4) It's recommended that the default size of Form1 is 450 * 360 or 360 * 360

----------


## SearchingDataOnly

The VB6 code input window has an excellent "input experience", which allows you to enter the fewest keys. For example: when you enter left-double-quotation mark, the system does not automatically display the second "double quotation mark". The purpose of this is to great benefit.

Take i = len("abc") as an example:
 In twinBasic, after entering *i = len(*, the system automatically displays *i = len()* After entering double quotes, the system displays *i= len("")* After entering abc, the system displays* i=len("abc")* At this point, we need to press the "right-arrow" key twice to move the cursor to the end of the line, and then press Enter again. This is very cumbersome and confusing. But I know other programming languages ​​are similar to twinBasic.


However, VB6's approach is better, that is, when you enter left-bracket, the system does not automatically display right-bracket, and when you enter left-double quotation-mark, the system does not automatically display the right-double quotation-mark, The purpose of doing so has great advantages:
 When the system does not automatically display the right-bracket and the second double quotation mark, the programmer will instinctively enter the double quotation mark and the right-bracket. without typing "right-arrow" twice When you enter *sMsg = "Hello World*, press the Enter key, the system will automatically complete the second double quotation mark and move the cursor to the next line. However, since twinBasic automatically displays the second double quotation mark, then We cannot press enter directly, we need to move the cursor to the end of the line and press enter again.

In fact, almost no modern code editor's "*code-input experience*" can reach the level of VB6-IDE. Even for vscode, the "*code-input experience*" when entering VB code is far from comparable to VB6. This is why I must develop my own Code-Editor. Hope twinBasic could do better than vscode.

*Edit:*
Many people think that the VB6 language is not as concise as the C-series languages, but they ignore several facts:
*Reading VB6 code consumes less brain power than other languages**Due to the excellent VB6-IDE, the number of keystrokes required to input VB6 code is far less than that of C-series languages*
.

----------


## techgnome

> The VB6 code input window has an excellent "input experience", which allows you to enter the fewest keys. For example: when you enter left-double-quotation mark, the system does not automatically display the second "double quotation mark". The purpose of this is to great benefit.
> 
> Take i = len("abc") as an example:
>  In twinBasic, after entering *i = len(*, the system automatically displays *i = len()* After entering double quotes, the system displays *i= len("")* After entering abc, the system displays* i=len("abc")* At this point, we need to press the "right-arrow" keyboard twice to move the cursor to the end of the line, and then press Enter again. This is very cumbersome and confusing. But I know other programming languages ​​are similar to twinBasic.
> 
> 
> However, VB6's approach is better, that is, when you enter left-bracket, the system does not automatically display right-bracket, and when you enter left-double quotation-mark, the system does not automatically display the right-double quotation-mark, The purpose of doing so has great advantages:
>  When the system does not automatically display the right-bracket and the second double quotation mark, the programmer will instinctively enter the double quotation mark and the right-bracket. without typing "right-arrow" twice When you enter *sMsg = "Hello World*, press the Enter key, the system will automatically complete the second double quotation mark and move the cursor to the next line. However, since twinBasic automatically displays the second double quotation mark, then We cannot press enter directly, we need to move the cursor to the end of the line and press enter again.
> 
> In fact, almost no modern code editor's "code input experience" can reach the level of VB6-IDE. Even for vscode, the "code input experience" when entering VB code is far from comparable to VB6. This is why I must develop my own Code-Editor. Hope twinBasic could do better than vscode.


On another hand ... I use an  IDE (IntelliJ) which works like this (and is intuitive to me) ... Using i = len("abc") as the example...
When I type "(" it auto adds the closing ")" for me... when I hit the double quotes, it auto adds the closing one for me as well: so now I have i = len("") with the cursor between the quotes. Since it's still habit, I enter abc and press the double quotes, and the closing parens... the IDE keeps track that it's already added it (or rather that the quote parens are already there, and so just moves the cursor on. Or I press End. 

It could also be an option... which I think is what IntelliJ does... offers it as an option that can be turned on/off... personally I like it... but I'm also often dealing with paren several levels deep sometimes, so... take it for what it is. 

-tg

----------


## SearchingDataOnly

> On another hand ... I use an  IDE (IntelliJ) which works like this (and is intuitive to me) ... Using i = len("abc") as the example...
> When I type "(" it auto adds the closing ")" for me... when I hit the double quotes, it auto adds the closing one for me as well: so now I have i = len("") with the cursor between the quotes. Since it's still habit, I enter abc and press the double quotes, and the closing parens... the IDE keeps track that it's already added it (or rather that the quote parens are already there, and so just moves the cursor on. Or I press End.


I've noticed the phenomenon you're talking about long ago, but I don't think that's reasonable, that is, not more reasonable (or user-friendly) than VB6-IDE.




> It could also be an option... which I think is what IntelliJ does... offers it as an option that can be turned on/off... personally I like it... but I'm also often dealing with paren several levels deep sometimes, so... take it for what it is.


Having one more option does no good other than adding to the hassle. Having different people develop different code-input habits doesn't bring the benefit of diversity.

----------


## OptionBase1

> Having one more option does no good other than adding to the hassle. Having different people develop different code-input habits doesn't bring the benefit of diversity.


Nonsense...but not surprising attitude.  In the West, options are a good thing.

----------


## Shaggy Hiker

VS now does some of that automatic addition of closing quotes and the like, and occasionally gets it wrong. I'm inclined to agree with your view, as I found the automatic addition to be jarring, at first. I believe I either started a thread on this, or replied to an existing thread about this, in the VB.NET forum. However, I was thinking about it the other day, and realized that I'm now quite indifferent to the feature. The muscle memory got corrected to the new behavior, and now I can take it or leave it. I can't say that I feel grateful for not having to type an extra key stroke, but if that extra stroke was typed for me, I no longer screw it up.

The bottom line for me is, while I agree with your point of view, I think what TG stated and what VS is now doing, shows that this is become a standard in IDE's, so it might be expected anymore. We might just be curmudgeons...and I'm okay with that.

----------


## SearchingDataOnly

This is a technical forum. But some people always seem to want to steer technical debates into other non-technical ones.

Of course, I'm not referring to Shaggy Hiker, I'm referring to another person who is obviously not a good programmer because he doesn't know when options are needed and when they are not. He would simply say "*In the West , options are a good thing*.

----------


## OptionBase1

> This is a technical forum. But some people always seem to want to steer technical debates into other non-technical ones.
> 
> Of course, I'm not referring to Shaggy Hiker, I'm referring to another person who is obviously not a good programmer because he doesn't know when options are needed and when they are not. He would simply say "*In the West , options are a good thing*.


Zing!

----------


## WaynePhillipsEA

BETA 13 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_13.zip

- improved: code-editor comboboxes are now implemented

----------


## WaynePhillipsEA

BETA 14 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_14.zip

- improved: much faster Debug Console printing speed

----------


## WaynePhillipsEA

BETA 15 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_15.zip

- fixed: IDE would become sluggish after a significant amount of debug console entries.  Debug Console now truncated to last 1000 entries
- improved: official Window title now synced to the project filename

----------


## WaynePhillipsEA

BETA 16 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_16.zip

- improved: further improvements to Debug Console performance

----------


## WaynePhillipsEA

BETA 17 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_17.zip

- improved: further significant performance improvements to the Debug Console

----------


## WaynePhillipsEA

BETA 19 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_19.zip

- fixed: after compiler restart, treeview selected node caches were not being refreshed
- fixed: resolver errors in constant expressions could cause compiler crash in some instances [ https://github.com/WaynePhillipsEA/twinbasic/issues/793 ]

----------


## WaynePhillipsEA

BETA 20 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_20.zip

- fixed: array parenthesis after the datatype symbol should not be allowed [ https://github.com/WaynePhillipsEA/twinbasic/issues/801 ] 
- fixed: semantic highlighting on interface symbols was not working
- fixed: EXE/DLL codegen invalid when involving late-bound calls to Collection members [ https://github.com/WaynePhillipsEA/twinbasic/issues/794 ]

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update April 16, 2022

_Highlights include multiple debug console performance improvements and a workaround for antivirus software flagging twinBASIC as potential malware._


The current version of the IDE is Beta 20
https://www.twinbasic.com/downloads/...DE_BETA_20.zip

The compiler version is 0.15.20

_The new twinBASIC IDE is a big step forward for twinBASIC programming._

----------


## WaynePhillipsEA

BETA 21 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_21.zip

- fixed: if WebView2 is not installed, an informative error message is now displayed on opening the IDE
- fixed: all default Monaco key bindings not working when F8 key was being used for debug stepping
- fixed: EXE/DLL codegen invalid when involving late-bound calls to Err members
- fixed: EXE/DLL codegen invalid when involving late-bound calls to PropertyBag members
- fixed: project-save sometimes left the project in an inconsistent state, requiring a restart of the compiler
- fixed: spurious 'circular reference' errors when editing a form design
- fixed: resizing a form in the form designer caused display glitches
- added: attribute [ COMControl ], and DllRegister support for it
- added: VBA.Compilation.CurrentComponentCLSID member
- added: Err.ReturnHRESULT member, useful for returning non-error HRESULTs
- added: shortcut key of F9 for toggling breakpoints
- added: new project type of 'ActiveX Control'
- updated: sample 4 (MyVBEAddIn) to demonstrate an ActiveX ToolWindow in the VBA IDE

----------


## Niya

Has the TwinBASIC IDE superseded Visual Studio Code as the primary way to write TwinBASIC applications as of yet?

----------


## WaynePhillipsEA

> Has the TwinBASIC IDE superseded Visual Studio Code as the primary way to write TwinBASIC applications as of yet?


Not quite yet.  Once we've got all of the main features implemented in the new IDE, it will take over as the primary IDE for sure.  We're still missing a few things like a test explorer, but day by day we're catching up.

----------


## WaynePhillipsEA

BETA 22 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_22.zip

- improved: initial WebView2 probe now allows upto 10 seconds before assuming an installation error
- fixed: removed the '222' debug messagebox when using some controls

----------


## yokesee

Good joob  :Smilie:  :Cool:

----------


## WaynePhillipsEA

BETA 23 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_23.zip

- fixed: attempting to load Sample 5 (MyCOMAddin) caused an 'unhandled error' message [ https://github.com/WaynePhillipsEA/t...ent-1107447869 ]
- fixed: default member recursion is now detected at the call site, and an appropriate error is produced [ https://github.com/WaynePhillipsEA/twinbasic/issues/807 ]
- fixed: IDE minimize/maximize/restore by toggling from the Windows taskbar now works as expected
- fixed: IDE window snapping with the Windows+Arrow keys now working as expected
- fixed: all samples and new projects now generate new GUIDs (for projectId and class CLSIDs) when first created
- fixed: 'ActiveX Control' project and 'Sample 4' tB image control had Stretch = False set on it

----------


## VB6 Programming

*twinBASIC status update:*

twinbasic update April 24,2022

_Highlights include updated samples for building custom VBIDE tool windows and custom ActiveX controls that you can drop on Access forms and reports._



Also see: HOW TO: Create a Custom ActiveX Control with twinBASIC

_Did you ever wish you could build a custom control for Microsoft Access forms and reports? With twinBASIC, that's a 15-minute project._

----------


## WaynePhillipsEA

BETA 24 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_24.zip

- added: [ DllExport ] attribute for standard module procedures, taking an optional string for overriding the exported symbol [ https://github.com/WaynePhillipsEA/twinbasic/issues/22 ]
- added: new Project Build Type of 'Standard DLL', when used in conjunction with [ DllExport ] allows creation of non-ActiveX dlls [ https://github.com/WaynePhillipsEA/twinbasic/issues/22 ]
- fixed: IDE compatibility with Win 7 64-bit [ https://github.com/WaynePhillipsEA/twinbasic/issues/774 ]
- improved: changing any IDE Settings now shows a warning that you need to save and restart the compiler
- improved: split the IDE executable into a small loader EXE with additional DLL
- fixed: IDE full screen mode was hiding some dialogs [ https://github.com/WaynePhillipsEA/t...ent-1108197888 ]
- fixed: Ctrl+S shortcut now saves the current document [ https://github.com/WaynePhillipsEA/t...ent-1101657369 ]
- improved: build errors now show in a red font in the debug console for extra emphasis

----------


## WaynePhillipsEA

BETA 25 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_25.zip

- fixed: triggering of Startup Objects in DLLs is now safe and matches VB6
- improved: the IDE now allows you to enter your licence key to unlock the 64-bit compiler
- added: 'Standard DLL' new project

----------


## WaynePhillipsEA

If you're interested in twinBASIC, and have tried out the new IDE, please vote on this issue:

SURVEY: Keep maintaining the VS Code Extension? (PLEASE VOTE)
https://github.com/WaynePhillipsEA/t...iscussions/813

----------


## WaynePhillipsEA

BETA 26 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_26.zip

- added: 'clean' build option for deregistering and deleting built files (via File>Clean menu, or trashcan icon in toolbar) [ https://github.com/WaynePhillipsEA/twinbasic/issues/811 ]
- fixed: setting [ COMCreatable (False) ] on a form could cause runtime errors [ bclothier ]
- added: built-run processes are now displayed in the IDE status bar, with 'bring to front' and 'terminate' options 
- added: 'Import File...' option to the 'Add' context menu.  Drag'n'drop from Win Explorer will later be supported.
- fixed: VBA.Interaction.Shell() now uses the CREATE_NEW_CONSOLE flag in the CreateProcess call [ https://github.com/WaynePhillipsEA/twinbasic/issues/812 ]
- improved: error handling and reporting of codegen errors that occur in Global variable initializers [ bclothier ]
- improved: deleting/renaming a linked twin/tbform/tbcontrol will now prompt to apply the operation to both documents

----------


## SearchingDataOnly

> If you're interested in twinBASIC, and have tried out the new IDE, please vote on this issue:
> 
> SURVEY: Keep maintaining the VS Code Extension? (PLEASE VOTE)
> https://github.com/WaynePhillipsEA/t...iscussions/813


I don't have a github account. So I post my views here:

Unless you have a dedicated team to maintain the VS-Code extension, stop maintaining it and focus more on improving the twinBasic and twinBasic-IDE.

----------


## VB6 Programming

From Github:

It's official. The twinBASIC VS Code extension has had it's last update for 2022.

Development of the twinBASIC VS Code extension is paused until 2023.




Development of the new twinBASIC IDE will now take priority.

https://github.com/WaynePhillipsEA/twinbasic/issues/772

----------


## VB6 Programming

_For those not on Github, here is the latest twinBASIC roadmap..._

*twinBASIC ROADMAP*
Dates given are tentative and subject to change. Only the major issues are listed here. Smaller feature requests will be implemented when most appropriate.


*2022-Q2 (APR-JUN)*
Add the WebView2 control, plus built-in high performance web-serverAllow to import VB6 forms and controlsAdd missing controls from WinNativeForms package, and finish all remaining basic controls, e.g. PictureBox, DirListBox, etc (Support for VB forms)Add the missing features to the new IDE, e.g. rename-refactoring and Test ExplorerFinish ActiveX control creation support (fix green in dev, fix other hosts support)Support use of third-party ActiveX controls in tB forms

*2022-Q3 (JUL-SEP)*
Complete the missing App object methodsSupport optimized builds, using the LLVM backend compiler (_only available to paid subscribers_)Start Analysis Extension APISupport full inheritance

*2022-Q4 (OCT-DEC)*
Add vbWatchdog supportAdd multi-threading syntax supportStart cross-platform support for x86/x64 Linux/Mac (_only available to paid Ultimate Edition subscribers_)

*2023-Q1 (JAN-MAR)*
Support Edit & ContinueStart cross-platform support for ARM Linux/Mac/Android (_only available to paid Ultimate Edition subscribers_)Start of reimplementation of all remaining VB6 shipped controls, such as Winsock, MAPI, Adodc, DataGrid, MSCOMM, etcSupport ActiveX controls on tB forms with unmatched bitness, using a proxy-process (e.g. 64-bit app using a 32-bit ActiveX control)

----------


## vbrad

> ...
> Start of reimplementation of all remaining VB6 shipped controls, such as Winsock, MAPI, Adodc, DataGrid, MSCOMM, etc


Is there an easily available list somewhere of these controls somewhere on the internet and are there any on that list that will not be reimplemented?

----------


## WaynePhillipsEA

BETA 27 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_27.zip

- added: SafeMode option in the win32/win64 build combobox to allow code fixing/recovery in crash situations
- fixed: handling of 'Next: Next' in the parser, preventing incorrect treatment as a line label [ https://github.com/WaynePhillipsEA/t...ent-1100211685 ]
- fixed: changing breakpoints during a debug session no longer triggers the bogus edit & continue reset [ https://github.com/WaynePhillipsEA/t...ent-1112134058 ]
- added: (experimental) 'Set Next Statement' (aka 'Jump To Line') support in the debugger through Ctrl+F9 or via context menu [ https://github.com/WaynePhillipsEA/twinbasic/issues/814 ]

----------


## Eduardo-

> Is there an easily available list somewhere of these controls somewhere on the internet


https://jeffpar.github.io/kbarchive/kb/194/Q194784/




> and are there any on that list that will not be reimplemented?


Possibly, my guess is that the most rares ones will be implemented if people (several) ask for them, and some probably never.

PS: I think for 32 bits you can still use the original OCXs, not need re-implementation.

----------


## vbrad

> https://jeffpar.github.io/kbarchive/kb/194/Q194784/
> 
> 
> 
> Possibly, my guess is that the most rares ones will be implemented if people (several) ask for them, and some probably never.
> 
> PS: I think for 32 bits you can still use the original OCXs, not need re-implementation.



Thanks very much Eduardo, that's a very long list. 
The only one that i use that's not on it is the dhtml editing control. 
I wonder where i got it from!

----------


## vbrad

> I think for 32 bits you can still use the original OCXs, not need re-implementation.


Cool.

----------


## OptionBase1

> Thanks very much Eduardo, that's a very long list. 
> The only one that i use that's not on it is the dhtml editing control. 
> I wonder where i got it from!


DHTMLED.ocx?  I believe it shipped with Windows (considered part of IE), starting in Windows 2000 I think, removed starting in Vista I think.  Could be wrong.

In case someone stumbles upon this thread in the future looking for a place to still get the DHTML Editing ActiveX control from, here is a link to still get it from the Wayback Machine:

https://web.archive.org/web/20141031...n.aspx?id=8956

----------


## VB6 Programming

> https://jeffpar.github.io/kbarchive/kb/194/Q194784/
> 
> I think for 32 bits you can still use the original OCXs, not need re-implementation.


You should also be able to use 32 bit OCXs in a 64 bit app...




> *2023-Q1 (JAN-MAR)*
> Support ActiveX controls on tB forms with unmatched bitness, using a proxy-process (e.g. 64-bit app using a 32-bit ActiveX control)

----------


## vbrad

> DHTMLED.ocx?  I believe it shipped with Windows (considered part of IE), starting in Windows 2000 I think, removed starting in Vista I think.  Could be wrong.
> 
> In case someone stumbles upon this thread in the future looking for a place to still get the DHTML Editing ActiveX control from, here is a link to still get it from the Wayback Machine:
> 
> https://web.archive.org/web/20141031...n.aspx?id=8956


Thanks, it's amazing that the wayback machine even stores the linked-to file .
For interest's sake I just uninstalled internet explorer and the dhtml edit control still worked fine. Maybe that's to be expected.
Never thought to try but will the webbrowser control still work with internet explorer gone?
I used to use it quite a bit but it was a memory leak iirc.
I switched to using webscraping using internet explorer and the htmlobject library but now thats' going to be gone shortly too.
Currently trying to switch to using the seleniumbasic with chrome

----------


## vbrad

> You should also be able to use 32 bit OCXs in a 64 bit app...


That'll be great!

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update DevCon 2022

_Links and resources from Mike Wolfe's talk at Access DevCon Vienna 2022,
 twinBASIC: Happy First Birthday!
_

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update May 1, 2022

_Highlights include Set Next Statement support, new code samples and templates, a roadmap update, and a 7-Zip VBA library written in twinBASIC.
_

----------


## WaynePhillipsEA

BETA 29 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_29.zip

- improved: IDE panel sections are now draggable to different dockable areas, and positions are persisted across sessions
- added: 'Font Size' IDE Option, currently not applied to the form-designer
- added: Err.LastHResult read-only property to represent the HRESULT from the last COM call made from the current stack frame [ https://github.com/WaynePhillipsEA/t...ent-1112860820 ] 
- improved: Err.ReturnHRESULT now changed to Err.ReturnHResult for consistency with LastHResult
- fixed: typo in WinNativeForms file name (CombBox.twin -> ComboBox.twin) [ https://github.com/WaynePhillipsEA/t...ent-1112546093 ]
- fixed: replaced mention of 'VS Code' with 'IDE' in Settings description [ https://github.com/WaynePhillipsEA/twinbasic/issues/816 ]
- fixed: renamed HellowWorld.twin in Sample 2 (GetIPAddresses)
- fixed: (regression) Project > References menu option was presenting an 'undefined' error
- fixed: Description attribute on members was not being output in the generated type library correctly [ https://github.com/WaynePhillipsEA/twinbasic/issues/822 ]
- fixed: missing error when fixed-array bounds range was negative and the lower bound was not supplied [ https://github.com/WaynePhillipsEA/twinbasic/issues/821 ]
- fixed: IDE not awakening from computer sleep mode [ https://github.com/WaynePhillipsEA/twinbasic/issues/819 ]

----------


## WaynePhillipsEA

BETA 30 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_30.zip

- fixed: sleep-awake cycling was leaving redundant compiler processes running [ https://github.com/WaynePhillipsEA/twinbasic/issues/819 ] 
- added: 'Invert Output Direction' option for the debug console, available via ellipses icon menu [ https://github.com/WaynePhillipsEA/twinbasic/issues/825 ]
- fixed: `DateAdd`, `DatePart` and `DateDiff` not working in compiled files (only working whilst debugging) [ https://github.com/WaynePhillipsEA/twinbasic/issues/827 ]
- added: project setting of 'Project: Export Path' [default: empty]
- added: project setting of 'Project: Export After Save' [default: false]
- added: project setting of 'Project: Export Verbose' [default: false]
- added: 'Export Project' File menu command (Ctrl+E shortcut) [ https://github.com/WaynePhillipsEA/t...ent-1114494260 ] 
- added: 'Import from folder' option in the new-project dialog [ https://github.com/WaynePhillipsEA/t...ent-1114494260 ] 
- improved: automatically fix \n line feeds to \r\n during project import
- improved: removed the restrictions from the root project folder, allowing for any custom files to be added [ https://github.com/WaynePhillipsEA/t...ent-1114822802 ]

----------


## WaynePhillipsEA

BETA 31 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_31.zip

- fixed: regression in BETA 30 that allowed the special root files and folders (e.g. Settings file) to be deleted
- improved: 'Export Path' setting now accepts placeholders such as "${SourcePath}\${ProjectName}"

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update May 8, 2022

_Highlights include version control-friendly improvements to the new IDE, an IDE Font Size setting, and a milestone for another VBx successor language, RAD Basic._

----------


## WaynePhillipsEA

BETA 32 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_32.zip

- added: WebView2Package, offering the new WebView2 control
- added: Sample 0, offering the first demo of the WebView2 control
- improved: StrConv now supports vbUTF8 and vbFromUTF8 enumeration values [ https://github.com/WaynePhillipsEA/t...ent-1018823414 ]
- fixed: Escape and Return keys not raising Key events in WinNativeForms::TextBox
- fixed: issue when trying to open a recent project that has since been moved or deleted [ https://github.com/WaynePhillipsEA/t...ent-1117609489 ]
- fixed: restarting the compiler would sometimes cause the active editor to lose error diagnostic markers
- fixed: Settings validation error when project name contained an underscore [ https://github.com/WaynePhillipsEA/twinbasic/issues/832 ]
- fixed: importing a VBP project with non-ASCII filenames problem [ https://github.com/WaynePhillipsEA/twinbasic/issues/830 ]
- fixed: saving of Settings when no export path was set [ https://github.com/WaynePhillipsEA/t...ent-1118628569 ]
- fixed: declared interfaces were generating psuedo coclasses in generated type libraries

More WebView2 examples and documentation coming tomorrow.

----------


## WaynePhillipsEA

BETA 33 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_33.zip

- improved: minor tweaks to parser and compiler to improve overall performance and latency [ https://github.com/WaynePhillipsEA/twinbasic/issues/833 ]
- improved: rendering of semantic highlighting is now on-demand rather than having an up-front performance penalty [ https://github.com/WaynePhillipsEA/twinbasic/issues/833 ]  
- fixed: enabling/disabling a breakpoint in a document could lead to semantic highlighting failing when next activating the document
- fixed: hovering over an interface gives information about the psuedo class that tB internally generates [ https://github.com/WaynePhillipsEA/t...ent-1122739013 ]
- fixed: closing the IDE after closing a project would wrongfully trigger a 'You've made changes...' dialog [ https://github.com/WaynePhillipsEA/t...ent-1123324278 ]

----------


## SearchingDataOnly

> ...
> ...
> and a milestone for another VBx successor language, RAD Basic.[/I]


I don't understand what you mean, could you explain in detail? Thanks !

----------


## WaynePhillipsEA

BETA 34 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_34.zip

- improved: Sample 0 (WebView2) with a form demonstrating Virtual Folder Mapping and some javascript integration

----------


## WaynePhillipsEA

BETA 35 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_35.zip

- improved: performance of treeview panel rendering in the IDE [ https://github.com/WaynePhillipsEA/twinbasic/issues/833 ]

----------


## WaynePhillipsEA

BETA 36 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_36.zip

- improved: Sample 0 (WebView2) with a form demonstrating how to integrate the Monaco editor into your application, and using 2 WebViews side-by-side
- fixed: adding an event from the form designer inserts into the wrong place if the form has no parameterless `Sub New` defined
- improved: for some wellknown filetypes, the IDE now provides syntax highlighting via the built-in monaco editor support (for javascript/typescript/html/css/json/xml/ini)
- fixed: (regression) execution of properties triggered from the locals/watches window should not allow errors to propagate to the IDE during debugging
- fixed: stepping through code that switches to another file could sometimes not bring the active line into view due to codeLens data not being ready
- fixed: codegen error for set-assignments on UDT array fields [ https://github.com/WaynePhillipsEA/twinbasic/issues/834 ]

----------


## WaynePhillipsEA

BETA 37 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_37.zip

- fixed: using Implements with a class that has a Friend member caused compiler instability during editing [jpbro]

----------


## WaynePhillipsEA

BETA 38 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_38.zip

- fixed: LoadRes* functions were broken in DLL builds
- fixed: generated ActiveX controls could not expose events to the host
- added: attribute [ EventInterfaceId("{GUID}") ] for controlling the generated source event interface GUID
- added: RaiseEventByName function in the VBA library (similar to CallByName)
- improved: WebView2 control now supports deferred events to circumvent the re-entrancy limitations of the WebView API
- added: Sample9.  ActiveX Control WebView2 + Monaco

----------


## VB6 Programming

*Mike Wolfe's Access DevCon 2022 Video Recording "twinBASIC Update"*


https://www.youtube.com/watch?v=y4DRAcdH9tg

There are demos of
[13:42] Installing the twinBASIC IDE[17:00] Creating a VBIDE tool window[23:24] Creating a COM add-in[29:04] Creating an ActiveX control[33:14] Importing a VB6 project (*.vbp file)

If you don't have time to watch the full 45-minute video, there are links to jump to the relevant section for each demo at https://nolongerset.com/devcon-2022-public-sessions/.

----------


## WaynePhillipsEA

BETA 39 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_39.zip

- fixed: input focus problem when switching back to the tb IDE [ https://github.com/WaynePhillipsEA/twinbasic/issues/840 ]
- fixed: error description/source/etc would sometimes be lost when errors are propagated back from a standard module procedure [ https://github.com/WaynePhillipsEA/t...ent-1126863981 ]
- fixed: method descriptions appearing as numbers in generated type libraries [ https://github.com/WaynePhillipsEA/twinbasic/issues/822 ]
- fixed: friend members leaking into implemented classes when using Implements-Via [ https://github.com/WaynePhillipsEA/twinbasic/issues/843 ]

----------


## WaynePhillipsEA

BETA 40 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_40.zip

- fixed: statements entered between an opening `Select Case` and before the first `Case` statement are now not allowed [ https://github.com/WaynePhillipsEA/twinbasic/issues/844 ]
- added: Global.LoadResIdList(resourceType) function, returning an array of names/ids contained within a resource folder, see examples in WebView2 samples (CopyResourcesFolderContentsToLocalPath function) 
- added: Screen object, currently only offering Fonts, and FontCount member
- fixed: IDE menu clicks vs mousedown/up behaviour [ https://github.com/WaynePhillipsEA/t...ent-1127692147 ]

----------


## techgnome

> fixed: statements entered between an opening `Select Case` and before the first `Case` statement are now not allowed


Does that include comments? Or only executable lines (which makes sense)?

-tg

----------


## WaynePhillipsEA

> Does that include comments? Or only executable lines (which makes sense)?
> 
> -tg


Yes, comments still allowed.

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update May 15, 2022

_Highlights include a modern browser control for Microsoft Access (yes, you read that right) and a spirited discussion regarding attribute syntax._

----------


## 2kaud

As I don't use Basic at all, I don't have any skin in this game. However IMO design by committee (or voting) is not good. Look no further than what happened to Fortran from v77 to v90 (and some of the C++ decisions)! IMO it's preferable to have a 'controlling mind' in charge of a development that considers all proposals but ultimately makes decisions.

----------


## Zvoni

> IMO it's preferable to have a 'controlling mind' in charge of a development that considers all proposals but ultimately makes decisions.


We already have that.
His name is Wayne Phillips....

----------


## techgnome

Yeah, in this case, Wayne takes input from people, but ultimately he gets to decide if something goes in or not, and if so, how. But, it is good to get some input from others based on how they might use it.

-tg

----------


## WaynePhillipsEA

Thanks for the feedback guys, much appreciated.


BETA 41 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_41.zip

- fixed: Date$ and Time$ now return the correct invariant formats (MM-DD-YYYY and HH:NN:SS) [ https://github.com/WaynePhillipsEA/twinbasic/issues/846 ]
- fixed: trying to cast an ActiveX control from the host container Object to the real type was failing [ https://github.com/WaynePhillipsEA/twinbasic/issues/848 ]
- fixed: ActiveX controls were exposing all internal members, e.g. the inner controls and inherited UserControl members [ https://github.com/WaynePhillipsEA/twinbasic/issues/849 ]
- fixed: the Save Project dialog now warns if you are about to overwrite an existing project file [ https://github.com/WaynePhillipsEA/twinbasic/issues/850 ]
- fixed: ReDim-Variant[ByRef] bug causing illegal SAFEARRAY initialization [ https://github.com/WaynePhillipsEA/twinbasic/issues/851 ] 
- improved: IDE recent projects list was cached at startup rather than being live
- improved: panel collapse toggling now requires clicking on the expand/collapse icon, not the whole title bar [ https://github.com/WaynePhillipsEA/t...ent-1130004050 ]

----------


## WaynePhillipsEA

BETA 42 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_42.zip

- fixed: passing an object-type array element to a ByRef parameter with an inexact matching type, caused an array lock to be left open [ https://github.com/WaynePhillipsEA/twinbasic/issues/855 ]
- top-level menu disappears when moving back to the top-level menu header [ https://github.com/WaynePhillipsEA/t...ent-1130158068 ]

----------


## Arnoutdv

@Wayne, this is first time I want to download the TwinBasic BETA.

I got this warning from the corporate virus scanner:



> The transferred file contained a virus and was therefore blocked.
> URL: https://twinbasic.com/downloads/twin...DE_BETA_42.zip
> Media Type: application/executable
> Virus Name: Artemis
> Full Filename: twinBASIC_IDE_BETA_42.zip|twinBASIC.exe

----------


## WaynePhillipsEA

@Arnoutdv, thanks for taking a look.

Unfortunately as we release so frequently, the files are often flagged as suspicious by anti-virus vendors since they are considered new/unseen.  I can assure you there's no virus or malware, but of course I appreciate that you might not have the ability to override your anti-virus in a corporate setting.

----------


## Arnoutdv

@Wayne, I'm 100% sure that indeed there is no virus in the ZIP/Executable. But as you already mentioned I can't proceed because of company policies.  So I'll have to wait until a release which doesn't raise a false positive

----------


## Niya

This is exactly why I stopped installing anti-Virus software on my PC years ago. It's Windows Defender and no more.

----------


## WaynePhillipsEA

BETA 43 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_43.zip

- fixed: Rnd() initial seed was not being set in built EXE/DLL files [ https://github.com/WaynePhillipsEA/twinbasic/issues/856 ]
- improved: global variables code-gen errors are to be ignored until the global variables get initialized [ https://github.com/WaynePhillipsEA/twinbasic/issues/852 ]
- fixed: global initializers/terminators not being executed in DLL builds [ jpbro ]

----------


## WaynePhillipsEA

BETA 44 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_44.zip

- fixed: For-Each handling of variant arrays that don't have the VARTYPE explicitly set on the SAFEARRAY [ https://github.com/WaynePhillipsEA/twinbasic/issues/860 ]
- fixed: Byref-Variant assignments involving arrays [ https://github.com/WaynePhillipsEA/twinbasic/issues/859 ]

----------


## WaynePhillipsEA

BETA 45 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_45.zip

- fixed: setting breakpoints is now more reliable
- fixed: Set-statement with LHS of byref-Variant pointing to an empty Variant was failing [ https://github.com/WaynePhillipsEA/t...ent-1132630645 ] 
- fixed: internal IUnknown methods of __QueryInterface/__AddRef/__Release etc sometimes showing in intellisense
- fixed: intellisense not showing base members of extended interfaces [ https://github.com/WaynePhillipsEA/t...ent-1122563243 ]
- fixed: code editor combo drop-down selecters now work correctly with extended interfaces [ https://github.com/WaynePhillipsEA/t...ent-1122563243 ]

----------


## techgnome

Two updates in 5 hours ... you're a beast Wayne ... 

Have you thought about going to a single release per day? I can't keep up...

-tg

----------


## peterst

> Two updates in 5 hours ... you're a beast Wayne ... 
> 
> Have you thought about going to a single release per day? I can't keep up...
> 
> -tg


CI/CD in real use?

----------


## techgnome

We use Ci/CD here, but only to our development branch/environs ... releasing to test and users is still on a daily/weekly schedule.... 

-tg

----------


## vbrad

For anyone else like me who did not understand the acronym, this is from wikipedia:

In software engineering, CI/CD or CICD is the combined practices of continuous integration (CI) and (more often) continuous delivery or (less often) continuous deployment (CD).

----------


## WaynePhillipsEA

> Have you thought about going to a single release per day? I can't keep up...

You don't need to install them all :-)    Usually, I do aim for one release per day, but sometimes I'll release ad-hoc if I've got a fix for a particular issue that someone is waiting on.


BETA 46 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_46.zip

- fixed: a form class being declared as Private causes linkage errors (runtime messages of 9508/9402) [ https://github.com/WaynePhillipsEA/twinbasic/issues/864 ]
- fixed: panels in the bottom vertical section shouldn't have collapse/expand toggle icons [ https://github.com/WaynePhillipsEA/t...ent-1133589694 ]
- improved: you can now click on empty space in a tree panel to focus the tree, allowing for keyboard entry
- fixed: intellisense issue where the enter key would not clear the intellisense window at the end of a line following a space and no selection

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update May 22, 2022

_Highlights include the beginnings of a Screen object, an updated Attribute syntax, and a reimagined ending to a Disney classic (yes, it's a bit off-topic)._

----------


## WaynePhillipsEA

BETA 47 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_47.zip

- fixed: static variables inside class modules being treated as if inside standard modules [ https://github.com/WaynePhillipsEA/twinbasic/issues/866 ]
- fixed: tooltips misplaced [ https://github.com/WaynePhillipsEA/twinbasic/issues/863 ]
- fixed: SaveProjectAs should save the open editors [ https://github.com/WaynePhillipsEA/twinbasic/issues/865 ]
- improved: IDE is now built using the current released version of the WebView2 tB control
- improved: IDE now detects WebView2 Runtime installation problems and prompts to install it if necessary
- improved: WebView2 samples now specifically demonstrate how to detect when WebView2 Runtime is not installed
- fixed: clean-build command won't create the output folder if it doesn't already exist [ https://github.com/WaynePhillipsEA/twinbasic/issues/868 ]

----------


## WaynePhillipsEA

BETA 48 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_48.zip

- added: Screen.Width / Screen.Height (back-compat, primary screen only)
- added: Screen.TwipsPerPixelX/Y (non-rounded, floating point value)
- added: Screen.ActiveForm (thread aware)
- added: Screen.ActiveControl (thread aware)
- added: Screen.MousePointer (thread aware)
- added: project setting 'project.versionComments' (and auto import from VBP)
- added: project setting 'project.versionCompanyName' (and auto import from VBP)
- added: project setting 'project.versionFileDescription' (and auto import from VBP)
- added: project setting 'project.versionLegalCopyright' (and auto import from VBP)
- added: project setting 'project.versionLegalTrademarks' (and auto import from VBP)
- added: project setting 'project.versionProductName' (and auto import from VBP)
- added: App.Comments
- added: App.CompanyName
- added: App.FileDescription
- added: App.LegalCopyright
- added: App.LegalTrademarks
- added: App.ProductName

----------


## WaynePhillipsEA

BETA 49 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_49.zip

- fixed: corrected the VERSIONINFO Build/Revision ordering [ https://github.com/WaynePhillipsEA/t...ent-1136307113 ]
- added: project setting 'project.versionAutoIncrement' (None|Revision|Build|Minor|Major, and auto import from VBP)
- added: buildPath/exportPath placeholders: ${VersionMajor}, ${VersionMinor}, ${VersionBuild}, ${VersionRevision}
- removed: RunAfterBuild project setting
- added: RunAfterBuild module procedure attribute, allowing for triggering procedure execution after successful build [ https://github.com/WaynePhillipsEA/twinbasic/issues/873 ]
- improved: runtime unhandled errors in generated EXEs/DLLs now provide the error number and description as per VBx [ https://github.com/WaynePhillipsEA/t...ent-1136997222 ]
- added: project setting 'Debugger: Runtime Command Line Arguments' [ https://github.com/WaynePhillipsEA/twinbasic/issues/877 ]
- fixed: DoEvents now returns the number of open forms [ https://github.com/WaynePhillipsEA/twinbasic/issues/876 ]
- fixed: regression with form control z-order not being reflected in the runtime form creation [ https://github.com/WaynePhillipsEA/t...ent-1137128648 ]

----------


## WaynePhillipsEA

BETA 50 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_50.zip

- improved: reordered the Revision/Build project settings to better match the VERSIONINFO output [ https://github.com/WaynePhillipsEA/t...ent-1137174044 ]
- fixed: TypeName / IUnknown-extended interfaces issue [ https://github.com/WaynePhillipsEA/twinbasic/issues/872 ]
- fixed: Form.Load event firing before the form constructor [ https://github.com/WaynePhillipsEA/twinbasic/issues/799 ]
- added: App.PrevInstance property

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update May 29, 2022

_Highlights include new build features, a good Exit Code discussion, and a multi-threaded twinBASIC proof of concept from Ben Clothier._

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update June 5, 2022

_Includes a sneak peek of the upcoming ActiveX Control Extender support in twinBASIC._

----------


## WaynePhillipsEA

BETA 51 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_51.zip

- added: experimental support for consuming ActiveX controls in twinBASIC forms
- improved: WinNativeForms control Top/Left/Width/Height are now settable at runtime and are kept in sync with anchoring and docking
- added: WinNativeForms control Move() method
- improved: Implements-Via now supports type library based coclasses
- improved: Implements-Via can now forward events by using `Implements WithEvents ...` syntax
- improved: using Generic classes from referenced packages is now possible
- improved: IsDesignMode property now moved to the SerializationInfo object so that the property is available earlier (needed for Ax)
- improved: ContainerHWND property now moved to the SerializationInfo object so that the property is available earlier (needed for Ax)
- fixed: TabStop control property-getter had inversed logic

----------


## WaynePhillipsEA

BETA 52 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_52.zip

- fixed: Implements-Via feature was not always correctly proxying procedures in dispinterfaces [https://github.com/WaynePhillipsEA/t...nt-1152507161]
- fixed: Implements-WithEvents-Via feature now allows for coclasses that do not expose any events, allowing for easier use in generics
- fixed: 'Client Site is unavailable' message box from some VB6 ActiveX controls during window destruction
- improved: window destruction sequence to try to avoid runtime errors of 9402/9403

----------


## Episcopal

Wayne you are a great baker, your dough goes very fast in the oven.

----------


## Shaggy Hiker

> Wayne you are a great baker, your dough goes very fast in the oven.


Are you just trying to get a rise out of him?

----------


## Episcopal

> Are you just trying to get a rise out of him?


Oh no..... it was just a relaxed moment.

What would I be???

----------


## yereverluvinuncleber

> Oh no..... it was just a relaxed moment.


(bread rises from dough)

----------


## Shaggy Hiker

Yes, you set up a pretty obvious pun. I'm not one to pass up such an opportunity. In fact, there were several possible replies that I considered. I liked that particular pun the best, though.

----------


## VB6 Programming

> Oh no..... it was just a relaxed moment.
> 
> What would I be???


It was just a half-baked joke.

----------


## VB6 Programming

> In fact, there were several possible replies that I considered. I liked that particular pun the best, though.


We knead to hear more of these jokes.  It's the yeast you can do.

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC update June 12, 2022

_Highlights include ActiveX control support on twinBASIC forms and a discussion about the (accidental?) interface constructor language feature._

----------


## Shaggy Hiker

Mine was just a rye comment, I didn't expect bread puns to flour.

----------


## yereverluvinuncleber

Please stop these bread jokes, they are offensive to me. My father was electrocuted in a bakery.

He trod on a bun and a currant shot up his leg.

----------


## VB6 Programming

Oh dough. That must have been hair raisin, a loaf changing experience. I guess you're not bready for these kneading-edge puns yet.

----------


## vbrad

I'm getting a cob on from these crusty jokes. Turnover it.

----------


## VB6 Programming

Bread puns never grow mould.

----------


## yereverluvinuncleber

Come on... use your loaf, please stop.

----------


## vbrad

Put it to bread now lads and get brack to work

----------


## VB6 Programming

I'm on a roll

----------


## VB6 Programming

These bread puns will soon all be toast.

----------


## Episcopal

Well then, I realize that they are putting a lot of yeast, there is a book that says to be careful with the yeast, because it can take all the dough.

Edit: Forget what I wrote...

----------


## VB6 Programming

Bread puns happen when you yeast expect them.

----------


## Episcopal

puns????

The translator googles me plus I don't understand the right words for what they really mean when used figuratively... be more explicit

----------


## VB6 Programming

A 'pun' is a joke where a word can have more than one meaning, or where a word sounds (a bit) like a different word.

'Yeast' is what makes bread rise (you may call it levedura or fermento?).
And it sounds like 'least'.

So "Bread puns happen when you *yeast* expect them" is a jokey way of saying "Bread jokes happen when you *least* expect them"

Or "These bread puns will soon all be toast."  Toast is bread that is has been grilled, often when it is getting old (you may call it torrada or brindar?), but it also means (in slang) 'doomed' or 'in trouble'. So it means "These bread jokes will soon all be doomed".

And "Are you just trying to get a rise out of him?" plays on two meanings of the word 'rise' - it can mean to get an angry reaction out of someone, but it also means dough 'rising' to twice its size.

'half-baked', 'knead' (need), 'rye' (wry), 'flour' (flower), 'loaf', 'roll' and other words are baking terms that can have other meanings or sound like other words.

----------


## WaynePhillipsEA

You guys knead help.   BETA 53 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_53.zip

- fixed: IStream::Stat implementation, causing crash in using some ActiveX controls
- fixed: support for CODEJOCK Xtreme ActiveX controls
- fixed: LBound/UBound not working if the value passed in is a Byref-Variant param [ https://github.com/WaynePhillipsEA/twinbasic/issues/887 ]
- improved: monaco error widget now auto-wraps long error descriptions [ https://github.com/WaynePhillipsEA/twinbasic/issues/885 ]
- improved: further improvements to Implements-Via support

----------


## techgnome

> You guys knead help.   BREADA 53 is now available:
> https://www.twinbasic.com/downloads/...DE_BETA_53.zip
> 
> - fixed: IStream::Stat implementation, causing crash in using some ActiveX controls
> - fixed: support for CODEJOCK Xtreme ActiveX controls
> - fixed: LBound/UBound not working if the value passed in is a Byref-Variant param [ https://github.com/WaynePhillipsEA/twinbasic/issues/887 ]
> - improved: monaco error widget now auto-wraps long error descriptions [ https://github.com/WaynePhillipsEA/twinbasic/issues/885 ]
> - improved: further improvements to Implements-Via support


FIFY...


-tg

----------


## Episcopal

I never meant to offend.... I just made the joke because the process was going too fast. I did not mean to offend.

Perhaps the translations by Google or difference in custom or culture, can generate a malaise.

----------


## Episcopal

There are places around here that people don't call each other sir or ma'am. Just call friend. I've noticed that around here on the forum that calling another friend seems to bring inconvenience ... as I said, they are variations of custom or culture.

----------


## Shaggy Hiker

> I never meant to offend.... I just made the joke because the process was going too fast. I did not mean to offend.
> 
> Perhaps the translations by Google or difference in custom or culture, can generate a malaise.


You didn't offend anybody. I think everybody is impressed with the speed and responsiveness with which Wayne is advancing this project.

----------


## VB6 Programming

> I never meant to offend.... I just made the joke because the process was going too fast. I did not mean to offend.
> 
> Perhaps the translations by Google or difference in custom or culture, can generate a malaise.


You did nothing wrong at all.  You certainly didn't offend anybody.

What you did with your joke was give us the opportunity to post more jokes (or more accurately 'puns' - which admittedly aren't always easy to understand, specially if you are using Google translate).

----------


## VB6 Programming

> Originally Posted by WaynePhillipsEA
> 
> 
> You guys knead help.   BREADA 53 is now available:
> https://www.twinbasic.com/downloads/...DE_BETA_53.zip
> 
> 
> FIFY...
> 
> ...


How long should I leave BREADA 53 to rise before installing it?

----------


## yereverluvinuncleber

The heat of emotion and the amount of labour here from Wayne, it's becoming toasty.

----------


## VB6 Programming

Mike Wolfe has an article showing how to Create an Office COM Add-in with twinBASIC


_Ever wish you could turn your VBA code into a COM add-in that would run in 32- AND 64-bit Office applications? It's easier than ever with twinBASIC._

https://nolongerset.com/create-com-a...ith-twinbasic/

----------


## WaynePhillipsEA

BETA 54 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_54.zip

- improved: ActiveX component can now show their custom property pages via the '(Custom)' property in the form designer
- fixed: ActiveX controls z-order issue [ https://github.com/WaynePhillipsEA/t...ent-1152911326 ]
- fixed: can't access Implements-Via proxy procedures inside a With block [ https://github.com/WaynePhillipsEA/t...ent-1152911326 ]
- added: new IDE setting of 'IDE: Data Execution Prevention (DEP)', defaults to ON (needs to be off for some components, like gif89)
- fixed: form Left/Top/Width/Height properties can now be set programmatically at runtime [ https://github.com/WaynePhillipsEA/t...ent-1152911326 ]

----------


## SearchingDataOnly

While I don't have time to carefully test the latest version of twinBasic right now, I look at this thread every day for updates. I've gotten into the habit of checking out the Other-Basic subforum, all because of twinBasic. Thank you, WaynePhillipsEA.

----------


## WaynePhillipsEA

> While I don't have time to carefully test the latest version of twinBasic right now, I look at this thread every day for updates. I've gotten into the habit of checking out the Other-Basic subforum, all because of twinBasic. Thank you, WaynePhillipsEA.


That's great SDO, all interest in tB is appreciated  :Smilie:

----------


## WaynePhillipsEA

BETA 55 is now available:
https://www.twinbasic.com/downloads/...DE_BETA_55.zip

- added: support for licensed ActiveX objects
- fixed: when adding new ActiveX controls to a form, the designer no longer shortens the generated names [ https://github.com/WaynePhillipsEA/t...ent-1156407273 ]
- fixed: Screen object was not always initialized when running through the IDE/debugger
- fixed: shadowing of members with Implements-Via [ https://github.com/WaynePhillipsEA/twinbasic/issues/894 ]
- improved: added 'ActiveX Properties...' context menu option for right-click on form designer Ax controls

----------


## WaynePhillipsEA

BETA 56 is now available:
https://github.com/WaynePhillipsEA/t...eases/tag/beta

- fixed: lots of issues with ActiveX property pages
- fixed: SSTAB Click event not firing [ https://github.com/WaynePhillipsEA/twinbasic/issues/905 ]
- improved: form designer mouse click events are now passed through to the ActiveX HWND, allowing some controls like SSTAB to change tabs from the designer [ https://github.com/WaynePhillipsEA/twinbasic/issues/905 ]
- fixed: default names of new controls now match VBx [ https://github.com/WaynePhillipsEA/twinbasic/issues/907 ]
- fixed: 'Control' data type was not exposed publicly [ https://github.com/WaynePhillipsEA/twinbasic/issues/912 ]

----------


## VB6 Programming

*Creating a Standard (non-ActiveX) DLL with twinBASIC*

Mike Wolfe has an article showing how to create a standard DLL using twinBASIC.

_With twinBASIC, you no longer need C++ to build a standard DLL. Call high-performance code from VBA without needing the Windows registry._

https://nolongerset.com/how-to-stand...ith-twinbasic/

----------


## Niya

> *Creating a Standard (non-ActiveX) DLL with twinBASIC*
> 
> Mike Wolfe has an article showing how to create a standard DLL using twinBASIC.
> 
> _With twinBASIC, you no longer need C++ to build a standard DLL. Call high-performance code from VBA without needing the Windows registry._
> 
> https://nolongerset.com/how-to-stand...ith-twinbasic/


Back in the day this is something I wanted badly in VB6. However, in hindsight it was a very good thing for me that VB6 didn't have it because if it did, I'd have never dared to learn C/C++. Then I would have never believed in myself enough to know that I could learn other languages besides BASIC. I grew up in BASIC, started when I was like 8 to 10 years old and before I ever wrote my first piece of C code, I was incapable of conceiving that I had the smarts to learn anything else. Non-BASIC languages scared me for the longest time until I wrote C code for the first time. Today I've familiarized myself with many languages including C, C++, C#, Python, Assembly, JavaScript, HTML, CSS etc. I'm far from being an expert in any of these but I'm no longer afraid of them and it all started with my first adventure into C.

Anyways, this feature is long overdue. The ability to create standard DLLs is something Visual Basic should have had a long time ago. It's a very good thing TwinBASIC has it because even in 2022 we still mostly have to rely on C to do this. It is nice to have another language that could do it.

----------


## VB6 Programming

> Back in the day this is something I wanted badly in VB6.


Yes, that's the main reason I learned C++, to fill in the gaps VB6 couldn't handle.
But it has been a few years since I did anything seriously with C++, I guess we did find ways of doing more with VB6.
Most of what I do now is in VB6 or JavaScript (plus HTML, CSS, SQL, etc.)

I'm down to my last VB.Net application now, and need to look at re-writing this as an Android app. It would be good to use twinBASIC for this but it doesn't look as though the timescales will fit - I don't expect an Android version of twinBASIC before this time next year. I'll probably have to look for an alternative approach.

----------


## VB6 Programming

A new twinBASIC IDE - BETA 57 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from the local folder.

----------


## VB6 Programming

A new twinBASIC IDE - BETA 58 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from the local folder.

----------


## VB6 Programming

*twinBASIC Status Update*

twinBASIC Update: June 19, 2022


_Highlights include improved support for 3rd-party ActiveX controls, a new location for tB IDE releases, and a discussion about where to put non-visual controls._

----------


## VB6 Programming

A new twinBASIC IDE - BETA 59 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from the local folder.

----------


## VB6 Programming

*Creating a Standard (non-ActiveX) DLL with twinBASIC*

Mike Wolfe has an article on How to Create a Standard (non-ActiveX) DLL with twinBASIC

_With twinBASIC, you no longer need C++ to build a standard DLL. Call high-performance code from VBA without needing the Windows registry._

https://nolongerset.com/how-to-stand...ith-twinbasic/

----------


## VB6 Programming

The latest twinBASIC IDE BETA is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

If you're NOT using Windows 11, you might need to download and install the WebView2 Runtime (32-bit). When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
Download it here: https://tinyurl.com/twinbasicwebview2runtime
(in case of difficulty download from here https://developer.microsoft.com/en-u...wnload-section - you want "Evergreen Standalone Installer" > "x86")
Some products, like Office 365, now pre-install WebView2 for you, so you might not need this step.

----------


## RDGMax

When you build the exe add the option to build to use a custom name.
-The builds run 50% slow that vb6

----------


## Zvoni

> Perhaps the translations by Google or difference in custom or culture, can generate a malaise.


Why did i just read "can generate a mayonnaise"......

----------


## VB6 Programming

> Why did i just read "can generate a mayonnaise"......


I decided not to make my own mayonnaise.
I didn't want to whisk it.

----------


## techgnome

> Why did i just read "can generate a mayonnaise"......





> I decided not to make my own mayonnaise.
> I didn't want to whisk it.


It'd be a Miracle to Whip it up...

-tg

----------


## vbrad

> I decided not to make my own mayonnaise.
> I didn't want to whisk it.


Would you risk it for a biscuit?

----------


## yereverluvinuncleber

I wasn't bready for a return to the food puns.

----------


## VB6 Programming

A new twinBASIC IDE - BETA 61 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest release
Download and Extract the ZIP file into a local folder
Then run the twinBASIC.exe from that local folder.

----------


## RDGMax

fantastic work
Add the option to make the final exe. where you can choose the exe name :wave:

----------


## VB6 Programming

A new twinBASIC IDE - BETA 62 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest release
Download and Extract the ZIP file into a local folder
Then run the twinBASIC.exe from that local folder.

----------


## fafalone

Had no idea TwinBasic was progressing so quick. Looking great!





> Back in the day this is something I wanted badly in VB6. However, in hindsight it was a very good thing for me that VB6 didn't have it because if it did, I'd have never dared to learn C/C++. Then I would have never believed in myself enough to know that I could learn other languages besides BASIC. I grew up in BASIC, started when I was like 8 to 10 years old and before I ever wrote my first piece of C code, I was incapable of conceiving that I had the smarts to learn anything else. Non-BASIC languages scared me for the longest time until I wrote C code for the first time. Today I've familiarized myself with many languages including C, C++, C#, Python, Assembly, JavaScript, HTML, CSS etc. I'm far from being an expert in any of these but I'm no longer afraid of them and it all started with my first adventure into C.
> 
> Anyways, this feature is long overdue. The ability to create standard DLLs is something Visual Basic should have had a long time ago. It's a very good thing TwinBASIC has it because even in 2022 we still mostly have to rely on C to do this. It is nice to have another language that could do it.


VB6 can absolutely make standard DLLs. It's a hack, but it's an old hack... earliest descriptions of how to modify the compilation instructions and addins to help go back to at least 2001 with vbAdvance. These days you even have The trick's method for creating multithreaded standard DLLs (here).

----------


## VB6 Programming

*twinBASIC status update*

_Highlights include container support, IDE bug fixes, and a modest request for a complete backward-compatible rewrite of MS Access in twinBASIC._

https://nolongerset.com/twinbasic-update-june-26-2022/

----------


## Niya

> Had no idea TwinBasic was progressing so quick. Looking great!
> 
> VB6 can absolutely make standard DLLs. It's a hack, but it's an old hack... earliest descriptions of how to modify the compilation instructions and addins to help go back to at least 2001 with vbAdvance. These days you even have The trick's method for creating multithreaded standard DLLs (here).


I was 100% aware of this even back then. Thing is though, scared as I might have been of C/C++, I felt it was just easier and far better to learn C than to learn these VB6 hacks that many times had a lot of limiting conditions. I have never ever had a favorable disposition towards hacking something to get it to do something it's not meant to do and I have this attitude with everything, not just with programming. The *only* time I'd ever choose that option is if there is no other option. It was the same with multi-threading. Even though I was not aware at the time that it was possible to write working multi-threaded code in VB6, I still would not have chosen to do that because there was another option, move to .Net which had exactly what I wanted no complicated hacks required. In fact the lack of an easy way to do multi-threading in VB6 was the final straw for me. It was the thing that moved me to finally abandon it.

----------


## vbrad

> *twinBASIC status update*
> 
> _Highlights include container support, IDE bug fixes, and a modest request for a complete backward-compatible rewrite of MS Access in twinBASIC._
> 
> https://nolongerset.com/twinbasic-update-june-26-2022/


Only last week playing around in tb I noticed that that the Frame Control could not host a group of option buttons and now this week it can!

----------


## VB6 Programming

A new twinBASIC IDE - BETA 63 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest release
Download and Extract the ZIP file into a local folder
Then run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

And another new twinBASIC IDE - BETA 64 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest release
Download and Extract the ZIP file into a local folder
Then run the twinBASIC.exe from that local folder.

----------


## RDGMax

Add auto update feature  :big yellow:

----------


## VB6 Programming

twinBASIC IDE - BETA 65 and BETA 66 now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest release
Download and Extract the ZIP file into a local folder
Then run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

*twinBASIC en Español*

Mike Wolfe's presentation on twinBASIC to the Spanish Access User Group is now available on YouTube.

https://nolongerset.com/twinbasic-en-espanol/

https://www.youtube.com/watch?v=z8UxHQUFQsk

----------


## VB6 Programming

A new twinBASIC IDE - BETA 67 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest release
Download and Extract the ZIP file into a local folder
Then run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

*twinBASIC status update*

_Highlights include added support for the VB6 `End` statement, shape controls, and double-click to change property values in the IDE._

https://nolongerset.com/twinbasic-update-july-3-2022/

----------


## VB6 Programming

A new twinBASIC IDE BETA 68 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.


_If you're NOT using Windows 11, you might need to download and install the WebView2 Runtime (32-bit). When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
Download it here: https://tinyurl.com/twinbasicwebview2runtime
(in case of difficulty download from here https://developer.microsoft.com/en-u...wnload-section - you want "Evergreen Standalone Installer" > "x86")
Some products, like Office 365, now pre-install WebView2 for you, so you might not need this step._

----------


## VB6 Programming

twinBASIC IDE BETA 69 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest release
Download and Extract the ZIP file into a local folder
Then run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

twinBASIC IDE BETA 70 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.


_If you're NOT using Windows 11, you might need to download and install the WebView2 Runtime (32-bit). When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
Download it here: https://tinyurl.com/twinbasicwebview2runtime
(in case of difficulty download from here https://developer.microsoft.com/en-u...wnload-section - you want "Evergreen Standalone Installer" > "x86")
Some products, like Office 365, now pre-install WebView2 for you, so you might not need this step._

----------


## VB6 Programming

*twinBASIC status update*

_Highlights include new shape controls, code-signed twinBASIC IDE and compiler executables, and twinBASIC's first appearance on HackerNews._

https://nolongerset.com/twinbasic-update-july-10-2022/

----------


## 2kaud

The developer.microsoft.com link in post #1064 above doesn't work.
"We are sorry, the page you requested cannot be found."

----------


## VB6 Programming

twinBASIC IDE BETA 71 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

If you're NOT using Windows 11, you might need to download and install the WebView2 Runtime (32-bit). When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
Download it here: https://tinyurl.com/twinbasicwebview2runtime
(in case of difficulty download from here https://developer.microsoft.com/en-u...wnload-section - you want "Evergreen Standalone Installer" > "x86")
Some products, like Office 365, now pre-install WebView2 for you, so you might not need this step.

----------


## VB6 Programming

> The developer.microsoft.com link in post #1064 above doesn't work.
> "We are sorry, the page you requested cannot be found."


Fixed now, thanks.

The link is https://developer.microsoft.com/en-u...wnload-section

----------


## VB6 Programming

*twinBASIC IDE BETA 73 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

*twinBASIC IDE BETA 74 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.


_If you're NOT using Windows 11, you might need to download and install the WebView2 Runtime (32-bit). When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
Download it here: https://tinyurl.com/twinbasicwebview2runtime
(in case of difficulty download from here https://developer.microsoft.com/en-u...wnload-section - you want "Evergreen Standalone Installer" > "x86")
Some products, like Office 365, now pre-install WebView2 for you, so you might not need this step.
_

----------


## VB6 Programming

*twinBASIC IDE BETA 75 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

_If you haven't installed twinBASIC before you will need the WebView2 Runtime.
When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
If you're using Windows 11 it should already be installed.
Some products, including Office 365, now pre-install WebView2 for you, so you might not need this step.
You can download and install the WebView2 Runtime (32-bit) here: https://tinyurl.com/twinbasicwebview2runtime_

----------


## VB6 Programming

*twinBASIC IDE BETA 76 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.


_If you haven't installed twinBASIC before you will need the WebView2 Runtime.
When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
If you're using Windows 11 it should already be installed.
Some products, including Office 365, now pre-install WebView2 for you, so you might not need this step.
You can download and install the WebView2 Runtime (32-bit) here: https://tinyurl.com/twinbasicwebview2runtime_

----------


## VB6 Programming

*twinBASIC IDE BETA 77 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.


_If you haven't installed twinBASIC before you will need the WebView2 Runtime.
When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
If you're using Windows 11 it should already be installed.
Some products, including Office 365, now pre-install WebView2 for you, so you might not need this step.
You can download and install the WebView2 Runtime (32-bit) here: https://tinyurl.com/twinbasicwebview2runtime
_

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: July 17, 2022

_Highlights include double-click to change form/control properties in the IDE, support for the Form.Show Modal argument, and a discussion about On Error Resume Next._

https://nolongerset.com/twinbasic-update-july-17-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 78 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.



_If you haven't installed twinBASIC before you will need the WebView2 Runtime.
When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
If you're using Windows 11 it should already be installed.
Some products, including Office 365, now pre-install WebView2 for you, so you might not need this step.
You can download and install the WebView2 Runtime (32-bit) here: https://tinyurl.com/twinbasicwebview2runtime
_

----------


## VB6 Programming

*twinBASIC IDE BETA 79 is now available*.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

How To's and other articles about the twinBASIC language...

https://nolongerset.com/tag/twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 80 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## fafalone

A few questions about support for some of the advanced stuff VB6 has been hacked to support or remain major limitations...

Are LongLong, LongPtr, and Decimal the only new var types? The lack of an unsigned 2- and 4-byte type has really been a point of pain with VB6.

Now it says it supports 100% compatibility with all the quirks... how are arrays going to work? Are they going to be SAFEARRAY behind the scenes; and if so, is there an exception to that like VB6 has for 1D arrays in UDTs, because that's really important for API calls. Any added support for variable-length standard arrays, which would be extremely useful for APIs and some COM interfaces?

Multithreading isn't supported yet? Does this mean that there's just no simplified built in language feature for it, or that the CreateThread API if we wanted to do it manually will lead to a crash?

Does native code with no runtime mean we can program in kernel mode? (It does in VB6, if you remove the runtime reference and don't do anything that needs it). What about standard DLLs?

----------


## Niya

I can answer at least some of these. I haven't really played around in TwinBASIC since my clock example and there have been a lot of changes since so I'll just talk about what I know for a fact.




> Are LongLong, LongPtr, and Decimal the only new var types?


I know for a fact there is a LongPtr type that adjusts to "bitness" of the binary. It works just like the IntPtr type in .Net. It's 32 bits wide in 32 bit binaries and 64 bits wide in 64 bit binaries. I don't know if there first class support for Decimal and I'm not 100% sure but I believe there is a LongLong type.




> Multithreading isn't supported yet?


Multithreaded is implemented but not yet supported by language features. That's how it was back when I was testing it heavily. I don't know if that has changed since then but based on a couple comments I saw in the GitHub recently, I don't the status of multi-threading support has changed. As I understand it, the meat and bones of it is fully there, there's just no way to access it from the language as of yet. My guess is the community has to decide exactly what an interface into this system should look like. I know from personal experience that when it comes to deciding how things should work, it can cause a lot of chaos. It's very hard to get everyone to agree on what the best way to do something is. I'm just speculating though. Perhaps Wayne himself will talk about this in more detail. I think he monitors this thread.




> What about standard DLLs?


I saw a recent update where it was stated that TwinBASIC can now build standard DLLs.




> Any added support for variable-length standard arrays, which would be extremely useful for APIs and some COM interfaces?


What do you mean by this? Like Redim Preserve?

----------


## fafalone

> I can answer at least some of these. I haven't really played around in TwinBASIC since my clock example and there have been a lot of changes since so I'll just talk about what I know for a fact.
> 
> 
> 
> I know for a fact there is a LongPtr type that adjusts to "bitness" of the binary. It works just like the IntPtr type in .Net. It's 32 bits wide in 32 bit binaries and 64 bits wide in 64 bit binaries. I don't know if there first class support for Decimal and I'm not 100% sure but I believe there is a LongLong type.
> 
> 
> 
> Multithreaded is implemented but not yet supported by language features. That's how it was back when I was testing it heavily. I don't know if that has changed since then but based on a couple comments I saw in the GitHub recently, I don't the status of multi-threading support has changed. As I understand it, the meat and bones of it is fully there, there's just no way to access it from the language as of yet. My guess is the community has to decide exactly what an interface into this system should look like. I know from personal experience that when it comes to deciding how things should work, it can cause a lot of chaos. It's very hard to get everyone to agree on what the best way to do something is. I'm just speculating though. Perhaps Wayne himself will talk about this in more detail. I think he monitors this thread.
> ...



Yeah a LongPtr that the compiler handles as either 4 or 8 bytes is fantastic; but I meant unsigned like ushort being 0-65535 instead of VB's Integer which is -32,768-32,767.

CreateThread is an API; and it supports calling APIs from what I've seen. So what happens when you call CreateThread to create a new thread? Because of the runtime, there's extremely little you can do in VB6 without elaborate hacks, even calling APIs from the new thread is only possible if they're in a TLB, because Declare statements are late-bound and handled by the runtime. And those hacks aren't going to work in TB because they call undocumented runtime APIs and play with VB exe headers.

For arrays, many APIs return or pass a variable sized array, but they're not a SAFEARRAY so you have to a) declare a sufficiently large buffer that is fixed size, or b) use CopyMemory from the address of a placeholder single variable.
Consider an API like TdhGetEventInformation; out of the outputs is a structure with the following member:
 EVENT_PROPERTY_INFO EventPropertyInfoArray[ANYSIZE_ARRAY];

Since VB uses a SAFEARRAY behind the scenes, but the API does not, you can't define the member as a variable length array. The number of EVENT_PROPERTY_INFO structures returned varies. So how do you call this API in VB6? You need to either figure out what the maximum possible is and pass a fixed length array, since VB makes an exception in that case and doesn't use a SAFEARRAY, e.g.



```
Private Type MyUDT
a As Long
b(0 to 3) As Long
```

behind the scenes, b is 16 contiguous bytes starting at VarPtr(MyUDT) + 4 and has a total size of 20 bytes, but


```
Private Type MyUDT
a As Long
b() As Long

Dim MyUDTVar As MyUDT
ReDim MyUDTVar.b(0 To 3)
```

has a total size of only 8 bytes; because b is a pointer to a SAFEARRAY, which contains *another* pointer, and that's where the 16 bytes of the array data are located. 

But the API is returning a regular array, so you'll wind up with gibberish or access violations if you try to use it with an API like TdhGetEventInformation.

So, you either figure out the maximum possible (which becomes a memory problem if it's large and called frequently), or instead of an array, just declare the member as a long, then since another parameter tells you the size, you can use CopyMemory to read that memory starting from the placeholder long.

----------


## fafalone

I downloaded the latest beta, multithreading works, at least as far as a simple hello world test. Haven't tested much yet, it worked from the IDE too but I didn't try debugging.



```
Class Form1
    Private Declare Function GetCurrentThreadId Lib "kernel32" () As Long

    Private Declare Function CreateThread Lib "kernel32" ( _
                            ByRef lpThreadAttributes As Any, _
                            ByVal dwStackSize As Long, _
                            ByVal lpStartAddress As LongPtr, _
                            ByRef lpParameter As Any, _
                            ByVal dwCreationFlags As Long, _
                            ByRef lpThreadId As Long) As LongPtr

    Private Declare Function WaitForSingleObject Lib "kernel32" ( _
                            ByVal hHandle As LongPtr, _
                            ByVal dwMilliseconds As Long) As Long
    Sub New()
    End Sub
    
    Private Sub Command1_Click() Handles Command1.Click
        Dim lTID As Long
        Dim lCurTID As Long
        Dim hThreadNew As LongPtr
        lCurTID = GetCurrentThreadId()
        hThreadNew = CreateThread(ByVal 0&, 0&, AddressOf TestThread, ByVal 0&, 0&, lTID)
        Label1.Caption = "Thread " & lCurTID & " is waiting on thread " & lTID
        Dim hr As Long
        hr = WaitForSingleObject(hThreadNew, 30000&)
        Label1.Caption = "Wait end code " & CStr(hr)
    End Sub
    Private Sub TestThread()
        MsgBox "Hello thread"
    End Sub
End Class
```

 :Big Grin: 


It does appear that TB replicates how arrays in UDTs function in providing a standard array in UDTs declared as fixed. I was excited when it allowed ReDim, but then it errored when trying to use the expanded array. So not sure how it will work with APIs, will have to test.

----------


## WaynePhillipsEA

Thanks for taking a look at tB, fafalone!  I've used your TaskDialog in the past, which was very useful.

Multithreading should work OK, but you're right that we haven't got integral language support for it yet.

The [GLOBALS] error is known about and can be ignored (and will be muted in the IDE soon).

If you create a UI based EXE with tB, the linker currently pulls in all the implementations for every control, even if they're not used.  All those implementations are written and compiled in tB, and so are currently compiled unoptimized until the optimizing compiler becomes available.  Unoptimized compiled code can be significantly larger than regular optimized code.  If you create a non-GUI based EXE, the final EXE size starts off tiny (about 8kb if I remember correctly).  The 'Hello World' sample is an example that doesn't use forms, and just a MsgBox.

----------


## WaynePhillipsEA

For the dynamic-sized contiguous arrays, I would suggest making a GitHub issue for it, citing a few API examples:
https://github.com/twinbasic/twinbasic

----------


## WaynePhillipsEA

To answer the other couple of questions;

Unsigned types are planned, see https://github.com/twinbasic/twinbasic/issues/81
Adding support for unsigned types is not particularly difficult, but writing the many thousands of tests to ensure they work properly in all scenarios is what will take some time.

Finally, yes, using tB generated code in kernel mode should be fine.

----------


## fafalone

Awesome.

----------


## fafalone

Oh a couple more questions; is there any automatic structure alignment? VB6 aligns at 4 bytes.

Fairly low priority, but I might make a feature request for an implementation of #pragma pack(n) too.

Also, for COM interfaces, can typelib-defined interfaces returning an HRESULT be implemented as functions, to return a value, rather than subs? Would save a ton of vtable swapping calls for where that's mandatory.

----------


## WaynePhillipsEA

Structure alignment is same as VBx.  I think having an attribute to allow overriding it would be useful, so that would be a good feature request.

For HRESULTs you might want to look at `Err.LastHResult` and `Err.ReturnHResult' new properties, so that you can read and manipulate the HRESULTs without needing to change definitions.

Also of note, is that you can completely define your interfaces directly in tB.  E.g.:


```
[ InterfaceId("12345678-1234-1234-1234-123456789123") ]
Interface ISomething Extends stdole.IUnknown
   Sub DoSomething()
End Interface
```

----------


## fafalone

Oh that's useful. 

Defining the interfaces in TB like that, they work the same way as in TLBs, i.e. I can get an IShellFolder from SHGetDesktopFolder as well as implement it in shell extensions? Is there support for creating them a la coclass, like define IFileDialog Extends stdole.IUnknown, IFileOpenDialog Extends IFileDialog, and have an equivalent to


```
[ uuid(DC1C5A9C-E88A-4dde-A5A1-60F82A20AEF7) ]
coclass FileOpenDialog {
	interface IFileOpenDialog;
}
```

somehow?

----------


## WaynePhillipsEA

Yes the interfaces defined in tB will match ones created in a type library.   

RE coclass;  Not at the moment, but again that's a good idea.

You should be able to do something like this (air code):


```
Function NewFileOpenDialog() As IFileOpenDialog
   Return CreateObject ("new:{DC1C5A9C-E88A-4dde-A5A1-60F82A20AEF7}")
End Function
```

----------


## fafalone

Ok, just one more question for now; you mentioned running in kernel mode shouldn't be an issue... how does one specify the necessary compiler flags? In VB6 the .vbp file can be modified with the undocumented


```
[VBCompiler]
LinkSwitches= /ENTRY:DriverEntry /SUBSYSTEM:NATIVE /FIXED:NO
```

----------


## WaynePhillipsEA

Ah sorry, I forgot that we've not exposed the SUBSYSTEM switch, and you need to override the entry point.  I'll get that added for an upcoming release.  (edit: not the next release as there's a few tests needed  :Wink:

----------


## fafalone

That would be fantastic. Perhaps something like a textbox in the compiler section to specify switches, to expose the functionality without spending tons of times making options to automatically create a rare project type.

----------


## fafalone

Oh one other question for that-- in VB6, API Declare statements are late-bound, handled by the runtime; except if in TLBs, so all APIs must go in typelibs for VB6 kernel mode drivers. Are they late bound in TB, and if so, does it at least follow the early-bound if in typelib model? btw, I added a formal feature request like the other items we discussed to track this.


And new question... self-subclassing in Forms, class modules, and UserControls... possible? I think so, without hacks-- I didn't even notice my multithreading test shouldn't have worked... TestThread was a private sub in a Form. I added a standard module, put a Public Sub TestThread in it, and the AddressOf operator supplied the address of the private one on the form. This is different behavior than VB6-- it will error with 'invalid use of addressof operator' if you use in on a private sub when there's no public one in a module or when there's a conflict.

I was able to use the public version, but I had to specify MyModule.TestThread. This is how I wish VB6 worked, but this will break compatibility-- but only on VB6 code that would cause an error. So I'm not sure whether this should be considered a bug. Especially since it keeps with the VB priority system, where it will call a Private Sub A in the Form before Public Sub A in a module if you don't specify.

Will test subclassing tomorrow.

Also-- I added a reference to my oleexp.tlb typelib, and noticed this:



That's one of many, many coclasses in oleexp... the difference with this one is that uses dispinterface and source keyword;



```
    [
        uuid(9BA05971-F6A8-11CF-A442-00A0C90A8F39), // CLSID_ShellFolderViewOC
        helpstring("Shell Folder View Events Router.")
    ]
    coclass ShellFolderViewOC
    {
        [default]         interface     IFolderViewOC;
        [default, source] dispinterface DShellFolderViewEvents;
    }
```

I'm not sure what to make of this. It might be a bug, especially since placing one on the form results in an error in ActiveXExtender.twin->PrepareOLEInterfaces (0x80004002 E_NOINTERFACE on Set Me.ClientObject_IViewObject = Me.ClientObject).

----------


## WaynePhillipsEA

For the API declares, I know that we not long ago started binding them at runtime like VB6 does.  I can't remember off the top of my head whether we excluded type library APIs from that change.  I will check that, and if not fix it, and I'll also introduce a project flag for allowing binding project declared APIs via the import table too (which is how we used to do it in earlier BETAs of tB).

Allowing AddressOf on class members is a new feature in tB.  Provided all 'good' (i.e. compile-able) code from VB6 works as expected in TB, we wouldn't classify what you describe as something that breaks backwards compatibility.  The only thing to be aware of with the AddressOf on class members, is that the generated stub functions are only valid whilst you keep the class instance alive, since the stubs contain weak references to the class instance.  This is usually fine, since you'll typically have the class instance itself do the teardown of the subclassing before being destroyed, and so the stub function would no longer be needed.

For the ShellFolderViewOC issue, it appears that the coclass has got the `Control` flag set on it (or at least it has in the registry entry), so tB is picking that up as an ActiveX control.

----------


## fafalone

How exactly does TB exe work behind the scenes-- does it really have dependencies? Because I created an empty project;



```
Module MyModule

	' add your procedures here
    Sub main()
    	
    End Sub
End Module
```

and that's it (I set sub main as the startup object).

In VB6, the only dependency of such an exe is msvbvm60.dll (which is then removed for drivers).

The TwinBasic version lists dependencies on comctl32.dll, ole32.dll, and kernel32.dll. I unchecked the default included COM Type Library/Active-X reference, and enabled native subsystem flag.

An empty standard DLL depends on those three plus advapi32, oleaut32, and user32.

Does it actually depend on these, or are they superfluous references that can be removed? A kernel mode driver cannot import from anything besides ntoskrnl.exe. So if those references are unavoidable, that would unfortunately prevent this.


self-subclassing does not appear to be practical as 'AddressOf on class members is limited to subs'... which severely limits it.

Will proceed with testing traditional subclassing though... I thought a fun test would be to port over my event tracer, since it's virtually all API and native code besides the basic form, and will put multithreading to the test as a lot is done in both threads and there's heavy use of critical sections.

----------


## WaynePhillipsEA

The default entry point in tB sets up COM and a few other bits, but once you're able to override the entry point, the linker won't pull in those dependencies, and so the import table will be initially empty.

Apologies, I'd forgotten about the Sub restriction on AddressOf class members.  I will open an issue for that, since it would make it much more useful to allow Functions.

I'm looking forward to seeing your event tracer in action  :Smilie:

----------


## fafalone

Going to post this here rather than spam new issues.

I got the Event Tracer working; due to the last issue, it needs to have the 'Override high dpi settings' option enabled, with Scaling performed by system. I kept a log of problems with missing features and bugs encountered during the process. The self-subclassing was replaced with standard subclassing. The multithreading module was replaced with a direct call to CreateThread. Noticed VarPtr supports use on arrays when replacing ArrPtr (VarPtr variation).
This first test was just making it as close as possible to the original. Next I'm going to go through and change all the necessary Long types to LongPtr and attempt an x64 compile. I used TB modules and copy pasted code, rather than import/use .bas modules.

Design time
(FEATURE NEEDED) -Lack of support for control arrays means OptionButton logic had to be coded manually
(FEATURE NEEDED) -The options to automatically space controls equally in VB6 are *huge* time savers when you're creating many controls, hopefully they're coming to TB.
(FEATURE NEEDED) -PictureBox (missing from TB) is quite often used as a container control; Image can't be, so is more important than meets the eye.
(FEATURE NEEDED) -CommandButton missing 'Default' property.
(FEATURE NEEDED) -TextBox missing Alignment option
(BUG) -Paste in properties does not work
(BUG)-Checkbox needs BS_MULTILINE and BS_VCENTER styles to match VB
(FEATURE NEEDED) -App object missing numerous items, even title
(FEATURE NEEDED) -No Form.ScaleWidth
(FEATURE NEEDED) -Extensive re-working needed to work around lack of practical self-subclass (too many things need to return values); many projects use these hacks so it's fairly important to support.

Compile note: Exe size is 268kb from VB6, 1460kb from TwinBasic.

Runtime
(BUG) -Visible lag on startup; controls are drawn one at a time, taking several seconds. This doesn't happen with VB6 exes, even projects with 10x as many controls on the form.
(BUG) -There is some kind of measurement/positioning problem. The top frames are 180px tall, the ListView is created as y=204px, but it's drawn halfway up the frame.
         Further investigation revealed, via GetClientRect, the top frames were in fact 270px, which matches the scale factor I'm using; however the manifest is not marking it DPI aware, so it should not be behaving this way; VB6 does not.
         It appears that Windows is not applying system default scaling, despite the exe not being marked DPI aware. Forcing system scaling via compatibility options resolves the issue, but produces a further bug: Frame fonts revert to the system fallback font.


Attachment removed, see final x64-compatible version at

[twinBASIC] x64-compatible port of Event Tracing for Windows File Activity Monitor

There's also the x86-only first test version in a comment, with the DPI issue manually corrected so you don't have to play with properties.

----------


## WaynePhillipsEA

Thanks @fafalone, I'm glad to hear you got it working.   Most of those issues/missing-features are known, some have GitHub issues, and thanks for opening those bug reports.  With regards the DPI, yes that is a known issue with tB currently calling SetProcessDpiAwareness in the form engine, instead of leaving it to the manifest.

The EXE size will be higher than VB6 due to the form engine and controls implementations all being included in the EXE, but once we've got the optimizing compiler enabled, the size will reduce probably by about 50%.

I'm hoping to give this a try tomorrow;  thanks for sharing.

----------


## VB6 Programming

twinBASIC IDE BETA 82 is now available.

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.



_If you haven't installed twinBASIC before you will need the WebView2 Runtime.
When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
If you're using Windows 11 it should already be installed.
Some products, including Office 365, now pre-install WebView2 for you, so you might not need this step.
You can download and install the WebView2 Runtime (32-bit) here: https://tinyurl.com/twinbasicwebview2runtime
(in case of difficulty download from here: https://developer.microsoft.com/en-u...wnload-section 
- you want "Evergreen Standalone Installer" > "x86")_

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC Update: July 24, 2022

_Highlights include implementation of the form Controls collection, initial publication of the twinBASIC Guiding Principles, and the potential to write device drivers with tB._

https://nolongerset.com/twinbasic-update-july-24-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 83 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

_If you haven't installed twinBASIC before you will need the WebView2 Runtime.
When you run the IDE it will show a message if the WebView2 Runtime isn't installed.
If you're using Windows 11 it should already be installed.
Some products, including Office 365, now pre-install WebView2 for you, so you might not need this step.
You can download and install the WebView2 Runtime (32-bit) here: https://tinyurl.com/twinbasicwebview2runtime_

----------


## fafalone

> added: project setting of 'Override Entry Point (ADVANCED)' for overriding the DLL entry point in kernel mode builds.
> added: project setting of 'Runtime Binding Of DLL Declares (ADVANCED)' to allow binding DLL declares through the IAT
> improved: when 'Native Subsystem' project setting is enabled, the linker will report any DLL imports that are not to the NTOSKRNL dll during building


Sweet. This will be fun.

----------


## VB6 Programming

*twinBASIC IDE BETA 84 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

*twinBASIC IDE BETA 85 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

*twinBASIC IDE BETA 86 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## fafalone

[twinBASIC] x64-compatible port of Event Tracing for Windows File Activity Monitor

 :Big Grin:

----------


## VB6 Programming

> [twinBASIC] x64-compatible port of Event Tracing for Windows File Activity Monitor


Very impressive that you have migrated VBEventTrace to twinBASIC  :Big Grin: 

It does look like at last we have a successor to VB6  :Smilie:

----------


## VB6 Programming

*twinBASIC IDE BETA 87 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## VB6 Programming

*twinBASIC IDE BETA 88 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## Shaggy Hiker

> Going to post this here rather than spam new issues.
> 
> I got the Event Tracer working; due to the last issue, it needs to have the 'Override high dpi settings' option enabled, with Scaling performed by system. I kept a log of problems with missing features and bugs encountered during the process. The self-subclassing was replaced with standard subclassing. The multithreading module was replaced with a direct call to CreateThread. Noticed VarPtr supports use on arrays when replacing ArrPtr (VarPtr variation).
> This first test was just making it as close as possible to the original. Next I'm going to go through and change all the necessary Long types to LongPtr and attempt an x64 compile. I used TB modules and copy pasted code, rather than import/use .bas modules.
> 
> Design time
> (FEATURE NEEDED) -Lack of support for control arrays means OptionButton logic had to be coded manually
> (FEATURE NEEDED) -The options to automatically space controls equally in VB6 are *huge* time savers when you're creating many controls, hopefully they're coming to TB.
> (FEATURE NEEDED) -PictureBox (missing from TB) is quite often used as a container control; Image can't be, so is more important than meets the eye.
> ...


This seems like an excellent item for a new thread. I'd like to see multiple threads going on TwinBasic in the Other Basic forum. We could start with a prefix for [TwinBasic] (people can do that manually, for now). If there was enough interest, as it seems like there ought to be, improvements to that approach could be made. My point to all this is to show more 'chatter' around the subject. Just a suggestion, though. People can do as they feel like on this.

----------


## Niya

> If there was enough interest, as it seems like there ought to be, improvements to that approach could be made. My point to all this is to show more 'chatter' around the subject.


Oh it's picking up steam. I've been seeing a lot of "new faces" over at TwinBASIC's GitHub page. Most of the discussion is over there.

----------


## VB6 Programming

> Oh it's picking up steam. I've been seeing a lot of "new faces" over at TwinBASIC's GitHub page. Most of the discussion is over there.


And on Discord too. There is certainly a lot of interest.

----------


## VB6 Programming

*twinBASIC IDE BETA 89 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.

----------


## fafalone

People should post more in the CodeBank too. I think a lot of people would be interested if they saw just how far along tB is... showing off complex code samples would help that.

----------


## camomille

Here is the progress of my project in Tb without modification compared to VB6 (except adaptation for the lacks).
Main lack: picturebox, image on buttons, indexed objects (Labels, TextBox), scaling.
But I'm patient, Wayne is a rocket ship.

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: July 31, 2022

_Highlights include improved support for building device drivers, initial support for keyboard menu navigation, and a milestone for the twinBASIC project._

https://nolongerset.com/twinbasic-update-july-31-2022/

----------


## VB6 Programming

*How To's and other articles about the twinBASIC language...*

https://nolongerset.com/tag/twinbasic/

----------


## Niya

> *How To's and other articles about the twinBASIC language...*
> 
> https://nolongerset.com/tag/twinbasic/


I was just reading this page, and I realized something I didn't even think of before. I've known from the start TwinBASIC didn't have a runtime like VB6 but I never really thought about what that meant until now. Where does TwinBASIC get functions like Len/LenB, AscW, VarPtr etc from? I cannot believe I have never thought to ask that until now.

----------


## VB6 Programming

*twinBASIC IDE BETA 90 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder. :Confused:

----------


## WaynePhillipsEA

> I was just reading this page, and I realized something I didn't even think of before. I've known from the start TwinBASIC didn't have a runtime like VB6 but I never really thought about what that meant until now. Where does TwinBASIC get functions like Len/LenB, AscW, VarPtr etc from? I cannot believe I have never thought to ask that until now.


Our implementations of the runtime functions get linked in as necessary.  So if you make a call to MsgBox for example, your compiled EXE will include our implementation of MsgBox linked in to it just like an ordinary basic Sub/Function.

----------


## Niya

> Our implementations of the runtime functions get linked in as necessary.  So if you make a call to MsgBox for example, your compiled EXE will include our implementation of MsgBox linked in to it just like an ordinary basic Sub/Function.


Ah ok. Where does it get the implementation from? Does it link from something a lib file like C/C++ would do? Or is it all in the compiler similar to how intrinsics are implemented?

----------


## WaynePhillipsEA

> Ah ok. Where does it get the implementation from? Does it link from something a lib file like C/C++ would do? Or is it all in the compiler similar to how intrinsics are implemented?


It works just like static lib files, but yes they are internal inside the compiler EXE.

----------


## fafalone

Len/LenB are intrinsic in VB too; not in the runtime. At least the common one; there's also versions in the VBA dll that you can access with VBA.Len/LenB If you haven't checked it out, The trick's VB6 kernel mode driver shows some of what's built in and some of the limitations. It doesn't use the runtime at all; you have to manually remove it as a dependency.

But VarPtr is in the runtime. So you needed a workaround even for that (one exists, if you declare the InterlockedExchange API in a certain way, it functions the same as VarPtr).

----------


## Niya

> It works just like static lib files, but yes they are internal inside the compiler EXE.


K. That makes sense.




> Len/LenB are intrinsic in VB too; not in the runtime. At least the common one; there's also versions in the VBA dll that you can access with VBA.Len/LenB If you haven't checked it out, The trick's VB6 kernel mode driver shows some of what's built in and some of the limitations. It doesn't use the runtime at all; you have to manually remove it as a dependency.
> 
> But VarPtr is in the runtime. So you needed a workaround even for that (one exists, if you declare the InterlockedExchange API in a certain way, it functions the same as VarPtr).


I see. That's very interesting. With regards to VBA.Len and such, does everything in the VBA namespace work as an intrinsic when not fully qualified? For example stuff like Command$/Command....

----------


## wqweto

> With regards to VBA.Len and such, does everything in the VBA namespace work as an intrinsic when not fully qualified? For example stuff like Command$/Command....


No, not everything.

Here is a discussion how to figure out which one is implemented as intrinsic and you can even use different color in the Editor for intrinsics.

cheers,
</wqw>

----------


## Niya

> No, not everything.
> 
> Here is a discussion how to figure out which one is implemented as intrinsic and you can even use different color in the Editor for intrinsics.
> 
> cheers,
> </wqw>


Ah ok. That's very clever.

----------


## yereverluvinuncleber

Niya, is TB carefully and gently luring you back into the world of VB6? Can you see yourself coding again in that lovely language that you know so well?

----------


## Niya

> Niya, is TB carefully and gently luring you back into the world of VB6? Can you see yourself coding again in that lovely language that you know so well?


Probably not. Don't get me wrong, I think TwinBASIC will be great and based on my experience with it, I would definitely recommend it. It is shaping up to be a highly competitive modern language. However, .Net already gives me almost everything I could ever want. There is just no reason for me to leave it.

There is one thing however, that TwinBASIC offers that .Net cannot, the ability to create dependency-free native code standard DLLs using a flavor of BASIC I'm highly familiar with. C is probably still the best language for writing standard DLLs but for relatively simple or higher level stuff, BASIC is more than adequate and I can get it done a lot faster.

Most of my coding in the VB6 world would still be mostly stuff on these forums and some stuff for our main POS application which is still written in VB6. But outside of that, most of the code I will be writing in the future will be .Net code. I would probably use TwinBASIC over C/C++ if a need to create standard Windows DLLs comes up in the future.

----------


## VB6 Programming

*How To's and other articles about the twinBASIC language...*

https://nolongerset.com/tag/twinbasic/

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: August 7, 2022

_Highlights include a major compiler refactor to help reduce compiler memory usage and proposed support for multiple built-in rounding methods._


https://nolongerset.com/twinbasic-update-august-7-2022/

----------


## VB6 Programming

*HOW TO: Install twinBASIC*

_The latest step-by-step instructions for installing twinBASIC_

https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: August 14, 2022

_Highlights include IDE memory optimizations, build size reductions, and a discussion about a potential extensibility library for the IDE._

https://nolongerset.com/twinbasic-up...ugust-14-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 91 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder.


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 92 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 93 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 94 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 95 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



_How to install_ https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 96 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: August 21, 2022

_Highlights include IDE improvements, support for Excel events in COM addins, and a kernel-mode driver written in twinBASIC (yes, really)._

https://nolongerset.com/twinbasic-up...ugust-21-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 97 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install_ https://nolongerset.com/how-to-install-twinbasic/

----------


## vbrad

I know that there is a lot done and being done and that there are reasons why this is so but it feels a little disappointing that it is still not possible to import even the simplest imaginable vb6 form based project into tb.

----------


## WaynePhillipsEA

vbrad,

This month I'm only tackling things that can realistically be achieved in an hour or two at a time, since my kids are off school and work time is in short supply, so I don't want to be starting something too deep.  But rest assured, the UI stuff is top priority for September, and there will be a big push to get that work done (including the migration of forms).

I know it's frustrating, but please bear with me!

----------


## yereverluvinuncleber

Goodness me. VBRad you are easily disappointed.

----------


## VB6 Programming

> But rest assured, the UI stuff is top priority for September, and there will be a big push to get that work done (including the migration of forms).


We are all waiting eagerly  :big yellow:

----------


## VB6 Programming

*twinBASIC IDE BETA 98 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install_ https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*HOW TO: Handle Excel Events in a twinBASIC COM Addin*

_You can now use twinBASIC to create a COM add-in for Excel that handles Excel Application events like NewWorkbook and WorkbookOpen._

https://nolongerset.com/handle-excel...-in-twinbasic/

----------


## vbrad

> vbrad,
> 
> This month I'm only tackling things that can realistically be achieved in an hour or two at a time, since my kids are off school and work time is in short supply, so I don't want to be starting something too deep.  But rest assured, the UI stuff is top priority for September, and there will be a big push to get that work done (including the migration of forms).
> 
> I know it's frustrating, but please bear with me!


Great to hear, thanks Wayne.
What you've achieved so far is nothing short of amazing.
As someone who works pretty much exclusively in vb6 form based applications, I am so looking forward to creating something simple in vb6 and being able to then open that in tb!
Thanks very much for your post, it means a lot.

----------


## VB6 Programming

*twinBASIC IDE BETA 99 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 100 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 101 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: August 28, 2022

_Highlights include improvements to code selector boxes in the IDE, IntelliSense improvements, and better support for "kernel mode" (i.e., device drivers)._

https://nolongerset.com/twinbasic-up...ugust-28-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 102 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 103 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 104 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 105 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder




_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 106 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 107 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## dee-u

Is there some sort of "import" feature of TB to import VB6 projects? Or is there a guide to "convert" a VB6 project to TB without completely rewriting it?

----------


## VB6 Programming

> Is there some sort of "import" feature of TB to import VB6 projects? Or is there a guide to "convert" a VB6 project to TB without completely rewriting it?


There is a VB6 import to twinBASIC but it can't yet import Forms (it can import modules and classes).
Wayne assures us he will be working on the Forms import and the UI over the next month.

----------


## VB6 Programming

*twinBASIC IDE BETA 108 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## dee-u

Does TB support adding other controls like Microsoft Windows Common Controls? I need to use a listview.

----------


## WaynePhillipsEA

> Does TB support adding other controls like Microsoft Windows Common Controls? I need to use a listview.


Sure.  You need to add a reference to the 'Microsoft Windows Common Controls 6.0' COM reference (Project menu > References).  Once you've done that and close & saved the Settings, you should find that the common controls are available to use in the form designer.

Due to a bug, some control members are not currently showing in intellisense, so typing 'ListView1.' for example won't show you the ListItems member, though it is actually available, so the full 'ListView1.ListItems.Add' works.  This intellisense bug will be fixed later today.

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: September 4, 2022

_Highlights include new IDE shortcut keys, an awesome new IDE History panel, and a project from fafalone that showcases twinBASIC's interface definition feature._

https://nolongerset.com/twinbasic-up...tember-4-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 109 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 111 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


*TreeView common control added*

_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 112 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


*DriveListBox control added*

_How to install https://nolongerset.com/how-to-install-twinbasic/_

----------


## VB6 Programming

*twinBASIC IDE BETA 116 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


*DirListBox control added*

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 119 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

*FileListBox control added*

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: September 11, 2022

_Highlights include 4 new form controls (TreeView, DriveListBox, DirListBox, FileListBox), an impromptu Q&A with Wayne, and WinNativeForms source._

https://nolongerset.com/twinbasic-up...ember-11-2022/

----------


## VB6 Programming

How To's and other articles about twinBASIC programming...

https://nolongerset.com/tag/twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 120 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

*PictureBox control added
Print syntax support added*


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 122 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 123 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: September 18, 2022

_Highlights include the initial implementation of a PictureBox control and a custom Windows Event Viewer written in twinBASIC._

https://nolongerset.com/twinbasic-up...ember-18-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 124 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

*EXPERIMENTAL support for importing VB6 forms*

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## vbrad

I just imported a small project, (one form, one module, two classes) I'd made to that does some CRUD operations on a server database via ODBC. 
I really didn't expect it to work without some tweaking (it being labelled experimental) but it did, perfectly!
VB7 has arrived!

----------


## Darkbob

So I've got a 3rd party OCX image control.  I added a reference to it.  Now... it doesn't show up in the tool box... how do I use it?  How do I add it to a form?  Cool project.

Edit:

I added a picture control and a command button from the existing toolbox to a form then added this code to the button:



```
    Private Sub Command_Click() Handles Command.Click
        Picture1.Picture = LoadPicture ("author.jpg")
    End Sub
```

I put the file author.jpg in the same folder as the twinbasic exe and ran and clicked... got an error saying "file not found".

I'm thinking this project is amazing but very preliminary.  Or I'm doing something wrong.    Still a cool project.

----------


## WaynePhillipsEA

> So I've got a 3rd party OCX image control.  I added a reference to it.  Now... it doesn't show up in the tool box... how do I use it?  How do I add it to a form?  Cool project.
> 
> Edit:
> 
> I added a picture control and a command button from the existing toolbox to a form then added this code to the button:
> 
> 
> 
> ```
> ...


For the ActiveX control, first make sure you're working with a project that is saved to disk.  Add the reference to the type library in the COM References list (don't use the Import From File feature here).  Save the Settings file.  Compiler should briefly restart and any ActiveX components should then be available in the form designer for you to use.

For the picture, at the moment you need to prefix Set... 


```
Set Picture1.Picture = LoadPicture("author.jpg")
```

I note that Set is not required in VB6 here, so I will get that fixed.   If you're still struggling with it, check the value of CurDir to see if the path is as you expect.  With the `Set` prefix, it works fine here.

----------


## VB6 Programming

*twinBASIC IDE BETA 125 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## yereverluvinuncleber

> I'm thinking this project is amazing but very preliminary.


Yes, DarkBob, the project is 'very preliminary' as in it is being developed now... That is what alpha/beta software means. So, if you want to drive away using a car that is still being designed and built, obviously only has three wheels, no chairs and only a stub with a spanner on it where the steering wheel should be - then you have another think coming and I'm suggesting it's just around the corner.

----------


## VB6 Programming

*twinBASIC IDE BETA 126 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 127 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 128 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## yereverluvinuncleber

Suggestion: on the blog in github, drop in a small image on occasion, if appropriate and if possible. Sometimes an associated picture speaks louder than just the text.

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: September 25, 2022

_Highlights include long-awaited VB6 form import support (experimental) and a community-led GitHub project to provide official documentation for twinBASIC._

https://nolongerset.com/twinbasic-up...ember-25-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 129 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## vbrad

Pretty cool to see all vb6's intrinsic controls in the toolbox even if there are still some properties, methods etc to be supported.

https://github.com/twinbasic/twinbasic/issues/1188

----------


## VB6 Programming

*twinBASIC IDE BETA 130 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

*Menu control is now partially implemented*

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 131 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 132 is now available.*

Download from here... https://github.com/WaynePhillipsEA/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 133 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## wqweto

@VB6 Programming: You can switch links directly to *twinbasic* org on github i.e. https://github.com/twinbasic/twinbasic/releases

Currently github is helping by redirecting all links to *WaynePhillipsEA*/twinbasic repo to *twinbasic*/twinbasic repo but this might change (fail) at some point in time.

cheers,
</wqw>

----------


## VB6 Programming

> @VB6 Programming: You can switch links directly to *twinbasic* org on github i.e. https://github.com/twinbasic/twinbasic/releases


Good point.  That would be safer.

----------


## VB6 Programming

*twinBASIC IDE BETA 135 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update*

twinBASIC Update: October 2, 2022

_Highlights include a pile of new form and control properties, a form menu designer, visual tab stop indicators in design view, and a new twinBASIC LinkedIn group._

https://nolongerset.com/twinbasic-up...ctober-2-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 136 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

_EXPERIMENTAL type library viewer_


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 137 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 140 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 143 is now available.
*
Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 144 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 145 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC Update: October 9, 2022

_Highlights include support for control and menu arrays, a Type Library Viewer (Object Browser equivalent), and a video interview with twinBASIC creator Wayne Phillips._

https://nolongerset.com/twinbasic-up...ctober-9-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 146 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## camomille

Visual progression of Wayne's hard work on base objects (PROPERTY,METHOD,EVENT)
Thanks to Eduardo for his "ComponentDocumenter" program
To update, replace the "package.twinproj" file included in the folder with the new one located in \packages{F50B82D0-DCAB-43FE-9631-11959D4A4728}.
By eliminating comments from the vba program, it is possible to display options in cells (slower loop) and list all "Unimplemented" in a text file.

Obj_Tb3.zip

----------


## VB6 Programming

*twinBASIC IDE BETA 148 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 149 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC Update: October 16, 2022

_Highlights include two new ways to open the twinBASIC IDE (via .twinproj files and Windows shortcuts), better performance for IDE panels, and more GUI progress._

https://nolongerset.com/twinbasic-up...tober-16-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 150 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 151 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

_Input and InputB file functions added_

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 152 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 153 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 154 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 155 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC Update: October 23, 2022

_Highlights include many IDE improvements, better support for high-performance code, and a sample Task Dialog project from fafalone._

https://nolongerset.com/twinbasic-up...tober-23-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 156 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 157 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 158 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 159 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 160 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 161 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 162 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 163 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC Update: October 30, 2022

_Highlights include better PNG handling, improvements to the custom menu builder, and support for a NumbersOnly textbox property._

https://nolongerset.com/twinbasic-up...tober-30-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 164 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 165 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETAs 166, 167 and 168 are now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 169 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC Complete Common Controls definitions, x64-compatible*

*tbComCtlLib* has all the standard common controls definitions, completed, with the major ones including additional undocumented definitions.

This is supplied as a TWINPACK Package you can add to your project in Settings->References. It will work with tbShellLib-- which is needed if you wish to use the RichEdit OLE Extensions.


https://www.vbforums.com/showthread....x64-compatible

----------


## VB6 Programming

*twinBASIC Shell Interface Library (x64-compatible successor to oleexp)*

*tbShellLib* is a project to create an x64-compatible interface set as a successor to oleexp, since upgrading that with midl is nigh impossible due to some issues, and twinBASIC will eventually support exporting Type Libraries anyway.

The current form of this project is a twinpack file, which can be added to twinBASIC projects as a reference (Settings -> References -> twinpack Packages). Since the full scope of language features can be used in this form, it will include the addon modules internally.


https://www.vbforums.com/showthread....sor-to-oleexp)

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC Update: November 6, 2022

_Highlights include native CoClass support and a TWINPACK package from fafalone with definitions for all the standard common controls._

https://nolongerset.com/twinbasic-up...vember-6-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 170 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## Episcopal

```

    Dim i As Integer
    Dim j As Integer
    
    For i = 1 To 3
        For j = 1 To 3
            MsgBox "Row: " & i & ", Column: " & j
            Exit For
        Next
    Next
```


Wayne ...

The ExitFor command will only exit the first loop, in twinbasic it would be possible to implement ExitFor (n), where n would be the exit number of the loop ...

Although I could use a gosub, but I don't think it would be very elegant for a modern language.... my opinion.


Edit: This week I needed to do this, then I remembered twinbasic...

----------


## wqweto

> ```
> 
>     Dim i As Integer
>     Dim j As Integer
>     
>     For i = 1 To 3
>         For j = 1 To 3
>             MsgBox "Row: " & i & ", Column: " & j
>             Exit For
> ...


Try *i = 3 : Exit For* power-combo instead of your "plain" *Exit For* in the inner loop :-))

cheers,
</wqw>

----------


## fafalone

Exiting a nested loop entirely is one of the few places it should be perfectly acceptable to use GoTo...



```
    Dim i As Integer
    Dim j As Integer
    
    For i = 1 To 3
        For j = 1 To 3
            MsgBox "Row: " & i & ", Column: " & j
            GoTo Out
        Next
    Next
out:
```

Especially when the solution everyone wants is something that would compile down to the same JMP.

----------


## Episcopal

> Try *i = 3 : Exit For* power-combo instead of your "plain" *Exit For* in the inner loop :-))
> 
> cheers,
> </wqw>


wqweto ...... I know it works....

----------


## VB6 Programming

*twinBASIC IDE BETA 171 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 172 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 173 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 174 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 175 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC status update:

*twinBASIC Update: November 13, 2022*

_Highlights include drag and drop support, an innovative IDE feature known as "Type Hints", and a proof-of-concept twinBASIC multithreading project._

https://nolongerset.com/twinbasic-up...ember-13-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 176 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 177 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 178 is now available.*

_Fixes most Form load/unload/hide/visible issues, and now supports both modal and non-modal forms. _ 


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 179 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC IDE BETA 180 is now available.

_Global.Forms collection is now implemented._

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC programming IDE BETA 181 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC programming IDE BETA 182 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC Update: November 20, 2022

_Highlights include several bug fixes, a new method to clear the debug console, and a discussion about the difference between Drag and OLEDrag methods._

https://nolongerset.com/twinbasic-up...ember-20-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 183 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## vbrad

Just recently I imported a small project into tb. The only thing that didn't come across perfectly were the pictures on the command buttons. 
I repeated it today with the latest version and this time they were there.
The form in this project is pretty busy with buttons labels and other controls.
Side by side they were identical except the vb6 one's control's styles were outdated.
I'm just amazed by this twinBasic.

----------


## VB6 Programming

*twinBASIC IDE BETA 184 is now available.*

_Command Button enhanced with PictureAlignment property (default Top), ForeColor property, and Padding property (for graphical style with picture and text)._

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

> Just recently I imported a small project into tb. The only thing that didn't come across perfectly were the pictures on the command buttons. 
> I repeated it today with the latest version and this time they were there.
> The form in this project is pretty busy with buttons labels and other controls.
> Side by side they were identical except the vb6 one's control's styles were outdated.


Beta 184 should let you position the picture on the button and have text on graphical buttons as well.




> I'm just amazed by this twinBasic.


It just gets better and better  :Big Grin:

----------


## fafalone

> Just recently I imported a small project into tb. The only thing that didn't come across perfectly were the pictures on the command buttons. 
> I repeated it today with the latest version and this time they were there.
> The form in this project is pretty busy with buttons labels and other controls.
> Side by side they were identical except the vb6 one's control's styles were outdated.
> I'm just amazed by this twinBasic.


tB applies comctl6 visual styles by default; if you did want the old style back you could uncheck 'VisualStyles" property for the control.

----------


## VB6 Programming

*twinBASIC IDE BETA 185 is now available.*

_CheckBox and OptionButton enhanced to be like Graphical Command Buttons with PictureAlignment property (default Top), ForeColor property, and Padding property (for graphical style with picture and text)._

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 186 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 187 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 188 and 189 are now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC status update:

*twinBASIC Update: November 27, 2022*

_Highlights include support for graphical buttons, OLE drag and drop, and some exciting news about the upcoming release of Rubberduck VBA 3.0._

https://nolongerset.com/twinbasic-up...ember-27-2022/

----------


## VB6 Programming

*twinBASIC IDE BETA 190 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 191 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 192 is now available.*

_Adds initial support for importing VBP forms that contain ActiveX controls_

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

Buy a Coffee for the twinBASIC Programming Language   https://ko-fi.com/twinbasic

_A powerful compilation server is required in order to keep development progressing smoothly._


https://twinbasic.com/

----------


## VB6 Programming

*twinBASIC IDE BETA 193 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 194 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 195 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 196 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 197 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 198 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC status update:

*twinBASIC Update: December 4, 2022*

_Highlights include initial support for importing VB6 forms with ActiveX controls, GoSub syntax support, and context-sensitive custom help support._ 

https://nolongerset.com/twinbasic-up...cember-4-2022/

----------


## VB6 Programming

*twinBASIC ROADMAP update:*

_The twinBASIC roadmap has been updated..._

The priorities for December 2022 are:
Finish all remaining basic controls.Complete UserControl/ActiveX support.
The priorities for Q1 2023 (Jan-March) are:
Complete the missing App object methodsAdd the missing features to the new IDE, e.g. rename-refactoring and Test ExplorerSupport optimized builds, using the LLVM backend compiler

*VERSION 1 RELEASE*
The first release of twinBASIC is expected in early April 2023   :Smilie: 


See more details here twinBASIC ROADMAP


List of ALL missing/unimplemented intrinsic control properties and methods

-------------------------------------------------------------------------------
To download the latest twinBASIC beta...

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/
-------------------------------------------------------------------------------

----------


## VB6 Programming

*twinBASIC IDE BETA 199 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 200 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 201 is now available.*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

From Wayne Phillips...

"Thought I'd just check how many errors we're down to for loading  PhotoDemon which makes extensive use of UserControls.  Using tB BETA 145 from 2 months ago, tB opens it with 8152 compilation errors.  In the next release, it opens with 55 errors... mostly from the missing Printers collection.  We're getting closer folks!"

https://discord.com/channels/

https://photodemon.org/

----------


## VB6 Programming

twinBASIC status update:

*twinBASIC Update: December 11, 2022*

_Updates include a version 1 release date, twinBASIC roadmap update, and several bug fixes_

https://nolongerset.com/twinbasic-up...ember-11-2022/

----------


## OptionBase1

> From Wayne Phillips...
> 
> "Thought I'd just check how many errors we're down to for loading  PhotoDemon which makes extensive use of UserControls.  Using tB BETA 145 from 2 months ago, tB opens it with 8152 compilation errors.  In the next release, it opens with 55 errors... mostly from the missing Printers collection.  We're getting closer folks!"
> 
> https://discord.com/channels/
> 
> https://photodemon.org/


It has been so cool to follow this project from the first time it was mentioned here.  Any other "VB6 Replacements" will have to offer something beyond what TB is already doing in order to gain any sort of user adopting traction, and frankly, I just don't see that happening in the nearish (2-3 year) future.

----------


## VB6 Programming

> It has been so cool to follow this project from the first time it was mentioned here.  Any other "VB6 Replacements" will have to offer something beyond what TB is already doing in order to gain any sort of user adopting traction, and frankly, I just don't see that happening in the nearish (2-3 year) future.


twinBASIC is looking really good now.  :big yellow:

----------


## VB6 Programming

*twinBASIC IDE BETA 202 is now available.*

_BETA 202 is out with initial support for internal UserControls. 
Still a lot of work to do in this area. The VBCCR demo VBP project will now load in tB without errors, though many of the UserControls do not yet work due to a few missing parts of the puzzle (e.g. ScaleX/Y vbContainerSize support).   Due to this, the demo forms will not work yet.   You can open the demo VBP, and then create new forms to try out the controls._


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 204 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 205 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 206 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 207 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 208 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 209 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 210 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC status update:*

twinBASIC Update: December 18, 2022

_Highlights include initial support for user controls, a new list view option for the form designer toolbox, and another sample twinBASIC project from fafalone._

https://nolongerset.com/twinbasic-up...ember-18-2022/

----------


## VB6 Programming

*Useful twinBASIC 'How To' articles...*


https://nolongerset.com/tag/twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 211 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC IDE BETA 212 is now available.*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*The twinBASIC programming IDE BETA 213 is now available...*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC status update:

*twinBASIC Update: December 26, 2022*

_Highlights include the smallest bug report in twinBASIC history, a repository of twinBASIC sample projects, and a tB-based VBA DocTest runner from Ben Clothier._

https://nolongerset.com/twinbasic-up...ember-26-2022/

----------


## VB6 Programming

*The twinBASIC programming IDE BETA 215 is now available...*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*BETA 216 of the twinBASIC programming IDE is now available...*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*BETA 217 of the twinBASIC programming IDE is now available...
*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*BETA 218 of the twinBASIC programming IDE is now available...*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## RDGMax

Fantastic job

----------


## VB6 Programming

twinBASIC status update:

*twinBASIC Update: January 1, 2023*

_Highlights include a redesigned form preview button, a file watcher sample application from fafalone, and a holiday message from Wayne Phillips._

https://nolongerset.com/twinbasic-up...anuary-1-2023/

----------


## VB6 Programming

*BETA 219 of the twinBASIC programming IDE is now available...*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*BETA 220 of the twinBASIC programming IDE is now available...
*

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC programming IDE BETA 221 is now available...*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC programming IDE BETA 222 is now available...*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC programming IDE *BETA 223* is now available...


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder

How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC programming IDE *BETA 224* is now available...


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC status update:

*twinBASIC Update: January 8, 2023*

_Highlights include .vbp UserControl import support, a twinBASIC VBCCR demo project, live variable hover tips in the IDE, and a discussion of post-v1 breaking changes._

https://nolongerset.com/twinbasic-up...anuary-8-2023/

----------


## VB6 Programming

*twinBASIC programming IDE BETA 225 is now available...*


Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC programming IDE* BETA 226* is now available...

Download from here... https://github.com/twinbasic/twinbasic/releases

Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC programming IDE BETA 227 is now available...*

Download from here... https://github.com/twinbasic/twinbasic/releases

Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC programming IDE BETA 228 is now available...*

_Krool's VBCCR 32-bit UserControl package added (experimental) 32bit onlyNew project type of Standard EXE (plus VBCCR) - experimental (32-bit only) for trying out VBCCR UserControls
_
Download from here... https://github.com/twinbasic/twinbasic/releases

Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC programming IDE *BETA 229* is now available...

Download from here... https://github.com/twinbasic/twinbasic/releases
Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

The twinBASIC programming IDE *BETA 230* is now available...

Download from here... https://github.com/twinbasic/twinbasic/releases

Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder



How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

*twinBASIC programming IDE BETA 231 is now available...*

Download from here... https://github.com/twinbasic/twinbasic/releases


Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------


## VB6 Programming

twinBASIC programming IDE *BETA 232* is now available...

Download from here... https://github.com/twinbasic/twinbasic/releases

Click on "Assets" for the latest releaseDownload and Extract the ZIP file into a local folderThen run the twinBASIC.exe from that local folder


How to install https://nolongerset.com/how-to-install-twinbasic/

----------

