Reports: Passing by Address

For questions and discussion related to graphs, reports, and other output, including issues related to presenting or publishing results.
svannorden
Posts: 16
Joined: Thu Aug 08, 2013 12:23 pm

Reports: Passing by Address

Unread post by svannorden »

Can I pass Reports to a procedure by address? Are there any examples of how to do this?

I'm running a procedure that produces its own detailed report. However, because I'll be calling it >100 times, I'd also like to create another report that adds one line (with a few key statistics) every time I call the procedure. I thought the natural way to do this would be to create the summary report as a global variable, then pass it by address. However, this isn't working for me.

Any suggestions?
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: Reports: Passing by Address

Unread post by TomDoan »

Did you do the * on the type instruction for the REPORT? The following seems to work fine:

Code: Select all

declare report foo
report(action=define,use=foo)
*
procedure addstuff myreport
type report *myreport
report(use=myreport,row=new,atcol=1) "Row" %reportrow+1 %ran(1.0)
end addstuff
*
@addstuff foo
@addstuff foo
@addstuff foo
*
report(use=foo,action=show)
Post Reply