1. How does crash_routine() work?

I have three procedures in my program, and I want the third one to initiate
when an error occures in my program.  In order to do that, I must call
crash_routine() with a number instead of a procedure.  According to the
notes in machine.e, the number represents the routine id of a procedure
in my program.  How do I know which procedure has which routine id?

new topic     » topic index » view message » categorize

2. Re: How does crash_routine() work?

Funkbrat wrote:
> 
> I have three procedures in my program, and I want the third one to initiate
> when an error occures in my program.  In order to do that, I must call
> crash_routine() with a number instead of a procedure.  According to the
> notes in machine.e, the number represents the routine id of a procedure
> in my program.  How do I know which procedure has which routine id?

See this:
http://www.rapideuphoria.com/lib_c_d.htm#crash_routine
and this:
http://www.rapideuphoria.com/lib_p_r.htm#routine_id

But basically to get a routine_id, you call it with the string name of your
function, like this:

crash_routine(routine_id("my_crash"))

my_crash has to be defined before you execute this statement. Like normal
calling conventions in Euphoria, routine_id() does not work with forward
references.


--
"Any programming problem can be solved by adding a level of indirection."
--anonymous
"Any performance problem can be solved by removing a level of indirection."
--M. Haertel
j.

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

3. Re: How does crash_routine() work?

> I have three procedures in my program, and I want the third one to initia=
te
> when an error occures in my program.  In order to do that, I must call
> crash_routine() with a number instead of a procedure.  According to the
> notes in machine.e, the number represents the routine id of a procedure
> in my program.  How do I know which procedure has which routine id?

With routine_id()!

-- note: name is passed as a sequence, no parentheses
ProcID = routine_id("ProcedureName")
FuncID = routine_id("FunctionName")


It really is that easy.

~Greg

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

Search



Quick Links

User menu

Not signed in.

Misc Menu