⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mf_displayas.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 11mar2005}{...}
{cmd:help mata displayas()}
{hline}
{* index displayas()}{...}
{* index as text, as result, etc.}{...}
{* index as error}{...}

{title:Title}

{p 4 4 2}
{bf:[M-5] displayas() -- Set display level}


{title:Syntax}

{p 8 12 2}
{it:void} {cmd:displayas(}{it:string scalar level}{cmd:)}

{p 4 4 2}
where {it:level} may be 

		{it:level}        minimum abbreviation
		{hline 33}
		"{cmd:result}"          "{cmd:res}"
        	"{cmd:text}"            "{cmd:txt}"
        	"{cmd:error}"           "{cmd:err}"
        	"{cmd:input}"           "{cmd:inp}"
		{hline 33}


{title:Description}

{p 4 4 2}
{cmd:displayas(}{it:level}{cmd:)} sets whether and how subsequent output is to
be displayed.


{title:Remarks}

{p 4 4 2}
If this function is never invoked, then the output level is {cmd:result}.
Say Mata was invoked in such a way that all output with the exception 
of error messages is being suppressed (e.g., {cmd:quietly} was coded in
front of the {cmd:mata} command, or in front of the ado-file that called 
your Mata function).  If output is being suppressed, then Mata output is being
suppressed, including any output created by your program.  Say you reach a
point in your program where you wish to output an error message.  You coded

	{cmd:printf("{c -(}err:you made a mistake{c )-}\n")}

{p 4 4 2}
Even though you coded the SMCL directive {cmd:{c -(}err:{c )-}}, the 
error message will still be suppressed.  SMCL determines how something is
rendered, not whether it is rendered.  What you need to code is

	{cmd:displayas("err")}
	{cmd:printf("{c -(}err:you made a mistake{c )-}\n")}

{p 4 4 2}
Actually, you could code 

	{cmd:displayas("err")}
	{cmd:printf("you made a mistake\n")}

{p 4 4 2}
because, in addition to setting the output level (telling Stata that 
all subsequent output is of the specified level), it also sets the 
current SMCL rendering to what is appropriate for that kind of output.
Hence, if you coded, 

	{cmd:displayas("err")}
	{cmd:printf("{c -(}res:you made a mistake{c )-}\n")}

{p 4 4 2}
the text "you made a mistake" would appear in the style of results despite any
{cmd:quietly}s attempting to suppress output.  Coding the above is considered
bad style.


{title:Conformability}

    {cmd:displayas(}{it:level}{cmd:)}:
	    {it:level}:  1 {it:x} 1
	   {it:result}:  {it:void}


{title:Diagnostics}

{p 4 4 2}
    {cmd:displayas(}{it:level}{cmd:)} aborts with error if {it:level} contains
    an inappropriate string.


{title:Source code}

{p 4 4 2}
Function is built-in.


{title:Also see}

{p 4 13 2}
Manual:  {hi:[M-5] displayas()}

{p 4 13 2}
Online:  help for 
{bf:{help mf_printf:[M-5] printf()}},
{bf:{help mf_display:[M-5] display()}};
{bf:{help m4_io:[M-4] io}}
{p_end}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -