Re: How do I re-use a procedure?
- Posted by "Michelle Rogers" <michellerogers at bellsouth.net> Nov 25, 2003
- 380 views
pssss..*whispers, "Hey, Ron"* maybe that's because some things were simplified so much that they don't function as well anymore? *grins* like forward referencing functions? MICHELLE ROGERS ----- Original Message ----- From: "Ron Austin" <ronaustin at alltel.net> To: <EUforum at topica.com> Subject: Re: How do I re-use a procedure? > > > =0D > =0D > -------Original Message-------=0D > =0D > From: EUforum at topica.com=0D > Date: Tuesday, November 25, 2003 12:05:50 PM=0D > To: EUforum at topica.com=0D > Subject: Re: How do I re-use a procedure?=0D > =0D > =0D > =0D > =0D > >From: Ron Austin <ronaustin at alltel.net>=0D > >Reply-To: EUforum at topica.com=0D > >To: EUforum at topica.com=0D > >Subject: How do I re-use a procedure?=0D > >Date: Tue, 25 Nov 2003 15:42:47 +0000=0D > >=0D > >=0D > >Seems like today is the day for my procedures not to work. I have a=0D > >procedure (shown below) which I use to populate a listview control. It=0D > >works great.=0D > >=0D > >procedure Print_to_Screen( integer self, integer even, sequence parms)=0D > >-- some code=0D > >end procedure=0D > >setHandler(MenuP_Scn, w32HClick, routine_id( "Print_to_Screen" ))=0D > >=0D > >=0D > >I want to use this procedure a second time in another part of my program= > =0D > >so I inserted the code below=0D > >as part of the second procedure.=0D > >=0D > >Print_to_Screen (MenuP_Scn, w32HClick,"")=0D > >=0D > >I get the error "Print_to_Screen" not declared". What's wrong? I have=0D > >used this technique before=0D > >without a problem, but I'm obviously missing something here.=0D > =0D > >=3D=3D Mr Trick wrote =3D=3D=0D > I'm guessing you're using the IDE here, but it doesn't really matter.=0D > =0D > What has happened is that the place you are calling the procedure from is = > =0D > higher in the source code than the place it is declared. Euphoria only look= > s > =0D > up for procedures, not further down. What I suggest you do to fix this is t= > o > =0D > replace the Print_to_Screen call with:=0D > =0D > invokeHandler(MenuP_Scn, w32HClick)=0D > =0D > This takes care of any code location issues, and is more robust, cause if = > =0D > you change the name "Print_to_Screen" to something else, you don't have to = > =0D > change the above call.=0D > =0D > MrTrick=0D > >=0D > >=3D=3D Ron Replies =3D=3D=0D > Thank you for the tip about how Euphoria looks for procedures. I reversed > the order of the procedures and now it works!=0D > =0D > When I tried to change it to invokeHandler(MenuP_Scn, w32HClick), however, = > I > got this message:=0D > syntax error - expected to see possibly 'end', not a function=0D > =0D > For a "simple" language, I am sure having a job getting it to work, but bit= > > by bit with help from people like Euman, Derek, you and others, I am making= > > progress.=0D > >TOPICA - Start your own email discussion group. FREE!=0D > >=0D > >=0D > =0D > =0D > =0D > Or send an email to: EUforum-unsubscribe at topica.com=0D > =0D > TOPICA - Start your own email discussion group. FREE!=0D > =0D > =0D > =0D > =0D > .=20 > > > > TOPICA - Start your own email discussion group. FREE! > >