Page 1 of 24 12311 ... LastLast
Results 1 to 10 of 236

Thread: thinBasic 1.11.x.x

  1. #1
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    54
    Posts
    8,636
    Blog Entries
    2
    Rep Power
    10

    thinBasic 1.11.x.x

    thinBasic 1.11.6.0 BETA TESTING update 2020/04/19

    DOWNLOAD URL: https://www.thinbasic.biz/projects/t...c_1.11.6.0.zip

    Added F12 or View/Maximize Edit menu to remove almost all thinAir distractions and remain focused on code editing
    Removed unnecessary tabs in output window, now only process monitor and runtime errors are there. Next will come when ready
    Fixed some theming problems
    Improved process monitor stability giving time to web browser control to load all its dependencies (DOM engine, javascript engine, ...) before using it.
    Petr documented WCon module
    Petr new calltips for TBGL
    fixed bug in TBGL which could cause crash in case of window dragging.
    beautified runtime error reporting and process monitoring
    button to minimize / maximize panel with Process / Runtime error
    insert code block did not respect cursor position
    unnecessary tabs removed, kept just Process / Runtime error
    unnecessary redraws of UI
    stability issues in thinAir
    Other minor changes

    https://www.thinbasic.com/public/products/thinBasic/help/html/version_1_11_3_0_version_1_11_6_0.htm



    thinBasic 1.11.5.0 BETA TESTING update 2020/04/11

    DOWNLOAD URL: https://www.thinbasic.biz/projects/t...c_1.11.5.0.zip

    Added process monitoring of scripts executed inside thinAir
    You will be able to monitor cpu and memory of the single process
    It is also possible to stop process from thinAir in case you loose control of your script.
    Again improved call tips and autocompletion. Those two aspects will be improved in next releases.

    https://www.thinbasic.com/public/pro...n_1_11_5_0.htm



    thinBasic 1.11.4.0 ALPHA TESTING update 2020/03/29

    DOWNLOAD URL: https://www.thinbasic.biz/projects/t...c_1.11.4.0.zip

    Improved autocompletion for UDT.
    Added support for me. using dotted notation. Me. inside and UDT recognize UDT elements

    https://www.thinbasic.com/public/products/thinBasic/help/html/version_1_11_3_0_version_1_11_4_0.htm



    thinBasic 1.11.3.0 ALPHA TESTING update 2020/03/23

    DOWNLOAD URL: https://www.thinbasic.biz/projects/t...c_1.11.3.0.zip

    Huge number of new features to test during those sad days: cDateTime, WCon, thinAir new CallTips.
    Also few fixes, see in What's New in help for the list
    Sorry not yet documented in details
    https://www.thinbasic.com/public/pro...n_1_11_3_0.htm

    To have an idea ... execute scripts in the following paths:
    • \thinBasic\SampleScripts\Classes\cDateTime\
    • \thinBasic\SampleScripts\WCon\





    thinBasic 1.11.3.0 released for ALPHA TESTING

    DOWNLOAD URL: https://www.thinbasic.biz/projects/t...c_1.11.3.0.zip

    Not yet finished but there is something to test.
    Beta version will follow



    thinBasic 1.11.2.0 released for BETA TESTING

    DOWNLOAD URL: https://www.thinbasic.com/downloads.html#downloads

    List of changes: https://www.thinbasic.com/public/pro...n_1_11_0_0.htm

    Didn't want to finish the year without releasing what was already almost ready to be checked and used so far.
    So here we are with a new release 1.11.2
    Have fun.


    thinBasic 1.11.1.0 released for BETA TESTING

    DOWNLOAD URL: https://www.thinbasic.com/downloads.html#downloads

    List of changes: https://www.thinbasic.com/public/pro...n_1_11_0_0.htm

    In this release many User Interface (UI) commands are now aware of UTF-8 strings and passed as unicode to UI windows and controls.
    Still many to change but seems we are n the right road.
    Check example in \thinBasic\SampleScripts\Unicode\Unicode Window Test.tbasic



    thinBasic 1.11.0.0 released for BETA TESTING

    DOWNLOAD URL: https://www.thinbasic.com/downloads.html#downloads

    Very excited about new features.
    I published the list of changes already developed but still to be documented: https://www.thinbasic.com/public/pro...n_1_11_0_0.htm


    Personally ... I started to love FreeBASIC more and more during the last months.
    Especially when I discovered that JoseRoca (one of my programmer idol) started to use FreeBASIC for his WinFBX project: https://github.com/JoseRoca/WinFBX

    Thinking to a strategy for going out from using Power Basic as main compiler used to develop ThinBASIC, I've come to the conclusion that FreeBASIC is the best choice:
    • syntax not far from Power Basic so source porting will not be a nightmare but just a matter of time
    • both 32/64 bits
    • rich set of functions
    • nice community that recently seems revamped
    • and other reasons


    Porting ThinBASIC to be developed using FreeBASIC will be a long long run:
    • just ThinBASIC main Core engine is about 320K lines of code! excluding include file not developed by me ... remains about 170K lines of code
    • than there will be all ThinBASIC modules to recode, other 80k lines
    • thinAir, other 150k lines of code
    • thinDebug, other 50K lines of code
    • ...

    So it will take some time.

    But what to do in the meantime?

    Thinking on how to start I've decided to see if integration of FreeBASIC and ThinBASIC could be possible at script level in order to immediately give advantages and new features to programmers using ThinBASIC and at the same time experiment with FreeBASIC. And the following is the result of this initial integration.

    In next ThinBASIC version 1.10.8, that I will release in a couple of weeks, you will see the first results of integration and interop: it will be possible to mix FreeBASIC and ThinBASIC source code into the same script and do not care about details. ThinBASIC will take care of it:
    • extracting FreeBASIC code into a source code that will be compiled on the fly by FreeBASIC compiler
    • producing a DLL with the same name of the ThinBASIC source code
    • silently declaring exported FreeBASIC functions/subs into ThinBASIC source code in order to use FreeBASIC functions as native ThinBASIC functions

    It will be even possible to create ThinBASIC compiled new modules directly from a ThinBASIC script.

    First tests are very exciting.

    The magic is done by a new pre-parsing directive block #Compiled and #EndCompiled used to surround FreeBASIC code inside a ThinBASIC code.
    Than programmer just need to declare the functions/subs that need to be visible by ThinBASIC source code as ... CDECL ... EXPORT
    The rest is automatic

    Here an example of FreeBASIC/ThinBASIC integration.
    #Compiled
    
      sub SayHelloFromFreeBasic cdecl alias "SayHelloFromFreeBasic" (byref sMessage as zstring) export
        print "Hi there. I'm FreeBASIC sub SayHelloFromFreeBasic"
        print "called from DLL:", sMessage
      end sub
    
    
    #EndCompiled
    
    
    uses "Console"
    
    
    '---------------------------------------------
    ' Thanks to thinBASIC autodetection,
    ' the FreeBasic function SayHelloFromFreeBasic is discovered automatically
    ' and can be used as native command
    '---------------------------------------------
    SayHelloFromFreeBasic(Compiled_DLL_FileName)
     
    printl "Press a key to end"
    waitKey
    
    Attachment 9976

    I've already tested almost all set of numeric data types passed both ByVal and ByRef.
    Also tested passing numeric arrays.
    Tested asciiz strings and I'm working on dynamic string and UDTs.

    After installation, please have a look at examples in \thinbasic\samplescripts\FreeBASIC\
    You will find interesting things over there and we can discuss for further improvements.


    Ciao
    Eros
    Last edited by ErosOlmi; 19-04-2020 at 14:43.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  2. #2
    Member
    Join Date
    Jan 2017
    Location
    changsha China
    Age
    29
    Posts
    72
    Rep Power
    12
    look forward to

    I saw that ThinBasic is trying to better integrate with FreeBasic, which is a good omen.

    I hope I can see this version soon.

    Good job

  3. #3
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,090
    Blog Entries
    5
    Rep Power
    727
    xLeaves,

    I think you will really enjoy the new release


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  4. #4
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    54
    Posts
    8,636
    Blog Entries
    2
    Rep Power
    10
    Petr Screiber is greatly helping me in testing, developing help, suggesting direction, fixing errors.


    Here another test using FreeBASIC functions passing numeric variable ByRef and ByVal and a numeric Array:

    uses "console"
    
    '----------------------------------------------------------------------------
    ' This example shows how to use FreeBASIC compiled functions from 
    ' thinBasic script without the need to DECLARE FreeBASIC functions as 
    ' expternal DLL functions.
    ' thinBasic will take care of it
    '----------------------------------------------------------------------------
      
    #Compiled
        '----------------------------------------------------------------------------
      ' Code inside #Compiled ... #EndCompiled will be compiled on the fly using FreeBASIC
      ' compiler into a DLL whose name is the same name of the script
        '----------------------------------------------------------------------------
    
    
        '----------------------------------------------------------------------------
      ' There can be multiple #Compiled ... #EndCompiled blocks
      ' thinBasic will take care to concatenate into a single FreeBASIC source code 
      ' before compiling
        '----------------------------------------------------------------------------
    
    
    #EndCompiled
    
    
    
    
    #Compiled "===Scalar numeric variables==="
      '----------------------------------------------------------------------------
      ' ATTENTION:
      ' FreeBASIC Functions declared with "CDecl" and "Export" will be visible
      ' to thinBASIC code. Parameters and return value must be compatible with
      ' thinBASIC variable types
      '----------------------------------------------------------------------------
    
    
        '----------------------------------------------------------------------------
        function FB_Check_LongByVal Cdecl (ByVal lLong1 as Long, ByVal lLong2 as Long) As Long Export
        '----------------------------------------------------------------------------
    
    
        print "Long 1 from inside FB passed ByVal", lLong1
        lLong1 = lLong1 * 2
        
        return lLong1
        
      end Function  
    
    
        '----------------------------------------------------------------------------
        function FB_Check_LongByRef Cdecl (ByRef lLong1 as Long, ByVal lLong2 as Long) As Long Export
        '----------------------------------------------------------------------------
    
    
        print "Long 1 from inside FB passed ByRef", lLong1
        lLong1 = lLong1 * 2
        
        return lLong1
        
      end Function
    
    
        '----------------------------------------------------------------------------
        function FB_Check_DoubleByVal Cdecl (ByVal lDouble1 as Double, ByVal lDouble2 as Double) As Double Export
        '----------------------------------------------------------------------------
    
    
        print "Double 1 from inside FB passed ByVal", lDouble1
        lDouble1 = lDouble1 * 2.5
        
        return lDouble1
        
      end Function  
    
    
        '----------------------------------------------------------------------------
        function FB_Check_DoubleByRef Cdecl (ByRef lDouble1 as Double, ByVal lDouble2 as Double) As Double Export
        '----------------------------------------------------------------------------
    
    
        print "Double 1 from inside FB passed ByRef", lDouble1
        lDouble1 = lDouble1 * 2.5
        
        return lDouble1
        
      end Function
    
    
    #EndCompiled
    
    
    #Compiled "===Numeric arrays==="
    
    
      '============================================================================
      ' Numeric ARRAYs
        '----------------------------------------------------------------------------
      ' the way numeric arrays are handled by FreeBASIC and ThinBASIC is very different but
      ' they way memory is allocated is the same: numeric array data is just a consecutive
      ' sequence of bytes
      ' So passing a numeric array from ThinBASIC to a FreeBASIC function is easy as
      ' passing BYREF the first element of the numeric array and than inside FreeBASIC
      ' use that first element memory pointer with some FreeBASIC pointers math
      ' More info on FreeBASIC pointers: http://www.petesqbsite.com/sections/express/issue18/fb_pointers.html
        '----------------------------------------------------------------------------
    
    
        '----------------------------------------------------------------------------
        function FB_Check_LongArray Cdecl (byref pLong as long, byval lMaxElements as long) As long Export
      ' passing a LONG ByRef means passing a pointer to the memory location where the first long is allocated
        '----------------------------------------------------------------------------
        Dim pArray  As long Ptr
        dim lIdx    as Long
        
        '---Get a pointer to the first element
        pArray = @pLong
        
        print "Ptr to an Arrays of LONG", pArray
        print "Maximum elements", lMaxElements
        print "Values are:"
        for lIdx = 1 to lMaxElements
          '---Here we access array elements values using pinter aritmentic
          '---*(p + lIdx - 1) means access the first element offset lIdx - 1
          '---So ... element 1 equal *(pArray + 1 - 1)
          '          element 2 equal *(pArray + 2 - 1)
          '          element x equal *(pArray + x - 1)
          print chr(9), "Position", lIdx, "Value", *(pArray + lIdx - 1),
          '---Multiply by 2 and add 5 to the array element
          *(pArray + lIdx - 1) = *(pArray + lIdx - 1) * 2 + 5
          '---Show new value
          print "New value", *(pArray + lIdx - 1)
          
        next
    
    
        return 0
        
      end Function  
    #EndCompiled
    
    
    
    
    
    
      dim MyScriptLong1 as long
      dim MyScriptLong2 as long
    
    
      dim MyScriptDouble1 as double
      dim MyScriptDouble2 as Double
        
      '---LONG BYVAL
        MyScriptLong1 = 123
        printl "---Calling a FB function passing a LONG ByVal and returning a LONG---" in %CCOLOR_FYELLOW
        printl "Long 1 from thinBasic script BEFORE calling FB function", MyScriptLong1
        '---Call a compiled FreeBASIC function
        printl "FB function return value", FB_Check_LongByVal(MyScriptLong1, MyScriptLong2)
        printl "Long 1 from thinBasic script AFTER calling FB function", MyScriptLong1
        PrintL "---------------------------------------------------------------------"
        PrintL
    
    
      '---LONG BYREF
        MyScriptLong1 = -123
        printl "---Calling a FB function passing a LONG ByRef and returning a LONG---" in %CCOLOR_FYELLOW
        printl "Long 1 from thinBasic script BEFORE calling FB function", MyScriptLong1
        '---Call a compiled FreeBASIC function
        printl "FB function return value", FB_Check_LongByRef(MyScriptLong1, MyScriptLong2)
        printl "Long 1 from thinBasic script AFTER calling FB function", MyScriptLong1
        PrintL "---------------------------------------------------------------------"
        PrintL
    
    
    
    
      '---Double BYVAL
        MyScriptDouble1 = 123.456
        printl "---Calling a FB function passing a Double ByVal and returning a Double---" in %CCOLOR_FYELLOW
        printl "Double 1 from thinBasic script BEFORE calling FB function", MyScriptDouble1
        '---Call a compiled FreeBASIC function
        printl "FB function return value", FB_Check_DoubleByVal(MyScriptDouble1, MyScriptDouble2)
        printl "Double 1 from thinBasic script AFTER calling FB function", MyScriptDouble1
        PrintL "---------------------------------------------------------------------"
        PrintL
    
    
      '---Double BYREF
        MyScriptDouble1 = -123.456
        printl "---Calling a FB function passing a Double ByRef and returning a Double---" in %CCOLOR_FYELLOW
        printl "Double 1 from thinBasic script BEFORE calling FB function", MyScriptDouble1
        '---Call a compiled FreeBASIC function
        printl "FB function return value", FB_Check_DoubleByRef(MyScriptDouble1, MyScriptDouble2)
        printl "Double 1 from thinBasic script AFTER calling FB function", MyScriptDouble1
        PrintL "---------------------------------------------------------------------"
        PrintL
    
    
      '---ARRAY of LONG
      '[breakpoint] Arrays of LONG passed from TB to FB and changed inside FB
      dim ArrayOfLongs(10) as Long = 10,20,30,40,50,60,70,80,90,100
        printl "---Calling a FB function passing BYREF the first element of an array of longs---" in %CCOLOR_FYELLOW
        FB_Check_LongArray(ArrayOfLongs(1), 10)
        PrintL "---------------------------------------------------------------------"
        PrintL
      
      printl "---Press a key to end---"
      WaitKey
    
    Click image for larger version. 

Name:	Capture.jpg 
Views:	93 
Size:	131.7 KB 
ID:	9977
    Last edited by ErosOlmi; 13-08-2019 at 18:17.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  5. #5
    Member
    Join Date
    Jan 2017
    Location
    changsha China
    Age
    29
    Posts
    72
    Rep Power
    12
    FreeBasic is more standard and has more comprehensive syntax. It is good news to be able to develop ThinBasic using FreeBasic.

    I am looking forward to the official start of this project, and can also provide some help. On FreeBasic, I have about 10 years of development experience.

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    54
    Posts
    8,636
    Blog Entries
    2
    Rep Power
    10
    Thanks xLeaves.
    I'm pretty sure you can help a lot ThinBasic project, you have already done a huge work.

    I'm finishing to try to find an easy way to handle strings in/out ThinBasic/FreeBasic without to much casting.
    Actually I'm experimenting a FreeBasic type that wrap BSTR OLE32 strings the same used by ThinBasic.
    Seems working but still few aspects to manage and then I will release.
    www.thinbasic.com | www.thinbasic.com/community/ | psch.thinbasic.com
    Win10Pro 64bit - 8GB Ram - Intel i7 M620 2.67GHz - NVIDIA Quadro FX1800M 1GB

  7. #7
    thinBasic MVPs
    Join Date
    Sep 2006
    Posts
    3,289
    Blog Entries
    2
    Rep Power
    344
    That is an interesting approach. Didn't know that FB was maintained again. How much longer Eros?

  8. #8
    Member
    Join Date
    Jan 2017
    Location
    changsha China
    Age
    29
    Posts
    72
    Rep Power
    12
    I recommend developing a new plugin interface. After all, there are too few PowerBasic compatible languages. In order to develop a plugin, I use C/C++ and FreeBasic to do a lot of extra work.

    Old plugins can remain compatible

    In fact, a development language refactoring, many of the original load can be removed, to make some large modifications, such as array operations

    It can be replaced with a more elegant way of writing, even without limiting the scope like JS, for example:

    Dim arr() = Array(1, 2, 3, 4, 5)
    MsgBox(UBound(arr)) ' --> 4

  9. #9
    Member
    Join Date
    Jan 2017
    Location
    changsha China
    Age
    29
    Posts
    72
    Rep Power
    12
    In addition, I recommend that the support for Variant be further strengthened.

    Although I hate the bad habits of programming novices that don't limit data types, it does reduce the difficulty of getting started. More and more programming languages, data types become value dependencies, not containers.

    Especially when a function may return multiple data types, this is very beneficial (such as ADODB, Redis, etc.)

    When you declare a variant type, you can allow omitting As Variant

    The code will be more beautiful when written:

    Dim val = RecordSet.Value("Field1")

  10. #10
    Quote Originally Posted by xLeaves View Post
    Dim arr() = Array(1, 2, 3, 4, 5)
    MsgBox(UBound(arr)) ' --> 4
    This is not correct. All thinBasic arrays are always 1-based. So, UBound will always return 5 for a 5-element array.

    What I'd recommend would be reading the manual more thoroughly before giving recommendations.
    Mike
    (3.6GHz i5 Core Quad w/ 16GB RAM, nVidia GTX 1060Ti w/ 6GB VRAM, x64 Windows 7 Ultimate Sp1)

Page 1 of 24 12311 ... LastLast

Posting Permissions

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