打开并读取文件



Dears,我正在使用YottaDB 1.32。我正在尝试从以下方面实施该程序:https://www.youtube.com/watch?v=ObUAklaia1Y.代码如下:

kill ^mesh
open 1:"mtrees.m,old"
if '$test write "mtrees2003.m not found",in,! halt
for  use 1 read a quit:'$test  do
. set key=$piece(a,":",1) ;text description
. set code=$piece(a,":",2) ;everything else
; extract code numbers
. for i=1:1 set x(i)=$piece(code,".",i) quit:x(i)=""
. set i=i-1
. use 5
; begin building a global reference
. set z="^mesh("
;-----------------------------------------------------------
; build a reference like ^mesh("A01","047","025","600")
; by concatenating quotes, codes, quotes, and commas onto z
;-----------------------------------------------------------
. for j=1:1:i-1 zet z=z_ """"_x(j)_ ""","
. set z="set "_z_""""_x(i)_""")"_key_""""
;-----------------------------------------------------------
; z now looks like set ^mesh("A01","047")="Abdomen"
; now executes the next
;-----------------------------------------------------------
. write z,!
. xecute z
close 1

我得到的错误如下:

open 1:"mtrees2003.m,old"
^-----
At column 9, line 2, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-E-DEVPARUNK, Deviceparameter unknown
. for i=1:1 set x(i)=$piece(code,".",i) quit:x(i)=""
^-----
At column 4, line 8, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-W-BLKTOODEEP, Block level too deep
. set i=i-1
^-----
At column 4, line 9, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-W-BLKTOODEEP, Block level too deep
. use 5
^-----
At column 4, line 10, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-W-BLKTOODEEP, Block level too deep
. set z="^mesh("
^-----
At column 4, line 12, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-W-BLKTOODEEP, Block level too deep
. for j=1:1:i-1 zet z=z_ """"_x(j)_ ""","
^-----
At column 4, line 17, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-W-BLKTOODEEP, Block level too deep
. set z="set "_z_""""_x(i)_""")"_key_""""
^-----
At column 4, line 18, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-W-BLKTOODEEP, Block level too deep
. write z,!
^-----
At column 4, line 23, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-W-BLKTOODEEP, Block level too deep
. xecute z
^-----
At column 4, line 24, source module /home/test/.yottadb/r1.32_x86_64/r/mesh.m
%YDB-W-BLKTOODEEP, Block level too deep

有人能解释一下吗:

  1. 什么是设备参数?。我怎样才能找到这个问题?。

  2. mtrees2003.txt和mesh.m都在同一个文件夹中:~/.yottadb/r1.32_x8_64/r。这重要吗?。

  3. 当我做YDB>zlink "mesh"时,所有的问题都会出现。但当我做YDB>do ^mesh时,唯一出现的问题是YDB-E-DEVPARUNK。

M有一些奇怪的特性,其中之一是即使语言是标准化的,但语言的某些部分(如设备的参数(却不是。

我刚刚查了一下,看起来你在comp.lang.mumps上问了这个问题,人们已经回答了你。正确答案是:

open "mtrees2003.txt":readonly

请查看此处的文档:https://docs.yottadb.com/ProgrammersGuide/ioproc.html#sequential-文件示例

相关内容

  • 没有找到相关文章

最新更新