Re: routine_id help
On Tue, 16 Feb 1999, Roderick Jackson wrote:
] Okay, I'm stuck again and I need to once more draw from the infinite
] Euphoria knowledge of the list.
]
] Anytime I begin to think I understand "routine_id", it throws me a new
] curveball. I'm writing a library of routines that use "routine_id". One
] global routine in the library attempts to get the ID of any arbitrary
] user-defined function given to it. I've included the library file at the
] very top of my test program, then below the include I have my arbitrary
] functions, and finally my main procedure.
[Example snipped for space, see Rod's previous post for code]
As far as N() is concerned in your program, MyFunction_MyFunction() hasn't
been declared, because N() occurs before it. A proc/func in Euphoria can
only see what is before it in the code.
I suggest you move N() into a second .E library and include it after all
of your function definitions, like so:
-- library.e --------------------------------------
global function One()
return 1
end function
-- other functions here...
-- N() has been moved to library2.e
-- end of library.e -------------------------------
-- library2.e -------------------------------------
function N()
-- Rod's code here
end function
-- end if library2.e ------------------------------
-- program.ex -------------------------------------
include library.e -- for One() et al.
-- program.ex's local functions here
include library2.e -- for N()
-- No more proc/func definitions here!
procedure Main()
-- etc.
end procedure
-- end of program.ex ------------------------------
HTH,
Carl
--
Carl R White -- Final Year Computer Science at the University of Bradford
E-mail........: cyrek- at -bigfoot.com -- Remove hyphens. Ta :)
URL...........: http://www.bigfoot.com/~cyrek/
Uncrackable...: "19.6A.23.38.52.73.45 25.31.1C 3C.53.44.39.58"
|
Not Categorized, Please Help
|
|