好吧...现在我知道你从哪里来了。
我将如何写从第 7 到行尾的所有内容?
好吧,您可以从 i=7 开始循环,或者您可以使用“引号”字符串并将引号用作新的分隔符。这是两者的示例,使用双引号作为几乎自然的第二分隔符选择
$
$ READ SYS$INPUT BUFF
SHG101,$1$DGA1101:,25,15,10,5000,100,X.TMP,Y.DAT
$
$ excludes = ""
$ tmp = F$ELEMENT(7, ",", BUFF)
$ IF tmp.NES.","
$ THEN
$ i = 8
$ excludes = tmp
$exclude_loop:
$ tmp = F$ELEMENT(i, ",", BUFF)
$ IF tmp.NES.","
$ THEN
$ excludes = excludes + "," + tmp
$ i = i + 1
$ GOTO exclude_loop
$ ENDIF
$ excludes = "/EXCLUDE=(" + excludes + ")"
$ ENDIF
$
$ SHOW SYMB excludes
$
$! Using a different delimitor:
$ READ SYS$INPUT BUFF
SHG101,$1$DGA1101:,25,15,10,5000,100,"X.TMP,Y.DAT"
$
$ excludes = ""
$ tmp = F$ELEMENT(1, """", BUFF)
$ IF tmp.NES."," THEN excludes = "/EXCLUDE=(" + tmp + ")"
$
$ SHOW SYMB excludes
在我们看到的代码中:
检查 ''DEVICE' 是否有高文件版本 (>= ;''HVERNO') - 可能需要一些时间...>
我敦促您查看 DFU 大循环代码“ READ FH3 /END_OF_FILE=LABEL$_EOF_DIRLIST1 BUFF2... ”将简化为:
dfu searc/versio=min=200'excludes'form="!AS"/out=tmp.tmp dka0:
无论有多少文件,这几乎都将在几秒钟内运行。扔掉整个警告内容,包括它总是检查 32000,因为它(几乎)是免费的。执行 DFU 命令后,如果 tmp.tmp 不为空,则通过创建标头并附加 tmp.tmp 创建“fancy”输出。总是删除 tmp.tmp ($ CLOSE/DISP=DELETE )
免费咨询...
那些 15 深嵌套的 IF-THEN-ELSE-ENDIF 来接收消息看起来很糟糕(维护)考虑数组查找?!这是一个已解决的示例:
$! prep for test
$ EL = p1
$ EL_DIAG = "FILE.DAT"
$ LOCAL_STATUS = "12345"
$
$! Code snippet to be tested
$
$ x = 'EL'
$ ! Fold multiple conditions into 1 message
$
$ if (EL .EQ. 7) .OR. (EL .EQ. 14) .OR. (EL .EQ. 21) .OR. (EL .EQ. 25) -
.OR. (EL .EQ. 29) .OR. (EL .EQ. 30) THEN x = "L1"
$
$ MSG_6 = "error opening " + EL_DIAG + " for WRITE (RM=" + LOCAL_STATUS + ")"
$ IDT_6 = "OPENIN"
$ MSG_L1 = "error reading from " + EL_DIAG + " (RM=" + LOCAL_STATUS + ")"
$ IDT_L1 = "READERR"
$ MSG_8 = "device name missing " + EL_DIAG
$ IDT_8 = "DNNF"
$
$ ! Pick up the required texts
$
$ IF F$TYPE(MSG_'x').EQS.""
$ THEN
$ WRITE SYS$OUTPUT "No message found for code: ", EL
$ EXIT 16
$ ENDIF
$
$ MSG = MSG_'x
$ IDTXT = IDT_'x
$
$ WRITE SYS$OUTPUT "MSG : ", MSG
$ WRITE SYS$OUTPUT "IDTXT: ", IDTXT
干杯,海因