Const SETTLE_TIME = 1000
Const R_C = "<Reset><Clear>"
Const E_ = "<Enter>"
Dim MyScn As Object
Sub SendNWait(sSendKeys$)
myScn.SendKeys(sSendKeys$)
myScn.WaitHostQuiet(SETTLE_TIME)
End Sub
Sub PutStr(sString$, row%, col%)
myScn.PutString sString$, row%, col%
End Sub
Function dlgMyFunc(identifier$, action, suppvalue)
dlgMyFunc = True
Select Case action
Case 1 'Dialogbox loaded
setflag =1
dlgValue "CkFloor11", setflag
dlgValue "CkFloor10", setflag
dlgValue "CkFloor09", setflag
dlgValue "CkFloor8Y", setflag
dlgValue "CkFloor8M", setflag
dlgValue "CkFloorInf", setflag
dlgValue "CkFloor04", setflag
dlgValue "CkFloor03", setflag
dlgValue "CkFloor02", setflag
Case 2 'Button clicked or value changed
Select Case identifier$
Case "btnUnSel", "btnSelAll"
If identifier$ = "btnUnSel" Then
setflag = 0
Else
setflag = 1
End If
dlgValue "CkFloor11", setflag
dlgValue "CkFloor10", setflag
dlgValue "CkFloor09", setflag
dlgValue "CkFloor8Y", setflag
dlgValue "CkFloor8M", setflag
dlgValue "CkFloorInf", setflag
dlgValue "CkFloor04", setflag
dlgValue "CkFloor03", setflag
dlgValue "CkFloor02", setflag
Case "btnOK", "ButCancel"
dlgMyFunc = FALSE
End Select
End Select
End Function
Sub Main()
Dim Sessions As Object
Dim System As Object
Set System = CreateObject("EXTRA.System") ' Gets the system object
If (System is Nothing) Then
Msgbox "Could not create the EXTRA System object. Stopping macro playback."
STOP
End If
Set Sessions = System.Sessions
If (Sessions is Nothing) Then
Msgbox "Could not create the Sessions collection object. Stopping macro playback."
STOP
End If
OldSystemTimeout& = System.TimeoutValue
If (SETTLE_TIME > OldSystemTimeout) Then
System.TimeoutValue = SETTLE_TIME
End If
Dim Sess0 As Object
Set Sess0 = System.ActiveSession
If (Sess0 is Nothing) Then
Msgbox "Could not create the Session object. Stopping macro playback."
STOP
End If
Set MyScn = Sess0.Screen
If Not Sess0.Visible Then Sess0.Visible = TRUE
Sess0.Screen.WaitHostQuiet(SETTLE_TIME)
'----------------------------------------------------------------------------------------------------------------------
'1. 11TH FLR 4N11, 4E11
'2. 10TH FLR 4N10, 4S10, 4E10
'3. 9TH FLR 4N09, 4S09, 4E09
'4. 7 & 8TH FLR (PSYCH) 4N07, 4E08EU, 4E08ELB, 4E08ELC, 4S07U, 4S07LD
'5. 7 & 8TH FLR (Medical) 4E08LA, 4S07L Note: 4S07L is printed to capture it all in one page
'6. Infirmary 4E07," 'Infirmary has moved to 7 East
'7. 4TH FLR 5N04, 5W04
'8. 3RD FLR 5W03
'9. 2ND FLR 5W02
'-----------------------------------------------------------------------------------------------------------------------
' This section of code contains the recorded events
Const Dest$= "T"
Const Lstr$ = "L"
Dim i As Integer
i = 1
Dim J11flr$, J10flr$, J09flr$, J8Yflr$, J7Wflr$, J04flr$, J03flr$, J02flr$
J11flr$ ="4N11,4E11,"
J10flr$ ="4N10,4S10,4E10,"
J09flr$ ="4N09,4S09,4E09,"
J8Yflr$ ="4N07,4E08U,4E08LB,4E08LC,4S07U,4S07LD," '7NORTH & 7S (Y floor)
J08flr$ ="4E08LA,4S07L," 'Medical 7 & 8th floor
J7Wflr$ ="4E07," 'Infirmary has moved to 7 East
J04flr$ ="5N04,5W04,"
J03flr$ ="5W03,"
J02flr$ ="5W02,"
Begin Dialog TankDialog 274, 171, "Tank List", .dlgMyFunc
PushButton 100, 70 , 50, 14, "Print", .btnOK
PushButton 100, 30, 50, 14, "Select All", .btnSelAll
PushButton 100, 50, 50, 14, "UnSelect All", .btnUnSel
CheckBox 10, 0, 44, 8, "11th Floor", .CkFloor11
CheckBox 10, 12, 44, 8, "10th Floor", .CkFloor10
CheckBox 10, 24, 44, 8, "9th Floor", .CkFloor09
CheckBox 10, 36, 44, 8, "7th/8th-Y", .CkFloor8Y
CheckBox 10, 48, 44, 8, "7th/8th-Med", .CkFloor8M
CheckBox 10, 60, 44, 8, "Infirmary", .CkFloorInf
CheckBox 10, 72, 44, 8, "4th Floor", .CkFloor04
CheckBox 10, 84, 44, 8, "3rd Floor", .CkFloor03
CheckBox 10, 96, 44, 8, "2nd Floor", .CkFloor02
CancelButton 100, 90, 40, 15, .ButCancel
End Dialog
Dim mydialog as TankDialog
On Error Resume Next
Dialog mydialog
If Err = 102 Then
MsgBox "Tank List canceled."
Exit Sub
End If
If mydialog.CkFloor11 = 0 then
J11flr$=""
End If
If mydialog.CkFloor10 =0 then
J10flr$=""
End If
If mydialog.CkFloor09 =0 then
J09flr$=""
End If
If mydialog.CkFloor8M =0 then
J08flr$=""
End If
If mydialog.CkFloor8Y =0 then
J8Yflr$=""
End If
If mydialog.CkFloorInf=0 then
J7Wflr$=""
End If
If mydialog.CkFloor04 =0 then
J04flr$=""
End If
If mydialog.CkFloor03 =0 then
J03flr$=""
End If
If mydialog.CkFloor02 =0 then
J02flr$=""
End If
Dim LocStr$
LocStr$=J11flr$ + J10flr$ + J09flr$ + J8Yflr$ + J08flr$ + J7Wflr$ + J04flr$ + J03flr$ + J02flr$
' Start JKJZ
SendNWait R_C
SendNWait E_
GetL$ = UCase(MyScn.GetString(3, 64, 1)) 'Get L
RetStr$ = GetField(LocStr$,i,",")
Do While RetStr$ <> ""
If GetL$ <> "L" Then
PutStr Lstr$, 3, 64
End If
PutStr RetStr$, 7, 64
PutStr Dest$, 10, 64
SendNWait E_
SendNWait R_C
SendNWait "JKJZ" & E_
i = i + 1
RetStr$ = GetField(LocStr$,i,",")
Loop
SendNWait R_C
SendNWait "XKMS" & E_
System.TimeoutValue = OldSystemTimeout
End Sub