Re: How do I re-use a procedure?

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

I'm guessing you're using the IDE here, but it doesn't really matter.

What has happened is that the place you are calling the procedure from is 
higher in the source code than the place it is declared. Euphoria only looks 
up for procedures, not further down. What I suggest you do to fix this is to 
replace the Print_to_Screen call with:

invokeHandler(MenuP_Scn, w32HClick)

This takes care of any code location issues, and is more robust, cause if 
you change the name "Print_to_Screen" to something else, you don't have to 
change the above call.

MrTrick


>From: Ron Austin <ronaustin at alltel.net>
>Reply-To: EUforum at topica.com
>To: EUforum at topica.com
>Subject: How do I re-use a procedure?
>Date: Tue, 25 Nov 2003 15:42:47 +0000
>
>
>Seems like today is the day for my procedures not to work.	I have a
>procedure (shown below) which I use to populate a listview control.  It
>works great.
>
>procedure Print_to_Screen( integer self, integer even, sequence parms)
>-- some code
>end procedure
>setHandler(MenuP_Scn, w32HClick, routine_id( "Print_to_Screen" ))
>
>
>I want to use this procedure a second time in another part of my program
>so I inserted the code below
>as part of the second procedure.
>
>Print_to_Screen (MenuP_Scn, w32HClick,"")
>
>I get the error "Print_to_Screen" not declared".  What's wrong?  I have
>used this technique before
>without a problem, but I'm obviously missing something here.
>
>
>
>TOPICA - Start your own email discussion group. FREE!
>
>

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

Search



Quick Links

User menu

Not signed in.

Misc Menu