PDA

View Full Version : Reserve Syntax



oldpapa49
28-03-2009, 23:48
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

Michael Clease
29-03-2009, 00:37
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



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



Until you call this


DIALOG SHOW MODAL Window1 Call cbDialog

they are not shown allowing you to build your multiple windows and then just show them when required
look at


DIALOG SHOW STATE
DIALOG ENABLE / DISABLE

Lionheart008
30-03-2009, 11:02
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

ISAWHIM
04-04-2009, 06:08
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.)

oldpapa49
06-04-2009, 16:23
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.