wow
Does it mean there's no more
will this (beta-)syntax disappear?Type t_type X as Long F as Function End Type Function t_Type.F() End Function
Things already developed in next version (1.9.16) out in few weeks
Methods inside UDT
Things I'm working on (for the next 2 or 3 thinBasic versions):Uses "console" Type tCircle Radius As Double lColor As Long Function getRadius() As Double Return Me.Radius End Function Function getColor() As Double Return Me.lColor End Function Function getArea() As Double Return Me.Radius * Me.Radius * 3.1416 End Function End Type Dim c1 As tCircle c1.Radius = 10 c1.lColor = Rgb(255, 0, 0) PrintL "---Circle data---" PrintL "Radius:", c1.getRadius PrintL "Color:", c1.getColor PrintL "Area:", c1.getArea WaitKey
- dynamic numeric arrays inside UDT (also static one, that is global to the same type or extended type)
- dynamic string arrays inside UDT (also static one, that is global to the same type or extended type)
- private/public properties/methods
Things I will work on:
- for each <item> in <array of items>
...
<item> will be a pointer to the current <array of items> item
next- UTF-8 support
- some sort of try/catch error handling
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
wow
Does it mean there's no more
will this (beta-)syntax disappear?Type t_type X as Long F as Function End Type Function t_Type.F() End Function
I think there are missing some Forum-sections as beta-testing and support
No, both will remain valid.
I usually try to always keep backward compatibility.
More options more freedom to program as you prefer.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
yeah both is fine...
So how will this "For Each ... In ..." work?
I suspect like
or some more "pointer-accentuated" ?Dim X(123) As t_Type Local vX As t_Type At { Varptr(X(1)) | 0 } For Each vX In X ' vX is now layover on X(whatever) ? vX.DoSomething() Next 'For Each [Local] vX [As t_Type] In X ...?
Last edited by ReneMiner; 13-01-2015 at 23:35.
I think there are missing some Forum-sections as beta-testing and support
Yes but all automatic.
The idea is that programmers will not declare anything other than the array.
<item> will be automatically created/destroyed and will be valid just inside the for/next.
vX will not exist before for/each loop and will not exist after.Dim X(123) As t_Type For Each vX In X ' vX is now layover on X(whatever) ? vX.DoSomething() Next
At every for/next iteration vX will transparently be a PTR to the current element of X
When the loop ends, vX will be de-allocated.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
sounds good. less typing.
So i will wait for 1.9.16 to appear - current idea is some replacement for visual designer. At the time it creates code for all-in-one files but the problem is- if want to change the dialogs layout, add or move controls there's no way to load the script into the designer and to alter controls.
Visual basic solved this with a separate form-file which describes only the form-layout & placed controls. Now i thought of some way to exclude the layout-stuff & ControlIDs into a separate unit-file that only this data is easy to exchange without havig to re-arrange the whole script.
Probably it'll need some pre-defined base-UDT for UI-dialogs and controls...
currently i can simply add the callback functions name like "cWindow.WinProc" and inside callback place a layover at the pointer stored in dialogs user-slot #1.
So for the above in your first post described syntax: how can i add the callback-functions name then? Will i need to use the old/current syntax here?
Can the callback-function-entry-points be passed to UI-controls on creation as function-Ptr instead of a string containing function-name?
How to request udt-function-pointers for new syntax?
That's why i think of some very first built-in UDT with a function, and it's a callback on top of it:
and all the user has to do is now to Dim his stuff As UI-tWindowsControl or as a type that extends it.Type UI_tWindowsControl hndl As { DWord | Long } ' either hDlg or hCtrl hParent As { DWord | Long } ' obvious then Callback Function CBDEFAULT() End Function End Type
Controls- & Dialogs User-slot 1 has to be used mandatory to hold the pointer of the data-structure - then ME inside callback can be created by "UI-core"?
Last edited by ReneMiner; 14-01-2015 at 13:07.
I think there are missing some Forum-sections as beta-testing and support
Hi René,
I do no think for/each will be by next version.
Next version will have for sure complete TYPE definition inside TYPE/END TYPE including methods.
I think there will be also private/public modification.
Regarding callbacks as type methods ... I tried a lot of possible solutions but not found other way to store ME than using DIALOG USER ptr.
Problem with callbacks is that control of that kind of functions is passed to the operating system in/out and using an interpreted language is not easy to get back info.
Check my example of this in \thinBasic\SampleScripts\OOP\Example_250_cWindow.tbasic
I think it is not bad.
trick is to use the following to set ME:
and the following to get back ME in callbackDialog Set User hDlg, 1, VarPtr(Me)
Local pMe As cWindow At Dialog_GetUser(CBHNDL, 1)
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Home Desktop : Windows 7 - Intel Pentium (D) - 3.0 Ghz - 2GB - Geforce 6800GS
Home Laptop : WinXP Pro SP3 - Intel Centrino Duo - 1.73 Ghz - 2 GB - Intel GMA 950
Home Laptop : Windows 10 - Intel(R) Core(TM) i5-4210U CPU @ 1.70GHz, 2401 Mhz, 2 Core(s), 4 Logical Processor(s) - 4 GB - Intel HD 4400
Work Desktop : Windows 10 - Intel I7 - 4 Ghz - 8GB - Quadro Fx 370
, I like programming language contamination.
Maybe I can add: "this" as alias of "me"
I will see what I can do.
www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000
Bookmarks