Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: bug? -display- inside -simulate-


From   Jeph Herrin <junk@spandrel.net>
To   statalist@hsphsun2.harvard.edu
Subject   st: bug? -display- inside -simulate-
Date   Sat, 29 Dec 2007 13:47:34 -0500

I am using -simulate- to run -myprogram-, and
would like -myprogram- to display some output
each time, for tracking purposes. The problem
is that -display- seems to only work the first
time through.

For example:

===============================================
capture program drop myprogram
program define myprogram, rclass
	di in r "myprogram"
	return scalar n = 1
end

quietly simulate n=r(n), reps(1000): myprogram
===============================================


produces the following output:

===============================================
. capture program drop myprogram

. program define myprogram, rclass
  1.         di in r "myprogram"
  2.         return scalar n = 1
  3. end

.
. quietly simulate n=r(n), reps(1000): myprogram
myprogram

.
.
.
end of do-file
===============================================

Is this a bug? In my case, -myprogram- is nontrivial,
and seems to run into trouble about 1 out of 100 times.
I'm trying to debug it by displaying some process info.
Without it, I can't figure out which cases are causing
the problem, as -simulate- does not capture return values
when -myprogram- crashes.

I looked at simulate.ado, but it'll be easier to write my
own loop that to sort out what is going on there.


thoughts?

thanks,
Jeph



*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2021 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index