1. problem changing font
- Posted by Ron Austin <ronaustin at alltel.net> Jan 02, 2004
- 370 views
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
2. Re: problem changing font
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jan 02, 2004
- 367 views
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
3. Re: problem changing font
- Posted by "Juergen Luethje" <j.lue at gmx.de> Jan 02, 2004
- 382 views
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/