1. Win32Lib Limitations
- Posted by Jan & Gerald Harvey <vk2bnh at IX.NET.AU>
Mar 12, 1999
-
Last edited Mar 13, 1999
Why cant Win32Lib nest create() commands inside if statments???
Example:
-- <START CODE> --
atom junk
junk = 1
constant nothing = create(Window,"Name",0,0,0,50,50,0)
if junk != 0 then
constant anything = create(PushButton,"button",nothing,0,0,50,50,0)
end if
winMain(nothing)
-- <END CODE> --
etc...etc..etc...
It would be REALLY useful if it could.
Neil Harvey
P.S. Sorry about all the spaces between the lines. Just trying to make
it easy to read.
2. Re: Win32Lib Limitations
Actually, it can. The reason why the error occurs within the if statement,
is because constants can't be declared within if-end if blocks,
procedure-end procedure blocks, etc.. What you should do, is create an
integer variable, and assign the value like that.
atom junk
integer id
junk = 1
constant nothing = create(Window,"Name",0,0,0,50,50,0)
if junk then
id = create(PushButton,"button",nothing,0,0,50,50,0)
end if
-- And you know what happens next... --
Well, I hope that helps.
Austin Cathey (aka The AfterBeat)
Jan & Gerald Harvey wrote:
> Why cant Win32Lib nest create() commands inside if statments???
>
> Example:
>
> -- <START CODE> --
>
> atom junk
>
> junk = 1
>
> constant nothing = create(Window,"Name",0,0,0,50,50,0)
>
> if junk != 0 then
>
> constant anything = create(PushButton,"button",nothing,0,0,50,50,0)
>
> end if
>
> winMain(nothing)
>
> -- <END CODE> --
>
> etc...etc..etc...
>
> It would be REALLY useful if it could.
>
> Neil Harvey
>
> P.S. Sorry about all the spaces between the lines. Just trying to make
> it easy to read.