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

st: re: while looping

From   xiaotang li <>
Subject   st: re: while looping
Date   Wed, 20 Aug 2003 02:16:15 -0700 (PDT)

Dear all,
Sorry if you received duplicated copy of this email, I
apologize, this is my first time to post here.
i am just starting to use Stata and glad to join this
I am now learning to use while looping, but it doesn't
work for me. I myself can't find any problems with the
programe and can anyone here point out what mistake I
For example, I am doing a simple matrix calculation
like A=2*A and construct the following program
prog define test
set trace on  
matrix A=J(3,3,1)
matrix list A
version 7.0
local i=1
while 'i'<5 {
matrix A=2*A
local i='i'+1
The Stata just returns as the following and when I
type 'matrix list A' in the command box, it returns as
'matrix A not found', seems nothing is done by Stata.
prog define test
  1. set trace on
  2. matrix A=J(3,3,1)
  3. matrix list A
  4. version 7.0
  5. local i=1
  6. while 'i'<5 {
  7. matrix A=2*A
  8. local i='i'+1
  9. }
 10. end
end of do-file

What is the problem I've got? Many thanks for your
kind help.

Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
*   For searches and help try:

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