Results 1 to 7 of 7

Thread: You rate better than 4 stars

  1. #1
    Junior Member
    Join Date
    Jun 2011
    Location
    (near) Denver Colorado
    Posts
    3
    Rep Power
    0

    You rate better than 4 stars

    Wow, what a large site!

    I am still getting my feet wet. I created a couple of canvas windows. I was experimenting with setfocus and getfocus, and am probably not using them correctly. But I thought you might appreciate some comments:

    1) The statement "k1 = Win_GetFocus()" gives a misleading error: says "token found: k1" when actually maybe the ()'s shouldn't be there.
    2) Win_GetFocus always gives 0. Am I missing something?
    3) The debugger is great, but gives an error when I hit the "stop" button. No big deal.
    4) When I copy code from MSWord into thinAir, I get double spacing. Also no big deal.
    5) Ctl-V doesn't work from the Help. (Right-click/copy does work.)
      Uses "Console", "ui"
      Dim hwnd, k1 As Long    
      hwnd = Canvas_Window("Test", 100, 100, 400, 300)
      Canvas_Attach(hwnd, 0, %FALSE)
      Win_SetFocus(hwnd)
      k1 = func1
      k1 = func1() ' ()s no problem here
      k1 = Win_GetFocus
      k1 = Win_GetFocus() ' this gives misleading error? "token found: k1"
      MsgBox 0, k1     
      
    Function func1() As Long
      Function = 1
    End Function
    
    This is all small stuff. I am really impressed with TB. Thanks, Art

  2. #2
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,155
    Rep Power
    736
    Hi AMark,

    welcome to the world of ThinBASIC

    Ad 1)
    When you move cursor on Win_GetFocus and press F1, ThinAIR will take you to the help file, where the documented syntax is without the (). Maybe it would be better if the () case could be handled the same way for user functions and module functions in future?

    Ad 3)
    If you read the "Error Description" field in the window you see after pressing Stop button, you will read:
    Script execution aborted by user during a TRACE operation
    ... so it is by design.

    Ad 5)
    It works okay for me, do you use the latest ThinBASIC 1.8.8.0 release?

    I am sure the other will be able to answer your other questions and I hope you will enjoy using ThinBASIC as much as I do!


    Petr
    Last edited by Petr Schreiber; 28-06-2011 at 14:08.
    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
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,818
    Rep Power
    10
    Hi AMark and welcome to thinBasic community forum.

    Here my replies:
    1. Sorry, my mistake. I usually create keywords where is optional to indicate () (so programmer can set or not them) but in this case I made a mistake. I will fix asap
    2. All Win_* thinBasic functions are wrappers of some windows API. I did that in order to avoid to declare most of the frequently used APIs
      Win_Getfocus is a wrapper of windows API Getfocus documented here: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
      Its main purpose is to get the window handler of the window having the keyboard focus. But what window? Anything in Microsoft OS is a window: a textbox, a button, a listbox. All are windows. Win_Getfocus return the handle of the window having the cursor over it. Your canvas window has no textboxes or buttons or any other controls that can get the keyboard focus.
      To get the main window having the focus, better to use Win_GetForegroundWindow that is a wrapper of GetForegroundWindow described here: http://msdn.microsoft.com/en-us/libr...(v=vs.85).aspx
    3. Yes, it is by design generating a sort of fake run time error whose description is clear (to me) but someone already bring it to my attention that because it is identical to a real run time error it can create confusion. I will change it.
    4. be sure to have latest thinBasic version. Currently it is 1.8.8.0. Check link present on top of all forum pages
    5. same as 4.
    Ciao
    Eros
    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
    Junior Member
    Join Date
    Jun 2011
    Location
    (near) Denver Colorado
    Posts
    3
    Rep Power
    0
    I had TB 1.8.6.0 -- 1.8.8.0 does fix those 2 things.
    And you have answered the other questions. Thank you.
    The "4-star" site is
    http://basic.mindteq.com/index.php?o...iews&Itemid=11
    which needs to be updated to 5 stars. TB is wonderful!
    The contextual help is great!

    I do a lot with MSWord and MSExcel VBA, and use
    IF condition THEN dotrue ELSE dofalse
    
    which I see is not allowable.
    It would be nice to flag that as an error.
     Uses "Console"
     
    'The following statement seems to ruin the whole script.
    'If TRUE Then PrintL "T1" Else PrintL "F1"
    'The following statement doesn't print "F2"
    If FALSE Then PrintL "T2" Else PrintL "F2"
    'I know that the following is how it should be done.
    If TRUE Then
      PrintL "T3"
    Else
      PrintL "F3"
    End If 
    If FALSE Then
      PrintL "T4"
    Else
      PrintL "F4"
    End If 
    Console_WaitKey
    
    I hit "Edit 'About Me'" and got to
    http://www.thinbasic.com/community/m...rk&tab=aboutme
    but I don't see how to change anything. I'm in Denver, Colorado
    But I'm not going to be around much for awhile.

    Thanks and best wishes, Art

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,818
    Rep Power
    10
    Quote Originally Posted by AMark View Post
    I hit "Edit 'About Me'" and got to
    http://www.thinbasic.com/community/m...rk&tab=aboutme
    but I don't see how to change anything. I'm in Denver, Colorado
    From top menu search sub menu "Forum actions" and choose "Edit profile"

    Ciao
    Eros
    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 author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,818
    Rep Power
    10
    Quote Originally Posted by AMark View Post
    I do a lot with MSWord and MSExcel VBA, and use
    IF condition THEN dotrue ELSE dofalse
    
    which I see is not allowable.
    It would be nice to flag that as an error.
     Uses "Console"
     
    'The following statement seems to ruin the whole script.
    'If TRUE Then PrintL "T1" Else PrintL "F1"
    'The following statement doesn't print "F2"
    If FALSE Then PrintL "T2" Else PrintL "F2"
    'I know that the following is how it should be done.
    If TRUE Then
      PrintL "T3"
    Else
      PrintL "F3"
    End If 
    If FALSE Then
      PrintL "T4"
    Else
      PrintL "F4"
    End If 
    Console_WaitKey
    
    Created support bug issue: http://www.thinbasic.com/community/project.php?issueid=296
    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

  7. #7
    Junior Member
    Join Date
    Jun 2011
    Location
    (near) Denver Colorado
    Posts
    3
    Rep Power
    0
    Great. And Thanks again. Art

Similar Threads

  1. Frame Rate Regulator
    By Michael Clease in forum TBGL Scripts and Projects
    Replies: 8
    Last Post: 22-06-2007, 22:38

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
  •