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

📄 m4_io.hlp

📁 是一个经济学管理应用软件 很难找的 但是经济学学生又必须用到
💻 HLP
字号:
{smcl}
{* 02apr2005}{...}
{cmd:help m4 io}
{hline}
{* index I/O functions}{...}
{* index input/output functions}{...}

{title:Title}

{p 4 4 2}
{bf:[M-4] io -- I/O functions}


{title:Contents}

{col 5}   [M-5]
{col 5}Manual entry{col 22}Function{col 40}Purpose
{col 5}{hline}

{col 5}   {c TLC}{hline 16}{c TRC}
{col 5}{hline 3}{c RT}{it: Console output }{c LT}{hline}
{col 5}   {c BLC}{hline 16}{c BRC}

{col 7}{bf:{help mf_printf:printf()}}{...}
{col 22}{cmd:printf()}{...}
{col 40}display 
{col 22}{cmd:sprintf()}{...}
{col 40}display into string

{col 7}{bf:{help mf_errprintf:errprintf()}}{...}
{col 22}{cmd:errprintf()}{...}
{col 40}display error message

{col 7}{bf:{help mf_display:display()}}{...}
{col 22}{cmd:display()}{...}
{col 40}display text interpreting SMCL

{col 7}{bf:{help mf_displayas:displayas()}}{...}
{col 22}{cmd:displayas()}{...}
{col 40}set whether output is displayed

{col 7}{bf:{help mf_displayflush:displayflush()}}{...}
{col 22}{cmd:displayflush()}{...}
{col 40}flush terminal output buffer

{col 7}{bf:{help mf_more:more()}}{...}
{col 22}{cmd:more()}{...}
{col 40}create --more-- condition

{col 5}   {c TLC}{hline 18}{c TRC}
{col 5}{hline 3}{c RT}{it: File directories }{c LT}{hline}
{col 5}   {c BLC}{hline 18}{c BRC}

{col 7}{bf:{help mf_direxists:direxists()}}{...}
{col 22}{cmd:direxists()}{...}
{col 40}whether directory exists

{col 7}{bf:{help mf_dir:dir()}}{...}
{col 22}{cmd:dir()}{...}
{col 40}file list

{col 7}{bf:{help mf_chdir:chdir()}}{...}
{col 22}{cmd:pwd()}{...}
{col 40}obtain current working directory
{col 22}{cmd:chdir()}{...}
{col 40}change current working directory
{col 22}{cmd:mkdir()}{...}
{col 40}make new directory
{col 22}{cmd:rmdir()}{...}
{col 40}remove directory

{col 5}   {c TLC}{hline 17}{c TRC}
{col 5}{hline 3}{c RT}{it: File management }{c LT}{hline}
{col 5}   {c BLC}{hline 17}{c BRC}

{col 7}{bf:{help mf_findfile:findfile()}}{...}
{col 22}{cmd:findfile()}{...}
{col 40}find file

{col 7}{bf:{help mf_fileexists:fileexists()}}{...}
{col 22}{cmd:fileexists()}{...}
{col 40}whether file exists

{col 7}{bf:{help mf_cat:cat()}}{...}
{col 22}{cmd:cat()}{...}
{col 40}read file into string matrix

{col 7}{bf:{help mf_unlink:unlink()}}{...}
{col 22}{cmd:unlink()}{...}
{col 40}erase file

{col 5}   {c TLC}{hline 10}{c TRC}
{col 5}{hline 3}{c RT}{it: File I/O }{c LT}{hline}
{col 5}   {c BLC}{hline 10}{c BRC}

{col 7}{bf:{help mf_fopen:fopen()}}{...}
{col 22}{cmd:fopen()}{...}
{col 40}open file
{col 22}{cmd:fclose()}{...}
{col 40}close file
{col 22}{cmd:fget()}{...}
{col 40}read line of ASCII file
{col 22}{cmd:fgetnl()}{...}
{col 40}same, but include newline character
{col 22}{cmd:fread()}{...}
{col 40}read {it:k} bytes of binary file
{col 22}{cmd:fput()}{...}
{col 40}write line into ASCII file
{col 22}{cmd:fwrite()}{...}
{col 40}write {it:k} bytes into binary file
{col 22}{cmd:fgetmatrix()}{...}
{col 40}read matrix
{col 22}{cmd:fputmatrix()}{...}
{col 40}write matrix
{col 22}{cmd:fstatus()}{...}
{col 40}status of last I/O command
{col 22}{cmd:ftell()}{...}
{col 40}report location in file
{col 22}{cmd:fseek()}{...}
{col 40}seek to location in file
{col 22}{cmd:ftruncate()}{...}
{col 40}truncate file at current position

{col 5}   {c TLC}{hline 30}{c TRC}
{col 5}{hline 3}{c RT}{it: Filename & path manipulation }{c LT}{hline}
{col 5}   {c BLC}{hline 30}{c BRC}

{col 7}{bf:{help mf_pathjoin:pathjoin()}}{...}
{col 22}{cmd:pathjoin()}{...}
{col 40}join paths
{col 22}{cmd:pathsplit()}{...}
{col 40}split paths
{col 22}{cmd:pathbasename()}{...}
{col 40}path basename
{col 22}{cmd:pathsuffix()}{...}
{col 40}file suffix
{col 22}{cmd:pathrmsuffix()}{...}
{col 40}remove file suffix
{col 22}{cmd:pathisurl()}{...}
{col 40}whether path is URL
{col 22}{cmd:pathisabs()}{...}
{col 40}whether path is absolute
{col 22}{cmd:pathasciisuffix()}{...}
{col 40}whether file is ASCII
{col 22}{cmd:pathstatasuffix()}{...}
{col 40}whether file is Stata
{col 22}{cmd:pathlist()}{...}
{col 40}process path list
{col 22}{cmd:pathsubsysdir()}{...}
{col 40}substitute for system directories


{hline}


{title:Description}

{p 4 4 2}
The above functions have to do with 

{p 8 12 2}
1.  Displaying output at the terminal.

{p 8 12 2}
2.  Reading and writing data in a file.


{title:Remarks}

{p 4 4 2}
To display the contents of a scalar, vector, or matrix, it is sufficient 
merely to code the identity of the scalar, vector, or matrix:

	: {cmd:x}
        {res}       {txt}          1             2             3             4
            {c TLC}{hline 57}{c TRC}
          1 {c |}  {res}.1369840784    .643220668   .5578016951   .6047949435{txt}  {c |}
            {c BLC}{hline 57}{c BRC}{txt}

{p 4 4 2}
You can follow this approach even in programs:

	{cmd}function example() 
	{
		...
		"i am about to calculate the result"
		...
		"the result is"
		b
	}{txt}

{p 4 4 2}
On the other hand, {bf:{help mf_display:[M-5] display()}} and 
{bf:{help mf_display:[M-5] printf()}} 
will allow you to exercise more control over how the output looks.

{p 4 4 2}
Changing the subject, 
you will find that many I/O functions come in two flavors: with and without 
an underscore in front of the name, such as {cmd:_fopen()} and {cmd:fopen()}.
As always, 
functions that begin with an underscore are generally silent about
their work and return flags indicating their success or failure.  Functions
that omit the underscore abort and issue the appropriate error
message when things go wrong.


{title:Also see}

{p 4 13 2}
Manual:  {hi:[M-4] io}

{p 4 13 2}
Online:  help for 
{bf:{help m4_intro:[M-4] intro}},
{bf:{help mata:[M-0] intro}}
{p_end}

⌨️ 快捷键说明

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