-
Feb 6th, 2024, 10:01 PM
#1801
Re: TwinBasic
Can you develop a VB code parser? twinbasic_script.dll
The input code can be directly parsed and run dynamically.Is to replace the VBS scripting engine
about esigned to be 100% compatible with existing VB6 and VBA code, emulating all known quirks Compile to Win32 and Win64 architectures. Plans to compile for Mac, Linux, and Android. Based entirely on COM technology, such as the classic version of Visual Basic Produces a very small executable file that does not require any runtime libraries or redistributable components Currently compiles to unoptimized native code with better performance than VBA excode (VB6 p-code) Multiple components (within class/module blocks) are allowed per source file New custom VB code parser engine (written in C + +) built for flexibility and amazing performance
-
Feb 11th, 2024, 06:30 PM
#1802
Re: TwinBasic
twinBASIC status update:
twinBASIC Update: February 11, 2024
Highlights include the option to restore a traditional title bar to the twinBASIC IDE, a new lifetime license offer, and a lively discussion about attribute syntax.
nolongerset.com/twinbasic-update-february-11-2024/
-
Feb 18th, 2024, 04:47 PM
#1803
Re: TwinBasic
twinBASIC status update:
twinBASIC Update: February 18, 2024
Highlights include progress on the IDE memory leaks, object models for automating Excel's Solver, and discussion regarding a taskbar icon monitor issue.
nolongerset.com/twinbasic-update-february-18-2024/
Last edited by VB6 Programming; Feb 18th, 2024 at 04:52 PM.
-
Feb 26th, 2024, 06:29 AM
#1804
Re: TwinBasic
twinBASIC status update:
twinBASIC Update: February 25, 2024
Highlights include reduced IDE memory consumption, two new projects from fafalone, and jpbro's clever solution to the biggest twinBASIC dev bottleneck.
nolongerset.com/twinbasic-update-february-25-2024/
-
Mar 1st, 2024, 07:31 AM
#1805
Re: TwinBasic
Sorry for my double ignorance (if I don't know, or it shouldn't exist) but is there a Friend Type or Friend Enums in TwinBasic?
-
Mar 1st, 2024, 07:59 AM
#1806
-
Mar 3rd, 2024, 03:54 PM
#1807
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: March 3, 2024
Highlights include rebranding the Problems panel as "Diagnostics" with expanded functionality, placeholders for the Description attribute, and tB v1 blockers.
nolongerset.com/twinbasic-update-march-3-2024/
-
Mar 10th, 2024, 06:59 PM
#1808
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: March 10, 2024
Highlights include a new Trace Mode debugging feature, improved IntelliSense performance, and details of Mike Wolfe's upcoming twinBASIC presentation at Access DevCon.
https://nolongerset.com/twinbasic-update-march-10-2024/
Last edited by VB6 Programming; Mar 10th, 2024 at 07:15 PM.
-
Mar 17th, 2024, 05:16 PM
#1809
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: March 17, 2024
Highlights include independent TypeLibrary versioning and a detailed explanation of the new Runtime Tracing feature.
https://nolongerset.com/twinbasic-update-march-17-2024/
-
Mar 24th, 2024, 02:59 PM
#1810
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: March 24, 2024
Highlights include the return of support for twinBASIC IDE Add-ins, global search in the IDE, two new projects from fafalone, and an eye-opening twinBASIC poll.
https://nolongerset.com/twinbasic-update-march-24-2024/
-
Apr 2nd, 2024, 04:34 AM
#1811
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: April 1, 2024
Highlights include dozens of bug fixes, a new MsgBox builder IDE addin, and a GitHub project for automatically setting PE image header properties.
https://nolongerset.com/twinbasic-update-april-1-2024/
-
Apr 8th, 2024, 03:52 AM
#1812
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: April 7, 2024
Highlights include the ability to embed code in tB IDE keyboard shortcuts, a consolidated page of sokinkeso's tB IDE addins, and a new App object package.
https://nolongerset.com/twinbasic-update-april-7-2024/
-
Apr 9th, 2024, 09:07 PM
#1813
Junior Member
Re: TwinBasic
hello fafalone,i am trying to expose the webview2.jsrun method to an activex control. just pass an paramarray to Me.WebView.JsRun method does not work when more than one parameters is passed.
Code:
Public Function jsRun(ByVal jsFunction As String, ParamArray args() As Variant) As Variant 'function in activex control
' Dim ar() As Variant, arg As Variant, subarg As Variant
' Dim varItemCount As Long = 0
' For Each arg In args
' If IsArray(arg) Then
' For Each subarg In arg
' ReDim Preserve ar(varItemCount)
' ar(varItemCount) = subarg
' varItemCount = varItemCount + 1
' Next subarg
' Else
' ReDim Preserve ar(varItemCount)
' ar(varItemCount) = arg
' varItemCount = varItemCount + 1
' End If
' Next arg
' Return Me.WebView.JsRun(jsFunction, ar) //1'failed
Return Me.WebView.JsRun(jsFunction, args)'//2.directly pass paramaray.failed
'Dim arr As Variant
'If IsArray(args(0)) Then arr = args(0) Else arr = args '//3.tried and failed
End Function
Private Sub UserForm_Initialize() 'used in office
With Me.LibWebview1
Do While Not .webviewready
DoEvents
Loop
.Height = Me.Height - 1
.Width = Me.Width - 1
.Navigate ("https://cn.bing.com/")
.ExecScript ("function fn(a,b){return a* 4;}")
Debug.Print .jsRun("fn", 2) ' this is ok and get result:8
Debug.Print .jsRun("fn", 2, 3) 'wrong and return null,affacted by the 2nd arg
Stop
End With
End Sub
Last edited by jmcilhinney; Apr 9th, 2024 at 11:44 PM.
-
Apr 10th, 2024, 02:38 AM
#1814
Re: TwinBasic
 Originally Posted by fan2006
hello fafalone,i am trying to expose the webview2.jsrun method to an activex control. just pass an paramarray to Me.WebView.JsRun method does not work when more than one parameters is passed.
Code:
Public Function jsRun(ByVal jsFunction As String, ParamArray args() As Variant) As Variant 'function in activex control
' Dim ar() As Variant, arg As Variant, subarg As Variant
' Dim varItemCount As Long = 0
' For Each arg In args
' If IsArray(arg) Then
' For Each subarg In arg
' ReDim Preserve ar(varItemCount)
' ar(varItemCount) = subarg
' varItemCount = varItemCount + 1
' Next subarg
' Else
' ReDim Preserve ar(varItemCount)
' ar(varItemCount) = arg
' varItemCount = varItemCount + 1
' End If
' Next arg
' Return Me.WebView.JsRun(jsFunction, ar) //1'failed
Return Me.WebView.JsRun(jsFunction, args)'//2.directly pass paramaray.failed
'Dim arr As Variant
'If IsArray(args(0)) Then arr = args(0) Else arr = args '//3.tried and failed
End Function
Private Sub UserForm_Initialize() 'used in office
With Me.LibWebview1
Do While Not .webviewready
DoEvents
Loop
.Height = Me.Height - 1
.Width = Me.Width - 1
.Navigate ("https://cn.bing.com/")
.ExecScript ("function fn(a,b){return a* 4;}")
Debug.Print .jsRun("fn", 2) ' this is ok and get result:8
Debug.Print .jsRun("fn", 2, 3) 'wrong and return null,affacted by the 2nd arg
Stop
End With
End Sub
This doesn't look like the WebView control available in twinBASIC, because the method is called 'ExecuteScript' here, not 'ExecScript'. The example code you provided does work using the twinBASIC control:
Code:
WebViewCtl.ExecuteScript("function fn(a,b){return a* 4;}")
MsgBox WebViewCtl.JsRun("fn", 2)
MsgBox WebViewCtl.jsRun("fn", 2, 3)
(two message boxes with 8 appear)
-
Apr 10th, 2024, 03:13 AM
#1815
Junior Member
Re: TwinBasic
 Originally Posted by WaynePhillipsEA
This doesn't look like the WebView control available in twinBASIC, because the method is called 'ExecuteScript' here, not 'ExecScript'. The example code you provided does work using the twinBASIC control:
Code:
WebViewCtl.ExecuteScript("function fn(a,b){return a* 4;}")
MsgBox WebViewCtl.JsRun("fn", 2)
MsgBox WebViewCtl.jsRun("fn", 2, 3)
(two message boxes with 8 appear)
it' an acitvex writtlen in twinBASIC. i just want to get "jsrun" function work in excel vba .so i write some equivalent functions with the WebViewCtl functions? I am stuck with the problem how to pass paramarray to the WebViewCtl.jsRun which accept a paramarray parameter.
-
Apr 10th, 2024, 04:50 AM
#1816
Re: TwinBasic
 Originally Posted by fan2006
it' an acitvex writtlen in twinBASIC. i just want to get "jsrun" function work in excel vba .so i write some equivalent functions with the WebViewCtl functions? I am stuck with the problem how to pass paramarray to the WebViewCtl.jsRun which accept a paramarray parameter.
There's currently no built-in way to pass a ParamArray on to another procedures ParamArray arg directly, but you can do it with a slightly changed version of CallByName:
Code:
Private DeclareWide PtrSafe Function CallByName2 Lib "<interaction>" Alias "#9" (ByVal Object As Object, ByVal ProcName As String, ByVal CallType As VbCallType, Args() As Variant) As Variant
Note that the Args() definition in this version of CallByName doesn't have ParamArray specified on it. You should now be able to call CallByName2(obj, "jsRun", vbMethod, paramArrayArg) which will pass the array instead of creating a new paramarray containing the array.
-
Apr 10th, 2024, 05:00 AM
#1817
Re: TwinBasic
Setting aside WebView; I don't think ParamArray can be used in the way you're trying. The values are passed on the stack; it's fixed at runtime. You can pass an array as a single argument inside a variant, but then the javascript would need to be able to handle a SAFEARRAY.
-
Apr 10th, 2024, 05:10 AM
#1818
Junior Member
Re: TwinBasic
it worked and thx for your help.
-
Apr 15th, 2024, 03:13 AM
#1819
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: April 14, 2024
Highlights include improved performance and stability, error codes for compile errors, a sneak peek at sokinkeso's External Tools plugin, and version control for twinBASIC.
nolongerset.com/twinbasic-update-april-14-2024/
-
Apr 22nd, 2024, 12:22 AM
#1820
Re: TwinBasic
twinBASIC status update:
twinBASIC Update: April 21, 2024
Highlights include word wrap toggling, twinBASIC returns to Vienna, a WinDevLib quick start guide, and a major milestone as twinBASIC now runs PhotoDemon!
nolongerset.com/twinbasic-update-april-21-2024/
-
Apr 30th, 2024, 03:19 AM
#1821
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: April 29, 2024
Highlights include my DevCon Vienna twinBASIC recording, massive memory reduction in the IDE, and exciting news regarding the VB6 PhotoDemon project.
nolongerset.com/twinbasic-update-april-29-2024/
-
Apr 30th, 2024, 05:51 AM
#1822
Re: TwinBasic
Mike Wolfe's twinBASIC update presentation to the Access DevCon Vienna conference is now available on YouTube
https://www.youtube.com/watch?v=7IfAkOOWSao
-
May 6th, 2024, 09:32 PM
#1823
Re: TwinBasic
Was just casually strolling through this thread and realized I left this unanswered:-
 Originally Posted by Episcopal
Excuse my ignorance, but does this happen every time the program looks at the array? In advanced options, if you choose to activate the "Remove array bounds
checks" it means that it would be faster, but less secure, is that it?
I'd expect the answer to be yes. I don't recall ever testing what would happen if an array is read out of bounds when this option is checked but if it works the way I think it does, it will behave as it does in C which is to say the result would be undefined. It could work today, crash tomorrow and launch nuclear missiles the next day.
-
May 7th, 2024, 03:54 AM
#1824
Re: TwinBasic
twinBASIC status update:
twinBASIC Update: May 6, 2024
Highlights include support for the [NonBrowsable] attribute for ActiveX controls and discussions on Implements Via and ByVal/ByRef for tB vs. VB6 events.
https://nolongerset.com/twinbasic-update-may-6-2024/
-
May 14th, 2024, 06:49 AM
#1825
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: May 13, 2024
Highlights include reduced RAM usage by the compiler and an update to fafalone's Drag & Drop Demo project.
https://nolongerset.com/twinbasic-update-may-13-2024/
Wayne Phillips says "Whilst many of you are waiting for the MDI support, I thought I'd drop a little update in the meantime. BETA 533 offers upto 20% less RAM use by the compiler process. "
Last edited by VB6 Programming; May 14th, 2024 at 06:54 AM.
-
May 18th, 2024, 07:30 AM
#1826
Re: TwinBasic
Big news from Wayne...
MDI forms are now supported in twinBASIC 
See https://www.vbforums.com/showthread....releases/page7
From Beta version 537 (plus Beta 538) MDI form support is added to twinBASIC.
Sample 19 has been added to demonstrate this.
Wayne advises "I wouldn't dive in trying to load complex MDI projects just yet until the dust settles "
-
May 20th, 2024, 11:30 PM
#1827
Re: TwinBasic
twinBASIC status update:
twinBASIC Update: May 20, 2024
Highlights include the long-awaited arrival of MDI forms, OS targeting, an animated GIF project, and the first commercially available project built with twinBASIC.
https://nolongerset.com/twinbasic-update-may-20-2024/
-
May 30th, 2024, 05:02 AM
#1828
Re: TwinBasic
twinBASIC status update:
twinBASIC Update: May 29, 2024
Highlights include a new ImageList control, Opacity and TransparencyKey properties, and a new Sample Project demonstrating these added features.
https://nolongerset.com/twinbasic-update-may-29-2024/
-
Jun 6th, 2024, 05:29 AM
#1829
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: June 5, 2024
Highlights include a new experimental Project Explorer IDE panel, a proposal for "Unsafe" block syntax, and tB-compatible sample code for getting the external IP.
https://nolongerset.com/twinbasic-update-june-5-2024/
-
Jun 14th, 2024, 09:04 AM
#1830
Re: TwinBasic programming "twinBASIC for Applications"
Proof Of Concept for "twinBASIC for Applications"
Wayne has been working on a Proof Of Concept of getting "twinBASIC for Applications" (TBA) working, for a client that wants to move away from the VBA SDK. Here you can see the result in action from within MS Access.
See the video: https://x.com/i/status/1801591310270247113
On Discord: https://discord.com/channels/9276381...22276854923324
On Reddit : https://www.reddit.com/r/vba/comment...n_the_horizon/
Wayne explains more about the concept: https://www.reddit.com/r/vba/comment...t=share_button
Last edited by VB6 Programming; Jun 16th, 2024 at 01:55 PM.
-
Jun 14th, 2024, 10:45 AM
#1831
Re: TwinBasic
Can you please post the direct link for the video on youtube? I can't get on with X for a number of reasons, it never works for me (and I hate Elon Musk).
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Jun 14th, 2024, 12:04 PM
#1832
Re: TwinBasic
Doesn't appear to be on the tB YouTube... I converted it to gif and put it on imgur tho: https://i.imgur.com/EXqGEIv.gifv
-
Jun 14th, 2024, 03:52 PM
#1833
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Jun 16th, 2024, 01:58 PM
#1834
Re: TwinBasic programming for VBA
Wayne explains more about the twinBASIC for Applications concept...
https://www.reddit.com/r/vba/comment...t=share_button
-
Jun 18th, 2024, 07:51 AM
#1835
Re: TwinBasic programming
twinBASIC status update:
twinBASIC Update: June 17, 2024
Highlights include a twinBASIC for Applications proof of concept, a new Tab Order IDE addin, and a Memory List Manager sample project.
https://nolongerset.com/twinbasic-update-june-17-2024/
-
Jun 18th, 2024, 08:12 AM
#1836
Re: TwinBasic
Instead of VisualBasic for Applications or its equivalent TwinBasic for Applications, just use TwinBasic 4 Application
The four uses of TB:
1. VB6 replacement
2. VBScript replacement
3. VBA replacement
4. and the fourth being... hmmm a successor to VB.NET... just grabbing things from the air, JSCRIPT alternative, I don't know.
or plain and simple: a TwinBasic 64 Application, it sounds almost the same and it has 'four' in the name.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Jun 18th, 2024, 09:32 AM
#1837
Re: TwinBasic
An additional use of tB is that it's the only way to make ActiveX controls for 64bit Office within the VBx language, vs moving to .NET or C++ where it's way more difficult.
-
Jun 18th, 2024, 01:28 PM
#1838
Re: TwinBasic
OK, then we have a good reason for the 'four'. "TwinBasic 4 Applications"
1. VB6 replacement
2. VBScript replacement
3. VBA replacement
4. VB ActiveX controls for 64bit Office
If we remove the final 's' from Application's' then we still have a perfectly self-explanatory and perfectly legal "TwinBasic 4 Application"
Then there is just "TwinBasic 64 Applications" which has it all really.
https://github.com/yereverluvinunclebert
Skillset: VMS,DOS,Windows Sysadmin from 1985, fault-tolerance, VaxCluster, Alpha,Sparc. DCL,QB,VBDOS- VB6,.NET, PHP,NODE.JS, Graphic Design, Project Manager, CMS, Quad Electronics. classic cars & m'bikes. Artist in water & oils. Historian.
By the power invested in me, all the threads I start are battle free zones - no arguing about the benefits of VB6 over .NET here please. Happiness must reign.
-
Jun 19th, 2024, 04:38 AM
#1839
New Member
Re: TwinBasic programming
I would like to start a thread or have a thread started that promotes discussion about transitioning from VBA/VB6 to twinBASIC.
Specifically, where I find stopping points from VB6 projects that I have ported over to tB and have uncovered problems. I do not want to jump onto Discord or GitHub and register a bug because it might be my bad programming or lack of understanding.
For example, my most recent stumbling point related to a default method - Dictionary(itemname) as a default property for Dictionary.Item(itemname)
I have a piece of code that runs happily in VBA and VB6 that assumes that Scripting.Dictionary has a default method/property. I have two classes that use the same technique. One tabulates an INI-file. The other tabulates a VBP-file.
But tB doesn't like it, but only at runtime even though the dictionary is declared As Scripting.Dictionary and instantiated with New Scripting.Dictionary. On top of that, I corrected the reference in the INI-file process but the unchanged VBP-file process mangled the data without any warning.
But I do not want to dwell on this specific incident other than to say that I resorted to Bing's Copilot to discover that Scripting.Dictionary does NOT have a default method/property. But VB6 thinks it does.
Needless to say, I have overcome the problem in tB by specifically using Dictionary.Item(itemname). So tB is following the rules, but that conflicts with the VB6-compatibility of tB.
So I want a thread where my target is twinBASIC, but the issues could be VBA or VB6 related. I don't know how many other people get stuck porting VB6 to tB. There might be many who simply stop and move away.
Some guidance will be appreciated on how to approach this from people with background who are active on Discord.
-
Jun 19th, 2024, 05:55 AM
#1840
Re: TwinBasic
The idea behind twinBASIC is there is no porting involved to just run VB6 projects as is, so if something is working in VB6 but not tB, that's absolutely something to report, with the only question being is it already a known issue. Just a quick search of GitHub issues is expected, nobody is going to be upset with you if you miss it, we all do. I don't think this one has been reported yet. (Note: If it runs in VBA but not VB6, after accounting for references, for now the VB6 behavior wins; in the future there may be a VBA compatibility mode). If possible, create a minimal example that reproduces the problem, that will get attention faster than bugs that take a lot of effort just to reproduce.
VB6 compatibility is more important than exactly following the rules, except in the case of relying on quirks like where VB6 is consistent on formally undefined behavior.
It's possible VB6 has a hard-coded recognition of something about Dictionary and assings the default item itself; this is something tB would replicate (though when, not sure, it wouldn't be the highest priority). It was recently discovered for instance that with the mouse events of certain ocx controls, VB6 recognizes the dispid then behind the scenes converts two ByVal args to ByRef, and pixels to scaled pixels; the result is incompatibility, fairly minor and easy to fix, but tB will eventually implement the same rewrite.
If you have any doubts, just ask... I ask all the time in Discord 'Bug or intentional' for something. But any working VB6 code not working in tB, besides narrow exceptions mainly related to pointers in API/typelib stuff, is a bug. Threads in this forum, GitHub issues, and Discord posts will all be seen. Discord is the most active; we're all chatting in there every day.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|