Function ControlPad2(Item)
Dim objScrWindow
Dim ItemTagPrefix
Dim ItemLeft
Dim ItemTop
Dim HasPopped
Dim HasVacant
Dim EmptySlot
Dim SValue
Dim FirstEntry
Dim SWIndex
Dim j
Dim t
Dim PopWin
Dim winTitle
Dim winFile
Dim winFileIni
Dim winCaption
Dim winType
'On Error Resume Next
ItemTagPrefix = Item.TagPrefix
ItemLeft = Item.Left + Item.Width + 7
ItemTop = Item.Top
HasPopped = 0
HasVacant = 0
SValue = -1
FirstEntry = 0
SWIndex = 0
'Msgbox ItemTagPrefix & 1
'TitleCaption = ItemTagPrefix & " " & Title
winTitle = Item.winTitle'ItemTagPrefix & " " & Title
winFile = Left(Item.winFile, Len(Item.winFile)-4)
winFileIni = Item.winFileIni
winCaption = Item.winCaption
winType = Item.winType
Dim CurDataSet
Dim IsVTExist
Dim vars_Transfer
IsVTExist = False
For Each CurDataSet In HMIRuntime.DataSet
Select Case CurDataSet.Name
Case "vars_Transfer" IsVTExist = True
End Select
Next
vars_Transfer = "winFileIni=" & winFileIni & "|winCaption=" & winCaption & "|winType=" & winType
If IsVTExist = False Then
HMIRuntime.DataSet.Add "vars_Transfer" , vars_Transfer
End If
HMIRuntime.DataSet("vars_Transfer").Value = vars_Transfer
'Msgbox HMIRuntime.DataSet("vars_Transfer").Value
'ScreenItems("vars_Transfer").Text =
'ScreenItems("sys_WinFileini").Text = winFileIni
'ScreenItems("sys_WinCaption").Text = winCaption
'ScreenItems("sys_WinType").Text = winType
For j = 0 To 19
SWIndex = j + 1
'Msgbox SWIndex
Set objScrWindow = ScreenItems("PictureWindow" & SWIndex)
'Msgbox objScrWindow.ObjectName
If objScrWindow.Visible = True Then
If objScrWindow.CaptionText = winTitle Then
PopWin = ControlPadPos1(SWIndex, winFile, ItemTagPrefix, ItemLeft, ItemTop, winTitle, Item, Item.Left)
HasPopped = 1
Exit Function
End If
Else
If HasVacant = 0 Then
HasVacant = 1
EmptySlot = SWIndex
End If
ObjSeqA(j) = 0
End If
Next
If HasPopped = 1 Then
'Msgbox 88
Exit Function
End If
'Msgbox 99
If HasVacant = 1 Then
'Msgbox 100
PopWin = ControlPadPos1(EmptySlot, winFile, ItemTagPrefix, ItemLeft, ItemTop, winTitle, Item, Item.Left)
'Msgbox 101
Else
For t = 0 To 19
If SValue < ObjSeqA(t) Then
SValue = ObjSeqA(t)
FirstEntry = t + 1
End If
'Msgbox 3
PopWin = ControlPadPos1(FirstEntry, winFile, ItemTagPrefix, ItemLeft, ItemTop, winTitle, Item, Item.Left)
'Msgbox 4
Next
End If
End Function
请大神帮忙看看这脚本是什么意思?