Statalist The Stata Listserver


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

st: Using byable in a class member program


From   "Shrenik Shah" <[email protected]>
To   [email protected]
Subject   st: Using byable in a class member program
Date   Tue, 26 Jun 2007 16:09:23 -0400

It seems that the byable option does not work correctly when used with
a class member program. (I am using Stata Version 8.2.)  For example,
if I try to create a test class:

version 8.2
class testclass {
}
program .test, byable(recall)
	if _by() {
		disp "by option worked"
	}
end

I find:

. .tc = .testclass.new

. sort index

. by index: .tc.test
unrecognized command:  .tc.test invalid command name
r(199);

However, if I define the program:

program test, byable(recall)
	if _by() {
		disp "by option worked"
	}
end

I obtain

. by index: test:

------------------------------------------------------------------------------------------------------------------------
-> index = 0
by option worked

------------------------------------------------------------------------------------------------------------------------
-> index = 2
by option worked

------------------------------------------------------------------------------------------------------------------------
-> index = 3
by option worked

------------------------------------------------------------------------------------------------------------------------
-> index = 5
by option worked

------------------------------------------------------------------------------------------------------------------------
-> index = 13
by option worked

------------------------------------------------------------------------------------------------------------------------
-> index = 26
by option worked

Is there some way to use the by option successfully within a class
member program?

Thanks,
Shrenik
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index