Statalist The Stata Listserver


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

RE: st: String vector


From   "Hendri Adriaens" <Hendri@uvt.nl>
To   <statalist@hsphsun2.harvard.edu>
Subject   RE: st: String vector
Date   Tue, 1 May 2007 01:03:05 +0200

Hi again,

Another one that I do not understand:

  forvalues x=1/2 {;
    if `x'==1 {
      local bt="bt_m";
      local gt="gt_m";
    };
    if `x'==2 {
      local bt="bt_v";
      local gt="gt_v";
    };
    forvalues y=1/20 {;
      if `y'==20 {;
        local groep="b_lft95_"+"`gesl'";
      };
      if `y'!=20 {;
        local groep="b_lft"+string((`y'-1)*5)+"_"+string(`y'*5)+"`gesl'";
      };
      replace `groep'=`groep'*`bt'/`gt';
    };

Why does this complain like:
/gt_m invalid name

I guess it thinks the backslash is part of the string. Can I do something
about that? Notice that it doesn't seem to think this with the *`bt'...

Thanks, best regards,
-Hendri.


*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index