Re: Functions & Procedure runing stak
- Posted by petelomax Dec 17, 2018
- 1244 views
clkeriolet said...
I have a few procedures that need to know from where(with the path) among hundreds they have been called, so I can take proper action.
The traditional approach is to supply a parameter to determine that sort of thing, for example
enum MOVE, COPY, DELETE procedure process_file(integer action, ...) ... end procedure procedure move_file(...) process_file(MOVE,...) end procedure procedure copy_file(...) process_file(COPY,...) end procedure procedure delete_file(...) process_file(DELETE,...) end procedure
rather than have process_file try to figure out which routine it was called from.
Pete