-
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
aboutesigned 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
New 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
New 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
New 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/
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
|