Re: Win32Lib Limitations

new topic     » goto parent     » topic index » view thread      » older message » newer message

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.

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu