想在vbs脚本中直接“显示弹出画面”,需要利用参数传递弹出画面名称。写脚本如下:
Sub PopScreenCenter(ByRef WindowWidth, ByRef WindowHeight, ByVal PopScreenName)
Dim PicTop, PicLeft, Screen, ScreenHeigth, ScreenWidth
'get the height/width of Screens
Set Screen=HmiRuntime.Screens(1)
ScreenHeigth=Screen.Height
ScreenWidth=Screen.Width
'set X/Y of the pop-window
PicTop=ScreenHeigth/2 - WindowHeight/2
PicLeft=ScreenWidth/2 - WindowWidth/2
SmartTags("pop_X")=PicLeft
SmartTags("pop_Y")=PicTop
ShowPopupScreen PopScreenName,PicLeft,PicTop,hmiToggle,hmiAnimationOff,hmiMedium
End Sub
总是报错:PopScreenName“错误参数类型”
问题补充:谢谢,但是在Portal脚本编辑器中“byRef”/“byVal”必选其一。
提问时间:2018-02-24 19:26:49 提问者: 晓风CAAMS - 新生  第1级
问题ID: 185005