Determining code location within code?

Author: mark.wheeler@tribalgroup.com (Mark Wheeler)

To help with bug analysis I'd like to output the location in the code (i.e. procedure name, operation name, trigger) that a problem has occurred in. The bug may be a logic issue, so I can't rely on $procerrorcontext, but I would like to have access to the PROCNAME, OPERATIONNAME, TRIGGERNAME etc ... that is provided by $procerrorcontext. I would like the equivalent of $formname, so I could output the location in a form of a code message (e.g. putmess "Form name: %%$formname%%% Code location:%%$location%%%"). I'm thinking about turning on $proc_profiling, running a line of code, then turning profiling off, but it seems that profiling only shows triggers I execute and not the trigger or proc that I'm in, so this won't work even if I use some included procedure code. I can, of course, manually specify the location of my message but I would like a more generic and automatic way of doing this. Any ideas how to do this in Uniface 9.6?  Or if not will at least Uniface 10 have this functionality? Many thanks Mark

3 Comments

  1.   Before I forget, there are more topics for $proccontext    $proccontext("FULL")    $proccontext("3GLSTACK")    $proccontext("MODULE")


    Author: istiller (i2stiller@gmx.de)
  2. Hi What about this function reporterror__("<a_message>","",10) Just insert in your code: putmess reporterror__("Something strange did happen","",10) Or  use  proccontext("STACK") It's a nested UIL (UnifaceItemList) Ingo    


    Author: istiller (i2stiller@gmx.de)
  3. Hi Mark, Check out this post; http://uniface.blogspot.com/2012/05/undocumented-feature-error-stack.html I've had a look at the potential output and I think it will pretty much give you what you want... Regards, Knut


    Author: Knut (knut.dybendahl@gmail.com)