代码不工作点错误

问题描述:

sub variablechanged()
on error goto errorhandler
dim MS as streams
dim ST as processstream
dim X as internalvariablewrapper
dim TO as double 
TO = activevariablewrapper.variable.getvalue()
set MS = activeobject.flowsheet.materialstreams
for each ST in MS
  set X = ST.getuservariable("Amb temp")  (term in bracket is also highlighted as red)
  X.variable.getvalue(TO)
NEXT ST
erorhandler:
end sub





我尝试了什么:



(错误指出第6行期待var名称)

和第10行的错误(括号中的术语也突出显示为红色)

代码编写软件名称aspen hysys来创建新的用户变量



What I have tried:

(error is pointing out in 6th line "expecting var name")
and also error in line 10 (term in bracket is also highlighted as red)
the code is written a software name aspen hysys to create new user variable

TO 是保留关键字。您需要重命名它。 此处 [ ^ ]是关键字的详细信息。
TO is a reserved keyword. You will need to rename it. Here[^] are details about the keyword.


机会是 TO 是VB中的保留字。

我担心用户变量名中不允许使用空格。
Chances are that TO is a reserved word in VB.
And I fear that space is not allowed in user variable name.