標題: iFix從后臺調度中訪問或修改全局變量的代碼 [打印本頁]

作者: solszl2    時間: 2020-4-1 15:11
標題: iFix從后臺調度中訪問或修改全局變量的代碼


1、從后臺調度中訪問或修改全局變量的代碼



描述:

在iFIX中使用調度要后臺運行的時候需要啟動FixBackgroundServer程序,而該程序實際上是啟動了獨立于Workspace的進程,所以在后臺調度中不能直接訪問全局變量。下面的例子代碼描述了怎樣訪問的方法:





" First get a pointer to the Application object in the Workspace

Dim WrkSpcApp As Object

Set WrkSpcApp = GetObject("", "Workspace.Application")



" Get a pointer to the Variable object called Variable 1 in the User globals

Dim TargetVar As Object

Set TargetVar = WrkSpcApp.Documents("User").Page.FindObject("Variable1")



" Set the current value in the variable object to a 1

TargetVar.CurrentValue = 1







歡迎光臨 (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1