Re: problem changing font

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

Ron wrote
(some lines indented by me, to make the code better readable):

> I want to change the size of the the screen and the font points when my
> app runs at 800 X 600 vs 1024 X 768.  Why does this work:
>
> without warning
> include win32lib.ew
> constant win=createEx (Window,"Test",0,Center,Center,500,500,0,0)
> procedure print_it( integer self, integer event, sequence params)
>    setFont(win,"Roman",18,1)
>    wPuts(win,"Hello")
> end procedure
> setHandler(win, w32HPaint, routine_id( "print_it" ))
> WinMain(win,Normal)
>
> and this dont?
>
> without warning
> include win32lib.ew
> constant win=createEx (Window,"Test",0,Center,Center,500,500,0,0)
> procedure print_it( integer self, integer event, sequence params)
>    setFont(win,"Roman",18,1)
>    sequence name
>    name="Ron"
>    wPuts( {win, 40, 40}, name)
> end procedure
> setHandler(win, w32HPaint, routine_id( "print_it" ))
> WinMain(win,Normal)
>
> I get a syntax error - expected to see possibly 'end', not a type
> sequence name


When you go to http://www.rapideuphoria.com/refman_2.htm#42, and then
scroll down a little, you'll find the explanation:
"Variable declarations inside a subroutine must all appear at the
beginning, before the executable statements of the subroutine."

Regards,
   Juergen

-- 
 /"\  ASCII ribbon campain  |  This message has been ROT-13 encrypted
 \ /  against HTML in       |  twice for higher security.
  X   e-mail and news,      |
 / \  and unneeded MIME     |  http://home.arcor.de/luethje/prog/

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

Search



Quick Links

User menu

Not signed in.

Misc Menu