Results 1 to 6 of 6

Thread: Dealing with ThinBasic versions

  1. #1
    Junior Member
    Join Date
    Dec 2020
    Location
    France
    Posts
    11
    Rep Power
    5

    Question Dealing with ThinBasic versions

    Hello

    Is there a function returning the version of ThinBasic ?

    The need is to be able to control the execution of a script that can be executed on machines with a different version of thinbasic.

    The behavior of certain functions being different according to the version, I would like to be able to take it into account in the script.

    Thanks for help. (ooops : too close for Covid time ......)


    François

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Hi François,

    I think you could achieve what you need like this:
    uses "exe"
    
    String version = EXE_GetVersionString(app_path + APP_Name) ' -- Retrieves the version of thinBasic executable
    

    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

  3. #3
    Junior Member
    Join Date
    Dec 2020
    Location
    France
    Posts
    11
    Rep Power
    5
    Quote Originally Posted by Petr Schreiber View Post
    Hi François,

    I think you could achieve what you need like this:
    uses "exe"
    
    String version = EXE_GetVersionString(app_path + APP_Name) ' -- Retrieves the version of thinBasic executable
    

    Petr
    Hi Petr,

    Thanks for your reply.
    Unfortunately your example doesn't work with bundled scripts where the
    EXE_GetVersionString
    
    returns the version set by the
    #BUNDLE Version "FileVersion"
    
    directive, and if it is not set "0.0.0.0" .

    But hopefully this example leaded me to examine "APP_xxxx" functions.
    I there found a workaround with
    APP_IsolationPath
    
    and extracting version of "thincore.dll"


    Here the script I tried
    'Trying to find version of thinbasic running
      
    Uses "Console" ,  "exe" 
    
    #BUNDLE Version "FileVersion"      ,  "1.2.3.45" 
    
    Dim bundled_script as word
    Dim isolated_script as word
    DIM version_x  as String 
    dim program  as string
    dim isol_path  as string
    dim isol_interp  as string
    
    bundled_script = APP_IsBundled
    isolated_script = APP_Isisolated
    
    PrintL 
    PrintL  "running" , bundled_script , iif$(bundled_script , "                  bundled" ,"               interpreted" )  in 15
    PrintL  "running" , isolated_script , iif$(isolated_script , "                  isolated" ,"             NOT  isolated" )  in 15
    
    program = (app_path + APP_Name)  
    PrintL  "Program = " , program 
    
    version_x = EXE_GetVersionString   ( program ) ' -  -  Retrieves the version of thinBasic executable
    PrintL  "Version = " , version_x 
    PrintL  
    
    printl
    isol_path = APP_IsolationPath
    printl "APP_IsolationPath", isol_path  
     
    isol_interp = isol_path & "thincore.dll"
    printl " Version of " & isol_interp  
    printl $tab,$tab , EXE_GetVersionString   ( isol_interp )
    
    
    print "waiting " at 25,24
         WaitKey
    
    As you can see in interpreted test the APP_Isolation path is empty and version of thincore is returned.

    Included view of results.version_find.png

    Regards

    François

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Thank you for sharing the working solution


    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

  5. #5
    Junior Member
    Join Date
    Dec 2020
    Location
    France
    Posts
    11
    Rep Power
    5
    Quote Originally Posted by Petr Schreiber View Post
    Thank you for sharing the working solution


    Petr
    Hi Petr,

    Dont you think that a TB function returning directly this info could be implemented.

    Not for the 4 hours remaining in this year

    But in a future version ?

    And now the wishes ar not "Happy new year." but "I wish you a better year."


    Best wishes.

    François

  6. #6
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732
    Exactly the idea I got reading your question

    I put it on the list and will discuss with Eros


    All the best for 2021!,
    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

Similar Threads

  1. ProgressBar in next versions
    By ErosOlmi in forum Suggestions/Ideas discussions
    Replies: 5
    Last Post: 15-01-2008, 07:11

Members who have read this thread: 1

Posting Permissions

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