Where am I, and how did I get here.

In response to a posted wish, here’s a global proc to return the call stack for error logging.

There’s a function called $proccontext, here’s a simple Global Proc to chop it up and format it as a string for error logging.
This gives a text string, but simply replace the -> with Gold-; for a list.

 

Iain

 


params

string p_ouparams : OUT

endparams

variables

string v_procstack, v_singlepoint, v_data, v_fieldval, v_output

numeric v_counter

endvariables

v_procstack = $proccontext("STACK")

v_counter = 4

getitem v_singlepoint, v_procstack, v_counter

v_output = $item("LIN", v_singlepoint)

while($status > 0)

if($item("MODNAM",v_singlepoint) != "APPL")

if($item("TYPE", v_singlepoint) = "MOD")

v_data = "%%$item("CPTNAM",v_singlepoint)%%%.%%$item("MODNAM",v_singlepoint)%%%.%%$item("LNR",v_singlepoint)%%%"

else

v_data = "%%$item("CPTNAM",v_singlepoint)%%%.%%$item("ENTITY",v_singlepoint)%%%.%%$item("FIELD",v_singlepoint)%%%.%%$item("MODNAM",v_singlepoint)%%%.%%$item("LNR",v_singlepoint)%%%"

endif

v_output = "%%v_data%%%->%%v_output%%%"

endif

v_counter = v_counter+1

getitem v_singlepoint, v_procstack, v_counter

endwhile

p_ouparams = v_output

0 thoughts on “Where am I, and how did I get here.”

Leave a Reply