Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: RE: programming questions


From   "Wallace, John" <[email protected]>
To   <[email protected]>
Subject   st: RE: programming questions
Date   Tue, 5 Jul 2005 12:57:49 -0700

A single "=" sign is for setting a variable's value.  A double equals
"==" is for comparisons, which is what you appear to be doing in your
example.

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Dinesh Sharma
Sent: Tuesday, July 05, 2005 12:44 PM
To: [email protected]
Subject: st: programming questions

Given below is a forval loop I am working on

forval k=1(1)10{
       if `k'=1{
          commands
       }
       else{
          commands
       }
}

The if part of the above program is giving error message. I will 
appreciate any suggestions.

Thanks

Dinesh
*
*   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/

*
*   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