Results 1 to 5 of 5

Thread: Reserve Syntax

  1. #1

    Reserve Syntax

    Is there a fast list of these words that can not be as a DIM statement?

    And Petr here is one..

    The Meaning of Life.. Nope, that that... Lemme think..
    Oh..

    Looking at help and stuff, and being that basic (since I learn it long ago) has change a little bit.. I like to have a better grasp of the statement line.. EX

    hndl = CONTROL ADD BUTTON, hwnd, ctrlID, txt, xPos, yPos, Width, Height [, [Style] [, [ExStyle]]] [[,] CALL CallBack]

    hand is that just a name and can you have more like dnwh? Same with ctrlID. The rest I know..

    Maybe a flow of understanding..

    Does it go Open Main Window
    Buttons to open sub windows
    Buttons to open more windows..
    Do what ever and close this window
    Close this one

    etc..

    Like I kinda understand.. And kinda not.. I get this way like 2nd guessing myself.

    Ok, off to get wife..

    BBL


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

    Re: Reserve Syntax

    The best clue about reserved words is when you try and type one it will change colour.

    Is doesnt matter how or when you make windows so you could have

    [code=thinbasic]
    DIm style as DWORD VALUE %WS_POPUP Or %WS_VISIBLE Or %WS_CLIPCHILDREN Or %WS_CAPTION Or %WS_SYSMENU Or %WS_MINIMIZEBOX
    DIM Window1 AS DWORD
    DIM Window2 AS DWORD
    DIM Window3 AS DWORD
    DIM Window4 AS DWORD
    DIM Window5 AS DWORD

    DIALOG New 0, "Window1",-1,-1, 330, 203, style, 0 To Window1
    DIALOG New 0, "Window2",-1,-1, 330, 203, style, 0 To Window2
    DIALOG New 0, "Window3",-1,-1, 330, 203, style, 0 To Window3
    DIALOG New 0, "Window4",-1,-1, 330, 203, style, 0 To Window4
    DIALOG New 0, "Window5",-1,-1, 330, 203, style, 0 To Window5

    [/code]

    Until you call this

    [code=thinbasic]DIALOG SHOW MODAL Window1 Call cbDialog[/code]

    they are not shown allowing you to build your multiple windows and then just show them when required
    look at
    [code=thinbasic]
    DIALOG SHOW STATE
    DIALOG ENABLE / DISABLE
    [/code]
    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

  3. #3
    Senior Member Lionheart008's Avatar
    Join Date
    Sep 2008
    Location
    Germany, Bad Sooden-Allendorf
    Age
    51
    Posts
    934
    Rep Power
    109

    Re: Reserve Syntax

    hi don, hi michael...

    I add here my last version of the callback-button example I have done some weeks ago
    and I agree with michael... it's important to use this one..

    Code

    DIALOG SHOW MODAL Window1 Call cbDialog
    perhaps my little example can helps to see how button callbacks are working... I like to work with different popup windows

    best regards, Lionheart
    Attached Images Attached Images
    Attached Files Attached Files
    you can't always get what you want, but if you try sometimes you might find, you get what you need

  4. #4

    Re: Reserve Syntax

    One thing to remember, is that this is not "Just basic", this is "Basic running in windows".

    As opposed to older basic, which was just a dos-box running in a window.
    (In windows is not the same as in "A" window.)

    For windows, every device, screen, button, menu, anything... has a "handle" to identify it. Starting at "0" for windows itself, and incrementing randomly to any free handle ID.

    Once something has a handle, windows can talk to that device, pause it, refresh it, move it, hide it, show it, kill it... EG, a handle is nothing more than a general disposable unique variable ID number. However, in programming, many people like to have names for specific devices or keep the ID's in an array for management.

    You could have an array of handles, or give each a name. (For spontaneous and random windows, names are not a possibility.)

    hNdl[1] = SomeNewWindow(hWnd)
    hNdl[2] = SomeOtherNewWindow(hWnd)
    hNdl[3] = SomeOtherOtherNewWindow(hWnd)...

    or...

    hWndMain = SomeNewWindow(hWnd)
    hWndOptions = SomeOtherNewWindow(hWnd)
    hWndHelp = SomeOtherOtherNewWindow(hWnd)

    Windows may assign "1023434234" to one window, and the next may be "8343423411", while the next is, "43251". The numbers are not important, but the names or index value in the array you use, is important.

    You will find a lot of "Windows commands", related to the windows API commands, which can give you feedback about the contents of the handle, handle parent, handle children, handle object type, etc...

    The rest of those "Short terms", are common across the net or in windows or in powerbasic programming, to identify specific things related to a "Window". Just as "X" and "Y" is commonly related to mouse-position, or "xPos" and "yPos". They are shortened to help reduce the length of the line of code, for reading. Some times, you can find the actual code samples to offer more insight.

    Google "ExStyle" and/or "ctrlID", and you should find many Microsoft pages, with info related to the associated windows commands. (Prepare to get lost on that journey.)

  5. #5

    Re: Reserve Syntax

    Thanks ISAWHIM!

    You are correct to presume I was still in the dark ages as far as dos basic era. C=64, AppleBasic and Advanced Basic with line numbers..

    I did REXX from the Amiga era, but was nearing the end of my programming and onto other things.. It got tabled!
    Since then I was out of the loop and my memory was of Historic Language

    Now I see the link of names.. The relation being that things are required to pull info from a different environment than what was done before.

    But one rule of thumb is still the same.. each letter, each value takes up valuable memory real estate. As in the old Commodore 64, save space by using the special characters for certain command code like gosub, goto, end etc.

    I'm just an old guy that has lost time on something I liked to do and is trying to relearn the new way. But I will try to adapt!.. Note: My first car did not have a crank handle in the front! It was a 60 T-bird... $50 buxs and the wheel covers were worth more than the car back then.


Similar Threads

  1. Syntax coloring,how?
    By zlatkoAB in forum thinAir General
    Replies: 13
    Last Post: 04-06-2009, 19:36

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
  •