1. Re: routine_id (was sethandler() help please)

Pete Lomax wrote:

<snip>
No, I still can't think of a case where you'd pass routine_id an
unrecognised string and want it to return -1 quietly instead of
stopping with an error. Rob claims it would break existing code.
</snip>

In Diamond, I use it in method definitions to have the program crash under
my control, doing cleanup and producing a Diamond standard error message. If
we had crash_routine, I could live with a bad routine_id crashing, but this
would still break the include detection code CChris mentioned.

Here's a technique to wrap routine_id at the top of the file:

function Eu_routine_id(sequence x)
    return routine_id(x)
end function

global function routine_id(sequence x)
    integer rid
    rid= Eu_routine_id(x)
    if rid >=0 then return rid end if
    ?1/0
end function

-- Mike Nelson

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu