Displaying Variables in a Dialog Box
Displaying Variables in a Dialog Box
(OP)
I have a macro that is reading data from attachmate and setting variables based on the data found. I could do it as an integer or string, either would work for me.
For example:
if (Sess0.Screen.getstring(2, 2, 2) = "12") then
iVA = 1
Else
iVA = 0
I want to pop a dialog box that shows the result of these searches. I'm not sure how to display the contents of a variable in a dialog box. Basically I need it to say "YES" or "NO" for about 15 categories.
Thanks!
For example:
if (Sess0.Screen.getstring(2, 2, 2) = "12") then
iVA = 1
Else
iVA = 0
I want to pop a dialog box that shows the result of these searches. I'm not sure how to display the contents of a variable in a dialog box. Basically I need it to say "YES" or "NO" for about 15 categories.
Thanks!
RE: Displaying Variables in a Dialog Box
hi,
CODE
case "12", "22", "32" 'your 15 categories
iVA = 1
Case else
iVA = 0
end select
msgbox iVA
Skip,
Just traded in my old subtlety...
for a NUANCE!
RE: Displaying Variables in a Dialog Box
I'm checking 15 different areas on 15 different screens. I have it sent to integer right now, but I'm going to swap it to string "yes" vs "no" later.
Is there a way to show all of them at once in the same box?
It may meet multiple criteria and need to know the best way to show the results of all 15 things being checked at once.
Thank you!
For example a larger portion:
CODE
if (Sess0.Screen.getstring(9, 4, 1) = "Y") then
iRepurchase = 1
Else
iRepurchase = 0
end if
if (Sess0.Screen.getstring(15, 71, 2) = "WO") then
iWellsOwned = 1
Else
iWellsOwned = 0
end if
if (Sess0.Screen.getstring(12, 51, 7) = "HEOWNED") then
iCoLoss = 1
Else
iCoLoss = 0
end if
if (Sess0.Screen.getstring(12, 51, 7) = "CLWOWE2") then
iCoLoss = 1
Else
iCoLoss = 0
end if
if (Sess0.Screen.getstring(15, 71, 6) = "WOEPBO") then
iWOEPBO = 1
Else
iWOEPBO = 0
end if
if (Sess0.Screen.getstring(15, 71, 6) = "WOEBPO") then
iWOEPBO = 1
Else
iWOEPBO = 0
end if
if (Sess0.Screen.getstring(15, 71, 5) = "WORSI") then
iRSI = 1
Else
iRSI = 0
end if
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.sendkeys("<Home>DLQ1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
if (Sess0.Screen.getstring(2, 39, 1) = "R") then
iREO = 1
Else
iREO = 0
end if
if (Sess0.Screen.getstring(2, 39, 1) = "B") then
iBK = 1
Else
iBK = 0
end if
if (Sess0.Screen.getstring(2, 41, 2) = "CO") then
iChargeOff = 1
Else
iChargeOff = 0
end if
if (Sess0.Screen.getstring(2, 2, 2) = "11") then
iFHA = 1
Else
iFHA = 0
end if
if (Sess0.Screen.getstring(2, 2, 2) = "12") then
iVA = 1
Else
iVA = 0
end if
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.sendkeys("<Home>TSK1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
if (Sess0.Screen.getstring(18, 10, 6) = "LGLLIT") then
if (Sess0.Screen.getstring(18, 02, 4) = "OPEN") then
iLitigation = 1
else
iLitigation = 0
end if
else
iLitigation = 0
end if
if (Sess0.Screen.getstring(18, 10, 6) = "DOSLIT") then
if (Sess0.Screen.getstring(18, 02, 4) = "OPEN") then
iLitigation = 1
else
iLitigation = 0
end if
else
iLitigation = 0
end if
if (Sess0.Screen.getstring(18, 10, 6) = "LGLSCU") then
if (Sess0.Screen.getstring(18, 02, 4) = "OPEN") then
iLitigation = 1
else
iLitigation = 0
end if
else
iLitigation = 0
end if
sScrnSUB = "ADD1"
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.sendkeys("<Home>MAS1<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
Sess0.Screen.putstring sScrnSUB , 3 ,5
Sess0.Screen.sendkeys( "<Enter>")
Sess0.Screen.WaitHostQuiet(g_HostSettleTime)
if (Sess0.Screen.getstring(17, 61, 1) = "1") then
iEmployee = 1
Else
iEmployee = 0
end if
if (Sess0.Screen.getstring(17, 61, 1) = "2") then
iEmployee = 1
Else
iEmployee = 0
end if
if (Sess0.Screen.getstring(17, 61, 1) = "5") then
iEmployee = 1
Else
iEmployee = 0
end if
if (Sess0.Screen.getstring(17, 61, 1) = "6") then
iEmployee = 1
Else
iEmployee = 0
end if
RE: Displaying Variables in a Dialog Box
Thanks again
RE: Displaying Variables in a Dialog Box
I changed them all to strings and created a new string and will just display the text in a msgbox, because I don't think there is a better way.
Just wanted to post solution in case anyone reads this later.
CODE
msgtext=" Employee Loan?: " & iEmployee & Chr(10)
msgtext=msgtext + " Wells Owned?: " & iWellsOwned & Chr(10)
msgbox msgtext
RE: Displaying Variables in a Dialog Box
here's several of your if...then...else condensed...
CODE
Select Case Sess0.Screen.getstring(18, 10, 6)
Case "LGLLIT", "DOSLIT", "LGLSCU", "6"
iLitigation = 1
Case Else
iLitigation = 0
End Select
Else
iLitigation = 0
End If
Select Case Sess0.Screen.getstring(17, 61, 1)
Case "1", "2", "5", "6"
iEmployee = 1
Case Else
iEmployee = 0
End Select
CODE
Sess0.Screen.SendKeys ("<Home>TSK1<Enter>")
Sess0.Screen.WaitHostQuiet (g_HostSettleTime)
CODE
Sess0.Screen.SendKeys ("<Home>TSK1<Enter>")
Do
DoEvents
Loop Until Sess0.Screen.WaitForCursor(r, c)
Skip,
Just traded in my old subtlety...
for a NUANCE!
RE: Displaying Variables in a Dialog Box
CODE
Dim iRepurchase as integer, iWellsOwned as integer, iCoLoss as integer, iWOEPBO as integer, iRSI as integer, iREO as integer
Dim iBK as integer, iChargeOff as integer, iFHA as integer, iVA as integer, iLitigation as integer, iEmployee as integer
Declare Function FileDlgFunction(identifier$, action, suppvalue)
Sub Main
yesno(0) = "NO"
yesno(1) = "YES"
variables(0) = "iRepurchase"
variables(1) = "iWellsOwned"
variables(2) = "iCoLoss"
variables(3) = "iWOEPBO"
variables(4) = "iRSI"
variables(5) = "iREO"
variables(6) = "iBK"
variables(7) = "iChargeOff"
variables(8) = "iFHA"
variables(9) = "iVA"
variables(10) = "iLitigation"
variables(11) = "iEmployee"
result(0) = yesno(iRepurchase)
result(1) = yesno(iWellsOwned)
result(2) = yesno(iCoLoss)
result(3) = yesno(iWOEPBO)
result(4) = yesno(iRSI)
result(5) = yesno(iREO)
result(6) = yesno(iBK)
result(7) = yesno(iChargeOff)
result(8) = yesno(iFHA)
result(9) = yesno(iVA)
result(10) = yesno(iLitigation)
result(11) = yesno(iEmployee)
Begin Dialog CallDialog 150, 150, 150, 135, "Results", .FileDlgFunction
ListBox 5, 5, 80, 110, variables, .L1
ListBox 90, 5, 50, 110, result, .L2
OkButton 45, 110, 45, 14
End Dialog
Dim CallDialog1 as CallDialog
On Error Resume Next
Dialog CallDialog1
End Sub
Function FileDlgFunction(identifier$, action, suppvalue)
Select Case action
Case 1
Case 2
Case 3
Case 4
Case 5
If DlgFocus() = "L1" Then
DlgValue("L2"),DlgValue("L1")
Else
DlgValue("L1"),DlgValue("L2")
End If
End Select
End Function
Hope it helps.
RE: Displaying Variables in a Dialog Box
RE: Displaying Variables in a Dialog Box
Otherwise perfect solution.
RE: Displaying Variables in a Dialog Box
I might be able come up with a dirty fix if you really need it.
RE: Displaying Variables in a Dialog Box
This worked excellently! Thanks again