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
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