全部版块 我的主页
论坛 计量经济学与统计论坛 五区 计量经济学与统计软件 Stata专版
14769 3
2009-08-18
我有两个命令,想在do file里写在一行,中间应该用什么断开?

我尝试用 delimit,但是结果不显示出来?

谢谢
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

全部回复
2009-8-18 19:16:54
There are several ways of adding comments in do-files and programs
    (ado-files).

        1.  begin the line with *

        2.  place the comment between /* and */ delimiters

        3.  begin the comment with //

        4.  begin the comment with ///

    Note that the comment indicator * may only be used at the beginning of a
    line, but it does have the advantage that it can be used interactively.
    * indicates that the line is to be ignored.  The * comment indicator may
    not be used within mata.

    The /* and */ comment delimiter has the advantage that it may be used in
    the middle of a line, but it is more cumbersome to type than the other
    comment indicators.  What appears inside /* */ is ignored.

    The // comment indicator may be used at the beginning or at the end of a
    line.  Note, however, that if the // indicator is at the end of a line,
    it must be preceded by one or more blanks.  // indicates that the rest of
    the line is to be ignored.

    The /// comment indicator instructs Stata to view from /// to the end of
    a line as a comment and to join the next line with the current line.  ///
    is one way to make long lines more readable.  Like the // comment
    indicator, the /// indicator must be preceded by one or more blanks.
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-8-18 20:19:55
jinke1311 发表于 2009-8-18 17:43
我有两个命令,想在do file里写在一行,中间应该用什么断开?

我尝试用 delimit,但是结果不显示出来?

谢谢
          *          《STATA初级视频》

          *             ::第一部分::
          *              Stata 操作
          *         =====================
          *           第一讲  STATA简介
          *         =====================

   *-9.2.3 断行
     
     *-三种方式: “///” 、 “/* */” 、 #delimit 命令
     
       *-第一种断行方式: ///
         sysuse auto, clear
         twoway (scatter price weight)       ///
                (lfit price weight),         ///
                title("散点图和线性拟合图")
               
       *-第二种断行方式: /* */
         twoway   (scatter price weight)      /*
               */ (lfit price weight),        /*
               */ title("散点图和线性拟合图")   
              
       *-第三种断行方式: #delimit 命令
         #delimit ;
           twoway (scatter price wei)
                  (lfit price wei),
                  title("散点图和线性拟合图");
         #delimit cr
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

2009-8-18 20:23:08
jinke1311 发表于 2009-8-18 17:43
我有两个命令,想在do file里写在一行,中间应该用什么断开?

我尝试用 delimit,但是结果不显示出来?

谢谢
不好意思,没看清你的问题,答案如下(已测试):

    sysuse auto, clear
        #delimit ;
             des price wei;   sum price wei len;  reg price wei;
        #delimit cr
二维码

扫码加我 拉你入群

请注明:姓名-公司-职位

以便审核进群资格,未注明则拒绝

相关推荐
栏目导航
热门文章
推荐文章

说点什么

分享

扫码加好友,拉您进群
各岗位、行业、专业交流群