命令语法问题 - ImageDocumentClose

Command syntax question - ImageDocumentClose

尝试使用代码关闭文件而不保存

ImageDocumentClose( ImageDocument imgDoc, Boolean saving )

但不知道我应该为 "Boolean saving".

放什么

我试过了

ImageDocumentClose( ImageDocument imgDoc, false )

ImageDocumentClose( ImageDocument imgDoc, 5>6)

ImageDocumentClose( ImageDocument imgDoc, 0)

ImageDocumentClose( ImageDocument imgDoc, 1)

全部都不工作。

快到了。

When the signature of a method is given in the results window or documentation like:

void ImageDocumentClose( ImageDocument imgDoc, Boolean saving )

Then it specifies the type of each parameter (here ImageDocument and Boolean) as well as the type of the return value (here void, i.e. no return value). The name of the parameters is only for additional guidance and not important. In fact, you might come acroess signatures given only as:

void ImageDocumentClose( ImageDocument, Boolean )

使用该命令的有效示例是:

image img := GetFrontImage()
imageDocument doc = img.ImageGetOrCreateImageDocument()
doc.ImageDocumentClose( 0 )

或同等学历:

imageDocument doc = GetFrontImageDocument()
ImageDocumentClose( doc, 0 )

与 DM 脚本一样,您可以将方法的第一个参数 放在带有 . 的命令的前面 ,但您没有到。

虽然它更容易阅读。特别是当许多命令是嵌套的而不是它们是流水线时。