Page 1 of 2 12 LastLast
Results 1 to 10 of 13

Thread: thinBasic 1.9.xx vaporware

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    thinBasic 1.9.xx vaporware

    Things already developed in next version (1.9.16) out in few weeks

    Methods inside UDT
    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
    
    Things I'm working on (for the next 2 or 3 thinBasic versions):
    • 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

  2. #2
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170
    wow

    Does it mean there's no more

    Type t_type
      X as Long 
      F as Function
    End Type
    
    Function t_Type.F()
    
    End Function
    
    will this (beta-)syntax disappear?
    I think there are missing some Forum-sections as beta-testing and support

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    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

  4. #4
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170
    yeah both is fine...

    So how will this "For Each ... In ..." work?

    I suspect like

    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 ...?
    
    or some more "pointer-accentuated" ?
    Last edited by ReneMiner; 13-01-2015 at 23:35.
    I think there are missing some Forum-sections as beta-testing and support

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    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.

    Dim X(123) As t_Type
     
    For Each vX In X
      ' vX is now layover on X(whatever) ?
      vX.DoSomething()
    Next
    
    vX will not exist before for/each loop and will not exist after.
    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

  6. #6
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170
    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:

    Type UI_tWindowsControl
      hndl As { DWord | Long } ' either hDlg or hCtrl
      hParent As { DWord | Long } ' obvious then
    
      Callback Function CBDEFAULT()
      End Function
    End Type
    
    and all the user has to do is now to Dim his stuff As UI-tWindowsControl or as a type that extends it.
    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

  7. #7
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    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:
    Dialog Set User hDlg, 1, VarPtr(Me)
    
    and the following to get back ME in callback
    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

  8. #8
    thinBasic MVPs
    Join Date
    May 2007
    Location
    UK
    Posts
    1,427
    Rep Power
    159

    Question Too C or not to C that is the question!

    Quote Originally Posted by ErosOlmi View Post
    Things already developed in next version (1.9.16) out in few weeks

    Methods inside UDT
      Function getRadius() As Double
        Return Me.Radius
      End Function
    
    I'm loving the new functionality but have a question about the use of "me.radius" wouldn't "this.radius" be a better syntax much like its use in c.

    Mike C.
    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

  9. #9
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10
    , 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

  10. #10
    thinBasic MVPs
    Join Date
    Oct 2012
    Location
    Germany
    Age
    54
    Posts
    1,529
    Rep Power
    170
    Quote Originally Posted by ErosOlmi View Post
    , I like programming language contamination.
    Maybe I can add: "this" as alias of "me"
    I will see what I can do.
    and "object" as alias of "type" ?
    I think there are missing some Forum-sections as beta-testing and support

Page 1 of 2 12 LastLast

Similar Threads

  1. Vaporware: what will come after 1.7...
    By ErosOlmi in forum thinBasic vaporware
    Replies: 11
    Last Post: 09-12-2008, 08:37
  2. WMI module: some preview vaporware
    By ErosOlmi in forum WMI
    Replies: 10
    Last Post: 15-10-2007, 16:33
  3. Another new vaporware: multiline strings
    By ErosOlmi in forum thinBasic vaporware
    Replies: 7
    Last Post: 08-10-2007, 16:00
  4. Replies: 25
    Last Post: 20-09-2007, 17:57
  5. My word count program is vaporware
    By sandyrepope in forum thinBasic General
    Replies: 17
    Last Post: 31-05-2007, 20:04

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •