status的意义
status=open('saf_fac_dp.txt',1,1)status=write(z_coef,i)
status=close
这些是什么意思,谢谢 正好不懂 学习参考哈 好像是表征单元失效的一个参数 学习中,请问楼主解决啦吗status 代表什么意思? 安-岩土 发表于 2013-5-17 17:07
学习中,请问楼主解决啦吗status 代表什么意思?
删除单元的意思 OPEN、CLOSE 用法
;close 当前文件关闭,返回值为0表示成功关闭
open(filename,wr,mode) '先打开文件,然后可以读,可以往里写内容
;===filename可以是带双引号的字符串,也可以是变量名。
;===wr必须是个整数:0-只读打开,文件要求存在;1-文件为写入打开,已经存在的文件将被覆盖 (overwritten)。2-文件为写入打开,存在的文件被改写(appended to)
;===mode必须为一个整数值,0-读写fish变量,只有整型,浮点型和字符串的数据类型被传输,不传递变量名。1-读写ASCII数据。可读入一行数据,行之间用 CR/LF分开。每行最大80字符。
;===2-设定为binary读模式,任何文件都以binary的读取模式打开.
;===返回值: 0表示文件打开成功;1-表示文件名不是字符串;2-文件名是一个空字符串;3-wr或mode不是整型;4-mode参数错误(不是0或1);5-wr参数 错误(不是0或1);6-不能打开所要读取的文件,比如文件不存在;7-文件已经打开;8-不是fish模式的文件
;read(ar,n) ---放入数组。读取n个记录放入数组ar,每个记录要求是一行ASCII数据,或者是一个FISH变量。数组至少有n个元素大小。
;====返回值0表示无误;-1:表示读取错误,比如到了文件的末尾;n-表示读入n行后,恰好到了文件的末尾。
;****************************************
READ(ar, n) 将n个记录写到数组ar
read(ar, n) reads n records into the array ar. The array ar must be an array of at least n elements. The returned value is:
0 requested number of lines were input without error
-1 error on read (except end-of-file)
n positive value indicates that end-of-file was encountered after
reading n lines
write(ar, n) 将数组ar的前n个记录 写到文件,详细:
write(ar, n) writes n records from the first n elements of the array ar. The array ar must be an array of at least n elements. The returned value is:
0 requested number of lines were output without error
-1 error on write
n positive value (in ASCII mode) indicates that the nth elementwas not a string
parse(s, i) This function scans the string s and decodes the ith item
pre_parse(s, i)This function scans the string s and returns an integer value according to the type of the ith item, as follows.
0 missing item
1 integer
2 float
3 string missing (unable to interpret as int or float)
type(e) 数据类型函数,1=整型,2=浮点,3=字符串,4=指针,5=数组
本帖最后由 龙biscuit 于 2016-3-14 03:53 编辑
这是命令集锦,挺好的 龙biscuit 发表于 2016-3-14 03:49
这是命令集锦,挺好的
谢谢有用!
页:
[1]