通知用户SPSS的进展情况

时间:2012-10-03 12:15:47

标签: scripting vbscript spss

我的脚本中有以下SPSS代码;

MsgBox "Progressing"
For iCaseCount = 1 To iNumberOfCases
     'my code here
Next

我想删除MsgBox并将'it'放在循环中并用它替换它的内容; “进步记录:”& “of”& iNumberOfCases

有没有办法达到我想要的目的?

1 个答案:

答案 0 :(得分:0)

我终于找到了一种通过Internet Explorer显示进度的方法。

以下是VB脚本代码。

Dim objExplorer
Set objExplorer = CreateObject("InternetExplorer.Application")
objExplorer.navigate "about:blank" : objExplorer.Width = 350 : objExplorer.Height = 80 : objExplorer.toolbar = False : objExplorer.menubar = False : objExplorer.statusbar = False : objExplorer.Visible = True

For iCaseCount = 1 To iNumberOfCases
    DisplayProgress(objExplorer, iCaseCount, iNumberOfCases)
    'my code here
Next

objExplorer.Quit
Set objExplorer = Nothing

显示进度的方法

Sub DisplayProgress(ByVal x As Object, ByVal stage As Long, ByVal total As Long)
     'in code, the colon acts as a line feed
     x.Refresh
     x.document.write "<font color=black face=Arial>"
     x.document.write  "Processing record " & stage & " of " & total
     x.document.write "</font>"
End Sub