PDA

View Full Version : [Beta] thinBasic Beta 1.9.9.0



ErosOlmi
15-10-2013, 22:36
thinBasic Beta 1.9.9.0

Download from: http://www.thinbasic.biz/projects/thinbasic/thinBasic_1.9.9.0.zip

This is a real Beta in the sense there is a lot of new features all (more or less) to be finished and fully documented.
So, please use this version only for testing and not for real production scripts.

Have a look and please report any impression/problem/likes always remembering it is a beta!!!!!


This update is a kind of thinBasic milestone: User Defined Types (UDTs) have now the possibility to have UDT Functions inside the in a way they start to mimic OOP for some aspects.
Have a look at \thinBasic\SampleScripts\OOP\ for few examples on how to use the new functionality
This will open a complete new way to program into thinBasic and more OOP features will come in next release.
Example:

Uses "console"

'-----------------------------------------------
'-----------------------------------------------
Type mySubType
a As Long
b As Long
lSum As Function
End Type

Function mySubType.lSum() As Long
Function = Me.A + Me.B
End Function

'-----------------------------------------------
'-----------------------------------------------
Type myType
A As Long
B As Long

C As mySubType

'---Functions
Init As Function
Multiply As Function
End Type

Function myType.Multiply() As Long
Function = Me.A * Me.B
End Function

Function myType.Init(ByVal A As Long, ByVal B As Long) As Long
Me.A = A
Me.B = B
Me.C.A = A * 10
Me.C.B = B * 10
End Function

'-----------------------------------------------
'-----------------------------------------------

Long lRet
Dim mt As myType

mt.Init(10, 20)

PrintL "SizeOf mt =", SizeOf(mt)
PrintL "SizeOf mt.C =", SizeOf(mt.C)


PrintL "mt.Multiply =", mt.Multiply
PrintL "mt.C.Sum =", mt.C.lSum
PrintL "----------------------------"

'---Some speed test in order to try to reduce timing
Double T1, T2
Long MaxLoop = 1000000
PrintL Expand$ "LOOPING $MaxLoop mt.Multiply ... please wait"

T1 = Timer
For Counter As Long = 1 To MaxLoop
mt.Multiply
Next
T2 = Timer

PrintL Format$(T2 - T1, "#0.000") & " seconds"
PrintL "----------------------------"
'---

PrintL "----------------------------"
PrintL "All done, press a key to end"
WaitKey


I've also created a new module called ADODB. This module implements databases connection and data handling.
For the moment I've partially implemented 2 classes: ADBODB_Connection, ADODB_Recordset.
More info looking at sample script at \thinBasic\SampleScripts\ADODB\

Also implemented Button control adding Name option and added the following automatic callback events:


<ButtonName>_OnSetFocus
<ButtonName>_OnKillFocus
<ButtonName>_OnDisable
<ButtonName>_OnClick


Fixed XPButton
Fixed few TBASS functions


Fixed other bugs.

List of changes can be found in Help file distributed with the product.


Known bugs:
among others (I hope not so many) I know there is a bug in this version when creating bundled exe. Some process can sometimes fail due to incorrect TOC inside Exe. I'm working on solving this problem asap.


Ciao.
Eros

Billbo
16-10-2013, 01:36
Eros,

Could you possibly provide a zipped or 7z version of the
program that does not require installation?

Thanks,

Bill

ErosOlmi
16-10-2013, 07:09
Hi Bill,

problem is that thinBasic and thinAir need some registry configuration in order to properly work and this is done by installation process.

Are easy and simple registry setup but important:

install path of thinBasic HKLM\SOFTWARE\ThinBasic\InstallPath
Without this setup thinAir will not know where to execute thinBasic.exe from and you will have to setup it manually inside thinAir configuration
registration of some file extensions and how they need to be handled by Explorer. Extensions like: .tbasic, .tbasicc, .tbasicx, .tbasiccx, .tbasici, .tbasicu, .tacont, .taguit, .tproject, ...
Without this registry setup, all thinBasic files will be ... isolated, without any icon and double click on such files in Explorer will nlt produce any effect.


The rest of thinBasic distribution files are just "portable" with a copy/paste process.

Anyway, I will see what I can do.
Maybe I can create a portable installation plus a little optional setup that will just adjust the registry.
In any case, sorry but it is not something I have time to do right now due to my current job workload:give me some days.

Ciao
Eros

Below current registry setup performed by thinBasic installation process:


[Registry]
;install path
Root: HKLM; Subkey: SOFTWARE\ThinBasic; ValueType: string; ValueName: InstallPath; Flags: noerror CreateValueIfDoesntExist DeleteValue; ValueData: {app}\;


;tbasic
Root: HKCR; SubKey: .tBasic; ValueType: string; ValueName: ; ValueData: thinBasic.Script.File; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Script.File; ValueType: string; ValueName: ; ValueData: thinBasic.Script.File; Flags: uninsdeletekey
Root: HKCR; Subkey: thinBasic.Script.File\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinBasic.exe,0"; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Script.File\shell\Open\command; ValueType: string; ValueData: "{app}\thinBasic.exe ""%1"""; Flags: uninsdeletekey;
Root: HKCR; SubKey: thinBasic.Script.File\shell\Edit\command; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe ""%1"""; Flags: uninsdeletekey;
Root: HKCR; SubKey: thinBasic.Script.File\shell\thinDebug\command; ValueType: string; ValueData: "{app}\thinBasic.exe @D ""%1"""; Flags: uninsdeletekey;


;tbasicc
Root: HKCR; SubKey: .tBasicc; ValueType: string; ValueName: ; ValueData: thinBasic.Console.Script.File; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Console.Script.File; ValueType: string; ValueName: ; ValueData: thinBasic.Console.Script.File; Flags: uninsdeletekey
Root: HKCR; Subkey: thinBasic.Console.Script.File\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinBasicc.exe,0"; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Console.Script.File\Shell\Open\Command; ValueType: string; ValueData: "{app}\thinBasicc.exe ""%1"""; Flags: uninsdeletekey;
Root: HKCR; SubKey: thinBasic.Console.Script.File\Shell\Edit\Command; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe ""%1"""; Flags: uninsdeletekey;
Root: HKCR; SubKey: thinBasic.Console.Script.File\Shell\thinDebug\Command; ValueType: string; ValueData: "{app}\thinBasicc.exe @D ""%1"""; Flags: uninsdeletekey;


;tbasicx
Root: HKCR; SubKey: .tBasicx; ValueType: string; ValueName: ; ValueData: thinBasic.Script.File.Crypt; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Script.File.Crypt; ValueType: string; ValueName: ; ValueData: thinBasic.Script.File.Crypt; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Script.File.Crypt\Shell\Open\Command; ValueType: string; ValueData: "{app}\thinBasic.exe ""%1"""; Flags: uninsdeletekey;
Root: HKCR; Subkey: thinBasic.Script.File.Crypt\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinBasic.exe,0"; Flags: uninsdeletekey


;tbasiccx
Root: HKCR; SubKey: .tBasiccx; ValueType: string; ValueName: ; ValueData: thinBasic.Console.Script.File.Crypt; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Console.Script.File.Crypt; ValueType: string; ValueName: ; ValueData: thinBasic.Console.Script.File.Crypt; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Console.Script.File.Crypt\Shell\Open\Command; ValueType: string; ValueData: "{app}\thinBasicc.exe ""%1"""; Flags: uninsdeletekey;
Root: HKCR; Subkey: thinBasic.Console.Script.File.Crypt\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinBasicc.exe,0"; Flags: uninsdeletekey


;tbasici
Root: HKCR; SubKey: .tbasici; ValueType: string; ValueName: ; ValueData: thinBasic.Include.File; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Include.File; ValueType: string; ValueName: ; ValueData: thinBasic.Include.File; Flags: uninsdeletekey
Root: HKCR; Subkey: thinBasic Include.File\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinAir\thinAir.exe,4"; Flags: uninsdeletevalue
Root: HKCR; SubKey: thinBasic.Include.File\Shell\Open\Command; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe ""%1"""; Flags: uninsdeletevalue;


;tbasicu
Root: HKCR; SubKey: .tbasicu; ValueType: string; ValueName: ; ValueData: thinBasic.Unit.File; Flags: uninsdeletekey
Root: HKCR; SubKey: thinBasic.Unit.File; ValueType: string; ValueName: ; ValueData: thinBasic.Unit.File; Flags: uninsdeletekey
Root: HKCR; Subkey: thinBasic.Unit.File\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinAir\thinAir.exe,5"; Flags: uninsdeletevalue
Root: HKCR; SubKey: thinBasic.Unit.File\Shell\Open\Command; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe ""%1"""; Flags: uninsdeletevalue;


;tproject
Root: HKCR; SubKey: .tproject; ValueType: string; ValueName: ; ValueData: thinAir project file; Flags: uninsdeletekey
Root: HKCR; SubKey: thinAir project file; ValueType: string; ValueName: ; ValueData: thinAir project file; Flags: uninsdeletekey
Root: HKCR; SubKey: "thinAir project file\Shell\Open\Command"; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe ""%1"""; Flags: uninsdeletevalue;
Root: HKCR; Subkey: thinAir project file\DefaultIcon; ValueType: string; ValueName: ; ValueData: "{app}\thinAir\thinAir.exe,0"; Flags: uninsdeletevalue


;---Console Template
Root: HKCR; SubKey: .tacont; ValueType: string; ValueData: "thinAir Console Template"; Flags: uninsdeletekey CreateValueIfDoesntExist DeleteValue;
Root: HKCR; SubKey: "thinAir Console Template"; ValueType: string; ValueData: "thinAir Console Template"; Flags: uninsdeletekey CreateValueIfDoesntExist DeleteValue;
Root: HKCR; SubKey: "thinAir Console Template\DefaultIcon"; ValueType: string; ValueData: {app}\thinAir\thinAir.exe,6; Flags: uninsdeletevalue CreateValueIfDoesntExist DeleteValue;
Root: HKCR; SubKey: "thinAir Console Template\Shell\Open\Command"; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe """"%1"""""; Flags: uninsdeletevalue CreateValueIfDoesntExist DeleteValue;


;---GUI Template
Root: HKCR; SubKey: .taguit; ValueType: string; ValueData: "thinAir GUI Template"; Flags: uninsdeletekey CreateValueIfDoesntExist DeleteValue;
Root: HKCR; SubKey: "thinAir GUI Template"; ValueType: string; ValueData: "thinAir GUI Template"; Flags: uninsdeletekey CreateValueIfDoesntExist DeleteValue;
Root: HKCR; SubKey: "thinAir GUI Template\DefaultIcon"; ValueType: string; ValueData: {app}\thinAir\thinAir.exe,7; Flags: uninsdeletevalue CreateValueIfDoesntExist DeleteValue;
Root: HKCR; SubKey: "thinAir GUI Template\Shell\Open\Command"; ValueType: string; ValueData: "{app}\thinAir\thinAir.exe """"%1"""""; Flags: uninsdeletevalue CreateValueIfDoesntExist DeleteValue;

Billbo
16-10-2013, 15:27
Eros,

I sure thank you for your detailed reply. I like what
you suggest.

I also appreciate your efforts.

Thanks very much,

Bill

RobbeK
16-10-2013, 15:55
Thanks Eros,
I'm sure it makes writing complex programs a lot easier ..
Rob

Petr Schreiber
16-10-2013, 18:37
The OOPifiq addition also makes the creation of reusable, self contained code units easier. It is huge step forward!


Petr

Michael Hartlef
17-10-2013, 10:45
That looks great. I love OOP style languages. Thanks for all the effort you guys put into thinBasic.