vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| Hi, I'm writing a procedure that in case of an error returns something like: "Error in procedure: ID_CHK" I want to make this generic so is there anyway i can return a procudres name from inside that procedure <snip> procedure id_chk: .... .... find blah. if unavail blah then do: message "Error in procedure: " + <proc_name?> return end. .... .... end procedure. </snip> Thanks Martin |
| |||
| martin.doherty@gmail.com wrote in news:1132243011.853586.34950@z14g2000cwz.googlegro ups.com: > Hi, > > I'm writing a procedure that in case of an error returns something > like: > > "Error in procedure: ID_CHK" > > I want to make this generic so is there anyway i can return a > procudres name from inside that procedure > > <snip> > procedure id_chk: > .... > .... > find blah. > > if unavail blah then > do: > message "Error in procedure: " + <proc_name?> > return > end. > > .... > .... > > end procedure. > > </snip> > > Thanks > > Martin > > You are looking for THIS-PROCEDURE:FILE-NAME which will return the name of the current procedure.. Kevin |
| ||||
| On 17 Nov 2005 20:54:43 GMT, Kevin <Joe@Joe.com> wrote: >martin.doherty@gmail.com wrote in >news:1132243011.853586.34950@z14g2000cwz.googlegr oups.com: > >> Hi, >> >> I'm writing a procedure that in case of an error returns something >> like: >> >> "Error in procedure: ID_CHK" >> >> I want to make this generic so is there anyway i can return a >> procudres name from inside that procedure >> >> <snip> >> procedure id_chk: >> .... >> .... >> find blah. >> >> if unavail blah then >> do: >> message "Error in procedure: " + <proc_name?> >> return >> end. >> >> .... >> .... >> >> end procedure. >> >> </snip> >> >> Thanks >> >> Martin >> >> > >You are looking for THIS-PROCEDURE:FILE-NAME which will return the name >of the current procedure.. > >Kevin Actually, as it says, it returns the OS name of the file containing the program/procedure currently running. Take a look at the program-name(n) function., which returns the nth name in the procedure stack. Program-name(1) returns, generally, the name of the procedure executed by the last run statement. There are exceptions, especially if you are in a trigger when it is invoked. HTH |