FYI - https://github.com/twinbasic/twinbasic/issues/1713
Printable View
twinBASIC status update:
twinBASIC Update: November 5, 2023
Highlights include a major overhaul of twinBASIC's internals, support for "destructuring assignment", and a VBA UserForm to tB converter.
nolongerset.com/twinbasic-update-november-5-2023/
With regard to the look and feel of a TB app, I'll admit to preferring the pure VB6 graphical forms for the checkbox and radio buttons. I also have a pet hate for thin disappearing scrollbars, so deeply hoping it won't subject us to those.
The CheckBox and Radio Button are just thin wrappers over their Win32 Common Controls, just like VB6. The only differences would be that tB enables comctl6 and visual styles by default, but you can turn those off, or use them in VB6 (I do), and that some people use compatibility shims for VB6, which you could use for tB exes if you really wanted to. But those aren't by default in VB6.
For an existing project, delete the manifest under resources in Project Explorer, and for new ones, uncheck the 'Use Visual Styles' box when it shows up on creation.
DPI awareness impacts how controls look too, and tB enables it by default, but you can select 'NONE' in new projects (I recommend this for VB6 imports if you don't have code explicitly supporting it), and in existing projects, in Settings scroll down to Project: Force DPI awareness at startup then check then box and set the dropdown to 'NONE'.
Having your tB apps look identical to VB6 is just a matter of disabling settings designed to drag you into the modern era :D
(Though IMHO 'modern era' for DPI awareness is that for 99% of apps, system scaling is good enough)
Additionally, tB support Visual Styles *per control*. So if you prefer them for some controls but not others, you can mix and match. This a designer property like where Text or Caption is... VisualStyles.
Very good.
twinBASIC status update:
twinBASIC Update: November 12, 2023
Highlights include more VB6-like IntelliSense added to the debug console, upcoming help improvements, and a twinBASIC follower milestone.
nolongerset.com/twinbasic-update-november-12-2023/
twinBASIC status update:
twinBASIC Update: November 19, 2023
Highlights include an overhaul of the IntelliSense system, a project to get full paths of all running processes, and a new Kernel Mode Support Package.
nolongerset.com/twinbasic-update-november-19-2023/
add in project can;'t load:
sorry this menu options has not been implemented yet
twinBASIC status update:
twinBASIC Update: November 26, 2023
Highlights include foundational work on the forthcoming Edit & Continue feature and a new wiki page documenting the twinBASIC compiler constants.
nolongerset.com/twinbasic-update-november-26-2023/
twinBASIC status update:
twinBASIC Update: December 3, 2023
Highlights include an update on "Edit & Continue" development progress, a new Auto-Save tB add-in, and the discovery of twinBASIC's potential downfall.
nolongerset.com/twinbasic-update-december-3-2023/
A poll asking if you would pay for a license for VB today? Or TwinBasic or RADBasic ?
If-VB-was-still-alive-&-updated-today-would-you-pay-for-a-license-POLL
twinBASIC status update:
twinBASIC Update: December 10, 2023
Highlights include an extended discussion on the possibility of open-sourcing some or all of twinBASIC in the future, plus a Linebreak Repair utility from fafalone.
nolongerset.com/twinbasic-update-december-10-2023/
Thanks for these!
May I ask how to get the contents of a text file added to the twinbasic project?
Sure, just right click project name in the project explorer (the parent of all the subfolders, just above ImportedTypeLibraries), then choose Add->Import file. That allows importing any kind of file and just adds it to the project as text/plain binary if it's not a recognized type.
For example I have several plain text files (.md is just plain text with markdown that GitHub uses) in tbShellLib:
https://www.vbforums.com/images/ieimages/2023/12/8.jpg
These can be edited right in the IDE.
(If this isn't what you mean, please clarify)
I mean how to code to read the text file contents.
Oh, the same way you would in VB6. tB fully supports the Open syntax, or file APIs, or the FileSystemObject.
For example,
Code:Public Function LoadFile(ByVal FileName As String) As String
Dim hFile As Long
On Error GoTo Hell
hFile = FreeFile
Open FileName For Binary As #hFile
LoadFile = Space$(LOF(hFile))
Get #hFile, , LoadFile
Close #hFile
Hell:
End Function
thx for you kind help. the other question is how to know methods/functions inside a twin package downloaded from package server.eg I loaded the CSharpishStringFormater to the project.but I do not know what methods/function inside it .
You can browse the source through the project explorer in the top left, under Packages:
https://www.vbforums.com/images/ieimages/2023/12/9.jpg
The 'Fmt' is the Library Symbol which you see listed next to the full name in the references settings where you added it:
https://www.vbforums.com/images/ieimages/2023/12/10.jpg
got it and thx for you help. i have been stuck with this problem for a long time.
You're welcome. Any other questions, don't be afraid to ask.
For language issues remember-- tB is backwards compatible with VB6, so code to do something in that should work in tB.
You can also find a lot of tB-specific information on the project's GitHub Wiki, and the main repository or language design repository, both under Issues and Discussions.
I have no further comment on language design.here just my suggestions about tb as a user.multline strings and formatted strings(using variables in strings) are both used in other languages.i think it's necessary to bring them into tb.Addtionally ,vb array is too limited.js array is a good example for ease of use tb could learn from.
You can already have multiline strings...
and you can have variables in a string...Code:Dim s As String = "Line 1" & vbCrLf & _
"Line 2" & vbCrLf & _
"Line 3 & vbCrLf & _
...
Or Replace() to replace variables with their contents; Format$() tp apply certain formatting options (or LCase, UCase, Left, Right, Mid...)...Code:Dim x As Long = 1
Dim s As String = "x = " & x
There is a proposal to make multiline easier, without the line continuation chars.
Not sure if you mean something different?
tB recently got some new array functionality over VB6:
This feature allows you to assign the contents of an array to multiple variables in a single line:
This would print 1 2 3. You could also assign multiple variables at once like this and get the same result:Code:Dim a As Long, b As Long, c As Long
Dim d(2) As Long
d(0) = 1
d(1) = 2
d(2) = 3
Array(a, b, c) = d
Debug.Print a, b, c
Code:Dim a As Long, b As Long, c As Long
Array(a, b, c) = Array(1, 2, 3)
Debug.Print a, b, c
If you download the VB6 decompiler, you can see almost 100% of the source code It's just a variable, and the name is random. If you use the database password in the source code or the registration code that the software needs to log in and register, you can see it all. So for now, VB6 is not safe. The main problem with not learning VB. Net for so many years is that 100% of its source code can be decompiled.
There is no Chinese version of twinbasic at present. I hope it can be provided.
When compiling or opening the project, twinbasic is still very slow, but many of its functions are very advanced and can solve 80% of our problems.
One way I say it is. I have 500 modules in a folder. There are also 100 control CTL files, and I often have to develop a lot of gadgets.
I want these shared modules to be placed in a folder so that different projects can reference them directly without copying them to a new project directory.
What I don't like most is that it's all merged into a separate project file.
I hope that a window can be added directly in the IDE, and you can post by clicking it.Receive a forum to see all the stickers you send, so you can do everything directly in an idE.
twinBASIC status update:
twinBASIC Update: December 17, 2023
Highlights include a new twinBASIC project to allow easy input filtering of text boxes and the renaming of the tbShellLib project to reflect its expanded scope.
nolongerset.com/twinbasic-update-december-17-2023/
how to make change language package?
Code:<div id="rootMenu1Inner">
<div class="menuItem" id="rootMenuFile">文件</div>
<div class="menuItem" id="rootMenuEdit">编辑</div>
<div class="menuItem" id="rootMenuView">视图</div>
<div class="menuItem" id="rootMenuProject">Project</div>
<div class="menuItem" id="rootMenuFormat">Format</div>
<div class="menuItem" id="rootMenuDebug">Debug</div>
<div class="menuItem" id="rootMenuRun">Run</div>
<div class="menuItem" id="rootMenuTools">工具</div>
<div class="menuItem" id="rootMenuAddins">Add-Ins</div>
<div class="menuItem" id="rootMenuWindows">Window</div>
<div class="menuItem" id="rootMenuHelp">帮助</div>
<div class="icon playIconBlue" id="playIcon" title="Start / Continue (F5)"></div>
<div class="icon iconType2" id="pauseIcon" title="Break Into Code (Ctrl+Break)"></div>
<div class="icon stopIconRed" id="stopIcon" title="Stop"></div>
<div class="icon iconType2" id="debugStepOverIcon" title="Step Over (F10 or legacy Shift+F8)"></div>
<div class="icon iconType2" id="debugStepIntoIcon" title="Step Into (F11 or legacy F8)"></div>
<div class="icon iconType2" id="debugStepOutIcon" title="Step Out (Shift+F11 or legacy Ctrl+Shift+F8)"></div>
<div class="icon iconType2" id="runOrPreviewIcon" title="Run the code at the cursor position / Preview the form (F6)"></div>
Is just saving the new version not working?
twinBASIC status update:
twinBASIC Update: December 24, 2023
Highlights include an updated twinBASIC roadmap, a sneak peek at upcoming IDE menu and docking improvements, and RadioMan - a new tB project from fafalone.
nolongerset.com/twinbasic-update-december-24-2023/
time flies and it has been a long time since release 423.really look forward to the new release.
hello,fafalone. in tb console app the keyword "App" does not work .is there any method to get the consoleApp's path ?
In the Settings for the project, go to the 'Library References' section, and under Available Packages, add the 'VB Compatibility Package'
It's not enabled by default since it's mostly just the Forms and controls, but as long as you don't try to actually add a form it should be fine to use it for the app object.
There's a Windows API solution too, if you're never going to be worried about cross-platform, but it won't use the last compile path when running from the IDE:
Code:Public DeclareWide PtrSafe Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameW" (ByVal hModule As LongPtr, ByVal lpFileName As String, ByVal nSize As Long) As Long
Public Sub Main()
Dim sPath As String, cch As Long
sPath = String$(260, 0)
cch = GetModuleFileName(0, sPath, 260)
If cch Then
sPath = Left$(sPath, cch)
sPath = Left$(sPath, InStrRev(sPath, "\")) 'Remove filename.exe
Else
sPath = "" 'Error
End If
Api solution seems simple and clean.thx.
twinBASIC status update:
twinBASIC Update: December 31, 2023
A quiet week of development with a fascinating conversation on Wayne's decision to write a custom compiler rather than transpile twinBASIC into C/C++.
nolongerset.com/twinbasic-update-december-31-2023/
I created a standard dll, put it in the twinbasic project folder and declared the dll in the code, but nothing happens.Prompt unable to load DLL,Even if the DLL is located in the project folder, the program still needs the full path,There is no problem in VB6, but the full path needs to be declared in TB,I don't know what the problem is
Yeah there's some issues with that right now.
Putting [ SetDllDirectory(True) ] before the first-called API declare usually works (on the line before Public Declare...), if not then in the startup routine before calling anything,
Private DeclareWide PtrSafe Function SetDllDirectory Lib "kernel32" Alias "SetDllDirectoryW" (Optional ByVal lpPathName As String) As Long
SetDllDirectory App.Path
Because of VB6's declaration of these DLL APIs, VB6 internally has a special loading tool, dllcallfunction. Automatically detect whether there is a DLL in the current directory or system directory
It is possible that twinbasic will only check system directories.So when the program starts to run, it is better to locate the DLL directory to the folder where the current software is located.
If your DLL is not put here, and put in the system directory, I do not know if it can be found.
Thank you for Fafalone's specific code example. I have successfully applied it to solve my problem. I also want to thank Xiao Yao for providing ideas, which have greatly helped me understand this issue. If the DLL is placed in the system directory, tb can find it. By default, there may be some issues with the tb check project folder. Tb may only check the system directory.
Wayne has teased us with a screenshot of the latest twinBASIC IDE
Attachment 189756
Unlike explicit loading, the DLL is automatically called when the application starts running, and the system searches the dynamic library from the following path by default (MSDN description): 1. The directory containing the EXE file, 2. The current working directory of the process, 3. Windows system directory, 4. Windows directory, 5. A list of directories listed in the Path environment variable
Use SetDllDirectory, AddDllDirectory, and SetDefaultDllDirectories in kernel32.dll SetDll Directory is used to specify the set system search path AddDllDirectory is used to submit all the paths of the system defined by the user The key is SetDefaultDll Directories, which is used to specify the type of all required paths. Fill in here.
No twinBASIC status update today.
Instead here is: Archive Collection: DevCon 2023
https://nolongerset.com/archive-devcon-2023/
with twinBASIC Update: DevCon 2023
https://nolongerset.com/devcon-2023-tb/
twinBASIC now has its own forum on VBForums :D
www.vbforums.com/forumdisplay.php?108-TwinBASIC
twinBASIC status update:
twinBASIC Update: January 14, 2024
Highlights include a dedicated twinBASIC forum at VBForums, new teaser images from this Friday's upcoming beta release, and several projects from fafalone.
nolongerset.com/twinbasic-update-january-14-2024/
Have you considered how TwinBasic will handle cross-platform compilation, especially regarding graphics, given that VB6 relies heavily on Windows-specific APIs like GDI, and what are your thoughts on the proposed "cross" mode, limiting features to those compatible with all platforms?
twinBASIC status update:
twinBASIC Update: January 21, 2024
Highlights include a minor delay of the long-awaited twinBASIC IDE update, a new twinBASIC FAQ page, and several new and updated tB projects from fafalone.
nolongerset.com/twinbasic-update-january-21-2024/
After 20 years of.net not supporting the creation of OCX, Microsoft is still too unreliable to trust the company. It would be perfect if twinbasic could write C # VB. Net that code. The net compiler comes with the system and is supported across platforms. If you can directly compile the corresponding file (*.cs.vb) into a DLL, TLB file, twinbasic, which can be directly referenced, you can also turn the control created by.net into a twinbasic control and compile it into OCX for VB6 to use.
.net core winform(Someone wrote a simpler version of the same interface themselves.)Someone wrote a simpler version of the same interface themselves. So that it can be used across platforms.
cairo ui controls,by rc6.dll
(button,listbox,textbox......)
web ui(input,text area,)
gtk controls
?These can be implemented and invoked across platforms.
The long awaited new release of twinBASIC is now available.
See www.vbforums.com/showthread.php?902460-New-release-of-the-twinBASIC-programming-IDE
Note: This is a PREVIEW of the significant changes made over the last two months. Regressions are EXPECTED at this stage.
Releases 427, 428, 429, 430, 431 and 432 of twinBASIC are now available...
www.vbforums.com/showthread.php?900178-twinBASIC-programming-Beta-releases
github.com/twinbasic/twinbasic/releases
Buy Wayne a coffee to help support all his work on twinBASIC...
https://ko-fi.com/twinbasic
twinBASIC status update:
twinBASIC Update: January 28, 2024
Highlights include ... ah, never mind. The new twinBASIC IDE is here!!!! Plus: static linking, experimental type inference, 20-30% reductions in exe sizes, and more!
nolongerset.com/twinbasic-update-january-28-2024/
Does TB support interacting with 64bit Office? If I am limited to using the 64 bit version of the Database Access Engine, will using TB allow me to use the following provider?
I did a quick 'import' of my little project but encountered 'Run-time error 3706 (00000E7A) Application-defined or object-defined error' when opening the recordset using the above connectionstring.Code:Provider=Microsoft.ACE.OLEDB.12.0;Data Source=Employees.accdb;Persist Security Info=False;
Yes, it should work. You'll need to ensure that you haven't got a reference to DAO in your project references, and instead reference "Microsoft Office X.0 Access database engine" (where X is the Office version number you have installed).
I think I may not have described the problem clearly. I have a Microsoft Access database (.accdb) and I need to install the 32bit Access Database Engine to be able to access the database. But since I have a 64-bit Microsoft Office then I cannot install the 32bit Access Database Engine. With TB, can I instead use the 64bit Access Database engine? The engine is being called by the ADO, it is not something that I reference in VB6.
Attachment 190353
I am just wondering if I can find a workaround using TB. My other option is just to export the Access database to MySQL and connect to that MySQL.
I have an Access 2000 database that I opened in twinBASIC and ran a query using this code:
I used this code to check the version to be sureCode:Private Sub Command1_Click()
Dim cn As New ADODB.Connection
Dim strCon As String
Dim rs As ADODB.Recordset
Dim SQL As String
strCon = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=F:\cp-pms.mdb;"
cn.Open strCon
SQL = "Select * from [Project Header]"
Set rs = New ADODB.Recordset
rs.ActiveConnection = cn
rs.CursorLocation = adUseClient
rs.Open SQL
MsgBox("Project Name: " & rs(1))
rs.Close()
Set rs = Nothing
cn.Close
Set cn = Nothing
End Sub
edit: added screenshot of reading db (showing the DB opened in Access 2007 in my XP VM as the background) twinBASIC v434, is running in Windows 11 ProCode:Private Sub Command2_Click()
Dim objAccess As New Access.Application
Dim intFormat As Integer
objAccess.OpenCurrentDatabase "F:\cp-pms.mdb"
intFormat = objAccess.CurrentProject.FileFormat
Select Case intFormat
Case 2
MsgBox("Microsoft Access 2")
Case 7
MsgBox("Microsoft Access 95")
Case 8
MsgBox("Microsoft Access 97")
Case 9
MsgBox("Microsoft Access 2000")
Case 10
MsgBox("Microsoft Access 2003")
End Select
objAccess.Quit()
Set objAccess = Nothing
End Sub
twinBASIC status update:
twinBASIC Update: February 4, 2024
Highlights include two newly commissioned features (BigNumber support and a web page IDE panel) and a tB IDE comment/uncomment add-in.
nolongerset.com/twinbasic-update-february-4-2024/
Yes, you can use the 64bit engine from twinBASIC. You need to have the compiler in 64bit mode obviously, with all the caveats that apply to VBA 64bit with LongPtr/PtrSafe.
I have 64bit Office installed as well, you can see in twinBASIC I have the reference available to use:
Attachment 190368