1. problem changing font

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

new topic     » topic index » view message » categorize

2. Re: problem changing font

On Fri,  2 Jan 2004 15:35:15 +0000, Ron Austin <ronaustin at alltel.net>
wrote:

>procedure print_it( integer self, integer event, sequence params)
>setFont(win,"Roman",18,1)
>sequence name

Within a procedure or routine definition, variable declarations must
occur before any code, so just swap the last two lines above and it
should be fine.

Pete

new topic     » goto parent     » topic index » view message » categorize

3. Re: problem changing font

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 message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu