Re: Another Interpreter Enhancement We'll All Agree On
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Jan 25, 2007
- 539 views
c.k.lester wrote: > > I would like to see a function like calling_proc() that returns the name of > the calling procedure. > This way, I can know which particular function or procedure sent the bad > parameter. I had a similar situation when developing pFTP, when reporting a connect error or similar, I did not want to crash/force the creation of an ex.err. Just knowing the calling routine probably would not be enough, for example I call FTPErr after InternetOpen() and InternetConnect() in beginSession(), likewise in 3 places in routine loadDir(), 2 in routine transfer_one(), 4 in transfer_directory(), etc. In the end I just added a simple integer id on each call, and before release ran through checking they were unique. Doing it "manually" like this might actually be better than a built-in routine name/line number mechanism if you're on a "release early, release often" project and either were not told the version or no longer have the exact source to hand... A builtin mechanism is perfectly feasible, though. Regards, Pete