Re: How do you call a process

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

call_proc() and call_func() use id's provided by routine_id(), so to make it
work, you'd need this:

    atom myID
        myID = routine_id("onClick_MenuGetRec")
        call_proc( myID, { 0, 0, {}} )    -- self = 0, even = 0, parms = {}

or simply this:

    call_proc( routine_id("onClick_MenuGetRec"), {0, 0, {}} )

With Win32Lib, however, I recommend using invokeHandler() to call the event
handlers for your controls. call_proc() and call_func() are used internally
by invokeHandler(), and if anyone ever looks at your code, invokeHandler()
will give them a better understanding of what you're doing.

~Greg


----- Original Message -----
From: "Ron Austin" <ronaustin at alltel.net>
To: <EUforum at topica.com>
Sent: Saturday, October 18, 2003 10:00 PM
Subject: How do you call a process


>
>
> In one part of the program I wrote a procedure to read a record out of my
> database.=0D
>  =0D
> procedure onClick_MenuGetRec(integer self, integer even, sequence parms)=
> =0D
> err =3D db_open("Eye-Comp",DB_LOCK_NO)=0D
> err =3D db_select_table("Diagnosis")=0D
> key =3D db_find_key(getText(Code))=0D
> if key >0 then=0D
> setText(Code,db_record_key(key))=0D
> setText(Desc,db_record_data(key))=0D
> else=0D
> setText(Desc,"** Code Not Found ***")=0D
> end if =0D
> db_close()=0D
> end procedure=0D
> setHandler({ MenuGetRec, ToolGetRec}, w32HClick, routine_id(=20
> onClick_MenuGetRec" ))=0D
>  =0D
>  In another part of the program I want to do the same thing. I tried to
use=
>
> call_proc(onClick_MenuGetRec,{}) but I get the following error:=0D
>  =0D
> Syntax error - expected to see an expression, not a procedure=0D
> =0D
> =0D
> I know I need to put error trapping in the program.  I want to design a
dia=
> log box that can be used to report all errors, but I haven't got to it
yet.=
>
>
>
> 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