1

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

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

我想删除 MsgBox 并将“它”放在循环中并将其内容替换为;"进度记录:" & " of " & iNumberOfCases

有什么方法可以实现我想要的吗?

4

1 回答 1

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
于 2012-10-04T18:17:06.317 回答