Sub Main
' This is DMV's steal the ENTER key script (sometimes the F10 key) and do some behind the scenes processing
' This script only does ENTER key processing. A copy and different variation of this code is saved as F10.vba for PF10 processing
' The ENTER keys must be mapped to this script (enter.vba) and the users must use the keyboard.KBD
' located in the folder c:\ntc32 as are the scripts (*.vba)
'
' All of DMV screens provide a program or screen ID on line 2 column 2 up to 9 chars (maybe 8)
' The main purpose thus far is to identify which screens require a Lead / Cover sheet for scanning
' field / office work documents ...
'
' The story is that every time the users presses ENTER that this script is executed. The script looks at the
' screen id (both line 2 and 3) and if it matches an ID requiring a lead sheet, then it will scrape the areas on the screen collecting
' the data and saving it into local string vars to be passed to the windows application specified in the shell
' or winexec command within this script. The app name is currently named IDRSCoversheetFldWrk.exe.
' The end result is a piece of paper with some info and bar codes in 128 format printed on it to allow searching
' for the documents that are scanned behind it when they are processed in FISCAL scanning section
'Modifications
'=======Date========VER=======Programmer==============Notes
' 02/28/14 001 MLP,JJM Adding barcode and new template for central issuance receipt, bar code place at the top
' 03/25/14 MLP Added new CIIV signature pad call
' 05/19/14 MLP Changed sig pad from "T" to "P" environment
' 12/11/14 002 JJM Added option to print receipt or not to print
Dim ScrLine As String
Dim NextScr As String
Dim retmsg As Variant
Dim Data(21) As String
Dim MaxElements as Integer
Dim pos As Integer
Dim foundit As Integer
Dim ret as Integer
Dim CmdLine As String
Dim FeeCheck As String
Dim xpos As Integer
Dim firstpos As Integer
Dim lastpos As Integer
Dim endpos as Integer
dim prismflag as string
' Vars to collect the screen data into
Dim sName As String
Dim sIDLic As String
dim sVIN As string
dim sVIN1 as string
Dim sPermitKey As String
Dim sDate As String
Dim sAction As String
Dim sBatch As String
Dim sType As String
Dim sType1 As String
Dim thisType As String
Dim sLoc As String
Dim sDocId As String
Dim sJunkStatus As String
Dim sResAdd as String
Dim sResCity as String
dim sResCity1 as string
Dim sResState as String
dim sResState1 as string
Dim sResZip as String
dim sResZip1 as string
Dim sPlate as String
dim sPlate1 as string
dim sModelYear as string
Dim sMake as String
dim sMake1 as String
dim sModel as string
dim sModel1 as string
Dim sYear as String
Dim sStyle as String
Dim sUnit as String
dim sUnit1 as string
Dim sGrossVehWeight as String
dim sGrossVehWeight1 as string
Dim sRegExpYear as String
Dim sRegExpMonth as String
Dim sRegExpPrismFormat as String
dim sCarrierID as string
dim sTaxID as string
dim sAxelCount as string
dim sMCRFS as string
Dim Status As String
Dim BatchNum As String
Dim ScrName As String
Dim LocNum As String
Dim BatchDate As String
Dim BatchInfo As String
Dim s as String
Dim found as integer
Dim rCity as String
dim rCity1 as string
Dim rAddress1 as String
Dim rAddress11 as string
Dim rAddress2 as String
Dim rAddress21 as string
Dim mAddress1 as String
dim mAddress11 as string
Dim mAddress2 as String
Dim mAddress21 as string
Dim Country as String
dim Country1 as string
' Vars collected for barcode
Dim FName As String
Dim MName As String
Dim LName As String
Dim SuffName As String
Dim CName As String
dim sFullName as string
Dim x, x1 As String
Dim User As String
Dim L5 As String
Dim ScnLine As String
Dim CNameTemp As String
Dim lastpostemp As String
' Var collected for PRISM check
Dim sRegVehTitle As String
' Var(s) collected for HVUT check
Dim sHVUT As String
Dim sPrismClassCode As String
Dim sPerformPrismCheck As String
Dim sProgname as String
'Array of screen types / values
Data(0) = "AVTU300P" ' Junk Title Screen
Data(1) = "GENIC " ' The DL screen for New/Renewal/Duplicate
Data(2) = "PVTM000P" ' Vehicle Menu - VIN Error exceeding 18 chars
Data(3) = "PMVU152P" ' Handicap permit also uses f10.vba
Data(4) = "PMVU100P" ' Operator Batch Status
Data(5) = "PMVU110P" ' Change Batch Status
Data(6) = "AVTU200P" ' Funct 1 Title&Reg
Data(7) = "AVTU205P" ' Funct 1 Title&Reg
Data(8) = "ATPU200P" ' Temp Permit Function 1 existing vehicle Title & Registration
Data(9) = "ATPU210P" ' Temp Funct 5 Title&Reg
Data(10) = "AVTU220P" ' Funct 4 NTI .. no title issued
Data(11) = "AVTU225P" ' Funct 4 NTI .. no title issued
Data(12) = "AVTU230P" ' Funct 5 Duplicate Registration
Data(13) = "AVTU235P" ' Funct 6 Renewal
Data(14) = "AVTU270P" ' Vehicle Title Information - scrape owner/company name and PRISM check
Data(15) = "ATPM000P" ' Temp Permit Menu-VIN Error exceeding 18 chars
Data(16) = "ATPU270P" ' Vehicle Title Information / Temp Permit - scrape owner/company name and PRISM check
Data(17) = "ATPU205P" ' Temp Funct 1 & 4 Title&Reg
Data(18) = "ATPU230P" ' Temp Funct 4 Title&Reg
Data(19) = "PMSP100P" ' View ALVIN Msg / Incoming Digital Image Record (jia 2/17/2010)
Data(20) = "PXXM011N" ' Medical Certificate Cover Sheet
Data(21) = "empty" ' empty
' Set the maximum number of screen possibilities
' Bump this up as additional screens are added
MaxElements = 20 'pb 11/25/2011
foundit = -1
'Read line 3 col 2 and snag 8 chars might be the Screen Id
EMReadScreen ScrLine,8,3,2
'
' Check to see if we detected a screen that needs processing
'
for pos = 0 to MaxElements ' Set loop for max elements for speed
if ScrLine = Data(pos) then ' See if a match is made
foundit = pos ' Set the var to the value needed in the select case below
pos = MaxElements ' Set the loop control var to max as to
exit the loop so as not to
continue looking
end if
next pos
if foundit = -1 then ' Check we have detected a screen that needs scraping yet
'Read line 3 col 3 and snag 8 chars might be the Screen Id
EMReadScreen ScrLine,8,3,3
'
' Check to see if we detected a screen that needs processing
'
for pos = 0 to MaxElements ' Set loop for max elements for speed
if ScrLine = Data(pos) then ' See if a match is made
foundit = pos ' Set the var to the value needed in the select case below
pos = MaxElements ' Set the loop control var to max as to exit the loop so as not to continue looking
end if
next pos
end if
if foundit = -1 then
'Read line 2 col 3 and snag 8 chars might be the Screen Id
EMReadScreen ScrLine,8,2,3
'
' Again check to see if we detected a screen that needs processing
' for some screen id's are on line 2 and others on line 3
'
for pos = 0 to MaxElements ' Set loop for max elements for speed
if ScrLine = Data(pos) then ' See if a match is made
foundit = pos ' Set the var to the value needed in the select case below
pos = MaxElements ' Set the loop control var to max as to exit the loop so as not to continue looking
end if
next pos
end if
if foundit = -1 then ' Check we have detected a screen that needs scraping yet
'Read line 2 col 2 and snag 8 chars might be the Screen Id
EMReadScreen ScrLine,8,2,2
'
' Again check to see if we detected a screen that needs processing
' for some screen id's are on line 2 and others on line 3
'
for pos = 0 to MaxElements ' Set loop for max elements for speed
if ScrLine = Data(pos) then ' See if a match is made
foundit = pos ' Set the var to the value needed in the select case below
pos = MaxElements ' Set the loop control var to max as to
exit the loop so as not to
continue looking
end if
next pos
end if
if foundit = 6 or foundit = 7 or foundit = 8 or foundit = 9 or foundit = 10 or foundit = 11 or foundit = 12 or foundit = 13 or foundit = 17 or foundit = 18 then
' We have detected a screen that will potentially require a PRISM Check
FileRead "C:\NTC32\DMVPRISMClient\PRISMCheck.txt",prismflag,0
if NM_ResultCode = 3 then
FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' file wasn't found .... first time processing this screen
end if
if foundit = 6 or foundit = 7 then
EMReadScreen sPrismClassCode,2,7,32 ' Read the classcode
else
EMReadScreen sPrismClassCode,2,7,33
end if
if foundit = 8 or foundit = 9 then
EMReadScreen ScrLine,1,7,31 ' checking for the : in CLASS: onscreen
if ScrLine <> ":" then
EMReadScreen sPrismClassCode,2,7,32
end if
end if
if foundit = 6 or foundit = 7 then
EMReadScreen sHVUT,1,8,46 ' Read the HVUT flag (Y or N)
else
EMReadScreen sHVUT,1,8,47
end if
if foundit = 8 then
EMReadScreen ScrLine,1,8,45 ' checking for the : in HV TAX: onscreen
if ScrLine <> ":" then
EMReadScreen sHVUT,1,8,46
end if
end if
if foundit = 9 then
EMReadScreen ScrLine,1,8,45 ' checking for the : in HV Tax: onscreen
if ScrLine <> ":" then
EMReadScreen sHVUT,1,9,62 ' new screen position due to NMVTIS - screen map ATPM2101 on screen ATPU210P
end if
end if
FileRead "C:\NTC32\DMVPRISMClient\PRISMCheck.txt",prismflag,0
if prismflag = "Y" then 'indicates that screen has been processed earlier ... no need to process this screen again
sPerformPrismCheck = "N"
else
If (sPrismClassCode = "92" Or sPrismClassCode = "93" Or sPrismClassCode = "94") Or _
((sPrismClassCode = "42" Or sPrismClassCode = "52" Or _
sPrismClassCode = "43" Or sPrismClassCode = "44" Or sPrismClassCode = "5P" Or sPrismClassCode = "4P" Or _
sPrismClassCode = "53" Or sPrismClassCode = "54" Or sPrismClassCode = "55") And sHVUT = "Y") Then ' A PRISM Check is required ....
sPerformPrismCheck = "Y"
else
FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' PRISM Check is not applicable for this Vehicle.
sPerformPrismCheck = "N"
end if
end if
If sPerformPrismCheck = "Y" Then ' A PRISM Check is required ....
FileRead "C:\NTC32\DMVPRISMClient\PRISMCheck.txt",prismflag,0
if prismflag = "N" then ' first
time processing this screen
FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "Y" ' flag that we have processed this screen
end if
if foundit = 6 or foundit = 7 then
EMReadScreen sVIN,20,4,32 ' Read the VIN (SERIAL: onscreen)
else
EMReadScreen sVIN,20,4,33
end if
if foundit = 8 or foundit = 9 then
EMReadScreen ScrLine,1,4,31 ' checking for the : in SERIAL: onscreen
if ScrLine <> ":" then
EMReadScreen sVIN,20,4,32
end if
end if
xpos = instr(1,sVIN,"_")
sVIN1 = left(sVIN,(xpos-1))
sVIN1 = RTrim(sVIN)
EMReadScreen sPlate,6,4,15
xpos = instr(1,sPlate,"_")
sPlate1 = left(sPlate,(xpos-1))
if len(sPlate1) < 6 or sPlate1 = " " then
sPlate1 = "NA1234"
end if
if foundit = 6 or foundit = 7 then
EMReadScreen sMake,4,6,32 ' Read the MAKE
else
EMReadScreen sMake,4,6,33
end if
if foundit = 8 or foundit = 9 then
EMReadScreen ScrLine,1,6,31 ' checking for the : in MAKE: onscreen
if ScrLine <> ":" then
EMReadScreen sMake,4,6,32
end if
end if
xpos = instr(1,sMake,"_")
sMake1 = left(sMake,(xpos-1))
if foundit = 6 or foundit = 7 then
EMReadScreen sModel,3,6,46 ' Read the MODEL
else
EMReadScreen sModel,3,6,47
end if
if foundit = 8 or foundit = 9 then
EMReadScreen ScrLine,1,6,45 ' checking for the : in MODEL: onscreen
if ScrLine <> ":" then
EMReadScreen sModel,4,6,46
end if
end if
xpos = instr(1,sModel,"_")
sModel1 = left(sModel,(xpos-1))
EMReadScreen sModelyear,4,6,15
EMReadScreen sStyle,2,6,69
if foundit = 6 or foundit = 7 or foundit = 10 or foundit = 11 or foundit = 13 then
EMReadScreen sUnit,7,17,73 ' Read the UNIT NO:
else
EMReadScreen sUnit,7,17,71
end if
if foundit = 12 or foundit = 18 then
EMReadScreen sUnit,7,17,68
end if
xpos = instr(1,sUnit,"_")
sUnit1 = left(sUnit,(xpos-1))
' sUnit = Trim(sUnit)
SUnit1 = sUnit1.Replace(" ", "")
if foundit = 6 or foundit = 7 then
EMReadScreen sGrossVehWeight,5,7,46 ' Read the Weight
else
EMReadScreen sGrossVehWeight,5,7,47
end if
if foundit = 8 or foundit = 9 then
EMReadScreen ScrLine,1,7,45 ' checking for the : in UNLDN WGT: onscreen
if ScrLine <> ":" then
EMReadScreen sGrossVehWeight,5,7,46
end if
end if
xpos = instr(1,sGrossVehWeight,"_")
sGrossVehWeight1 = left(sGrossVehWeight,(xpos-1))
EMReadScreen sRegExpYear,4,9,31
EMReadScreen sRegExpMonth,2,9,15
sRegExpPrismFormat = sRegExpYear + sRegExpMonth
sYear = Right$(sModelYear,2)
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen rAddress1,25,15,18
else
EMReadScreen rAddress1,25,14,18
end if
xpos = instr(1,rAddress1,"_")
rAddress11 = left(rAddress1,(xpos-1))
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen rCity,20,15,44
else
EMReadScreen rCity,20,14,44
end if
xpos = instr(1,rCity,"_")
rCity1 = left(rCity,(xpos-1))
if rCity1 = "" then
if rAddress11 = "" then ' stop .... ALVIN will validate and object to this.
FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N"
stop
else
if left$(rAddress1,4) = "SAME" then ' use the Mailing Address, City, State, Zip
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen mAddress1,25,13,18
else
EMReadScreen mAddress1,25,12,18
end if
xpos = instr(1,mAddress1,"_")
mAddress11 = left(mAddress1,(xpos-1))
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen mAddress2,25,14,18
else
EMReadScreen mAddress2,25,13,18
end if
xpos = instr(1,mAddress2,"_")
mAddress21 = left(mAddress2,(xpos-1))
if len(mAddress21) > 0 then
sResAdd = mAddress11 + " " + mAddress21 ' Residence address and Mailing address are the same.
else
sResAdd = mAddress11
end if
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen sResCity,20,13,44
else
EMReadScreen sResCity,20,12,44 ' .... the Mailing Address City onscreen
end if
xpos = instr(1,sReSCity,"_")
sResCity1 = left(sResCity,(xpos-1))
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen sResState,2,13,65
else
EMReadScreen sResState,2,12,65 ' .... the Mailing Address State onscreen
end if
xpos = instr(1,sResState,"_")
sResState1 = left(sResState,(xpos-1))
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen sResZip,9,13,68
else
EMReadScreen sResZip,9,12,68 ' .... the Mailing Address Zipcode onscreen
end if
xpos = instr(1,sResZip,"_")
sResZip1 = left(sResZip,(xpos-1))
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen Country,15,14,44
else
EMReadScreen Country,15,13,44 ' .... the Mailing Address Country onscreen
end if
xpos = instr(1,Country,"_")
Country1 = left(Country,(xpos-1))
if len(Country1) > 0 then
sResState1 = sResState1 + Country1
end if
if sResCity1 = "" then
if sResZip1 = "" then
FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N"
stop ' stop .... ALVIN will validate and object to this.
else
open "C:\ntc32\zipcodes.txt" for INPUT as #1 ' Zip Code Look-up
found = 0
Do While not EOF(1) and found = 0
Line Input #1, s
if left(s,5) = left(sResZip1,5) then
found = 1
sResCity1 = right(s,len(s)-6)
sResState1 = "AK"
end if
Loop
close #1
end if
end if
end if
end if
else ' Residence City is not empty - we have a Residence Address onscreen
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen rAddress2,25,16,18
else
EMReadScreen rAddress2,25,15,18 ' Residence Address extra line
end if
xpos = instr(1,rAddress2,"_")
rAddress21 = left(rAddress2,(xpos-1))
if len(rAddress22) > 0 then
sResAdd = rAddress11 + " " + rAddress21
else
sResAdd = rAddress11
end if
sResCity1 = rCity1 ' Residence City
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen sResState,2,15,65
else
EMReadScreen sResState,2,14,65 ' Residence State
end if
xpos = instr(1,sResState,"_")
sResState1 = left(sResState,(xpos-1))
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen sResZip,9,15,68
else
EMReadScreen sResZip,9,14,68 ' Residence Zip
end if
xpos = instr(1,sResZip,"_")
sResZip1 = left(sResZip,(xpos-1))
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen Country,15,16,44
else
EMReadScreen Country,15,15,44 ' Residence Country
end if
xpos = instr(1,sCountry,"_")
sCountry1 = left(sCountry,(xpos-1))
if len(Country1) > 0 then
sResState1 = sResState1 + Country1
end if
end if
if sResZip1 = "" then
if foundit = 7 or foundit = 11 or foundit = 17 then
EMReadScreen sResZip,9,15,68
else
EMReadScreen sResZip,9,14,68 ' Residence Zip
end if
xpos = instr(1,sResZip,"_")
sResZip1 = left(sResZip,(xpos-1))
end if
if sResState1 = "" or sResCity1 = "" then
open "C:\ntc32\zipcodes.txt" for INPUT as #1 ' Zip Code Look-up
found = 0
Do While not EOF(1) and found = 0
Line Input #1, s
if left(s,5) = left(sResZip1,5) then
found = 1
if sResCity1 = "" then
sResCity1 = right(s,len(s)-6)
end if
sResState1 = "AK"
end if
Loop
close #1
end if
if sResState1 = "" or sResZip1 = "" or sResCity1 = "" then
Msgbox "City, State and ZipCode are all mandatory fields for DOT PRISM checks",0,"PRISM Information Required"
FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N"
stop ' State and ZipCode are mandatory fields.
end if
clientparams = " /vin:" + sVIN1 + " /plate:" + sPlate1 + " /make:" + sMake1 + " /model:" + sModel1 + _
" /modelyear:" + sYear + " /classcode:" + sStyle + " /fleet:" + sUnit1 + _
" /weight:" + sGrossVehWeight1 + " /expiredate:" + sRegExpPrismFormat + " /hvut:FALSE" + " /street:" + _
Chr(34) + sResAdd + Chr(34) + " /city:" + Chr(34) + sResCity1 + Chr(34) + " /state:" + _
Chr(34) + sResState1 + Chr(34) + " /zipcode:" + sResZip1
kill("C:\NTC32\DMVPRISMClient\PRISMClientParams.txt")
FileWrite "C:\NTC32\DMVPRISMClient\PRISMClientParams.txt", clientparams
kill("C:\NTC32\DMVPRISMClient\CarrierID.txt")
kill("C:\NTC32\DMVPRISMClient\TaxID.txt")
kill("C:\NTC32\DMVPRISMClient\AxelCount.txt")
' * else
' * FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' PRISM Check is not applicable for this Vehicle.
end if
EMSendKeyFast "<ENTER>"
Exit Sub
end if
if foundit = 14 or foundit = 16 then ' Vehicle Title screens full reg (14) and temp permits (16)
' * This consists of the company name, first, middle, last name and suffix which
' * is needed for the 2D barcode and is written in their own files.
' * There are seven screens that scrape the info, however there are two possible ways
' * of processing. One of them enables the user to input the info and the other does not.
' * There can only be only be ONE first owner and could be a person or a company name,
' * therefore a person's first name or a company name will be written to the lname.txt file.
' * rev 01-04-08
' *
' * Modified July 2010 - Patrick Brosnan
' * Since we print up to two Owner's names on the registration form, we need to provide for including two
' * names in the 2D barcode (OW subfile on top barcode on form, as per AAMVA specifications).
' * If present, the SECOND owner's name (Person or Company) is written to the fname2.txt, mname2.txt, lname2.txt
' * suffname2.txt (cname2.txt if a Company).
FileRead "C:\NTC32\DMVPRISMCLient\PRISMCheck.txt",prismflag,0
' To collect for PRISM check
EMReadScreen sRegVehTitle, 7,19,15
sRegVehTitle = RTrim(sRegVehTitle)
' To collect the First, Middle, Last and Suffix Names
' First Name of First Owner
EMReadScreen ScnLine,80,7,1 ' Reads line 7 company name
xpos = InStr(12, ScnLine, ":") ' Find first colon
firstpos = xpos + 2 ' Should be on first char of company name
CNameTemp = Mid$(ScnLine, firstpos, 1) ' looks for the string
Conj = Mid$(ScnLine, 54, 4) 'Grab the first Conjunction field from screen
lastpos = 0
lastpos = Instr(1, Conj, "_") 'See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, Conj, " ") ' See if has a space
else
Conj = Mid$(Conj, 1, lastpos - 1) ' lastpos = count of chars
end if
if Conj = "" then
Conj = " "
end if
Conj = UCase(Conj)
FileWrite "C:\NTC32\RegistrantInfo\conj1.txt", Conj
if CNameTemp = " " Or CNameTemp = "_" then ' if the company name line is empty or has an underscore then.......
' we have a person to deal with
CName = " "
FileWrite "C:\NTC32\RegistrantInfo\cname.txt", CName
' First Name of First Owner
EMReadScreen ScnLine,80,5,1 ' Reads line 5
FName = Mid$(ScnLine, 15, 16) 'Grab the entire first name field from screen
lastpos = 0
lastpos = Instr(1, FName, "_") 'See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, FName, " ") ' See if has a space
else
FName = Mid$(FName, 1, lastpos - 1) ' lastpos = count of chars
end if
FName = UCase(FName)
sFullName = FName ' We now have the first name with out _'s or spaces
FileWrite "C:\NTC32\RegistrantInfo\fname.txt", FName
lastpos = 0
MName = Mid$(ScnLine, 31, 16) ' Grab the Middle Name
lastpos = Instr(1, MName, "_") ' See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, MName, " ") ' See if has a space
else
MName = Mid$(MName, 1, lastpos - 1 ) ' lastpos = count of chars
MName = UCase(MName)
end if
if MName = "" then
MName = " "
else
sFullName = sFullName + " " + MName
end if
FileWrite "C:\NTC32\RegistrantInfo\mname.txt", MName
lastpos = 0
LName = Mid$(ScnLine, 47, 26) ' Grab the Last Name
lastpos = Instr(1, LName, "_") ' See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, LName, " ") ' See if has a space
else
LName = Mid$(LName, 1, lastpos - 1 ) ' lastpos = count of chars
LName = UCase(LName)
sFullName = sFullName + " " + LName
end if
FileWrite "C:\NTC32\RegistrantInfo\lname.txt", LName
lastpos = 0
SuffName = Mid$(ScnLine, 73, 5) ' Grab the suffix
lastpos = Instr(1, SuffName, "_") ' See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, SuffName, " ") ' See if has a space
else
SuffName = Mid$(SuffName, 1, lastpos - 1 ) ' lastpos = count of chars
SuffName = UCase(SuffName)
end if
if SuffName = "" then
SuffName = " "
else
sFullName = sFullName + " " + SuffName
end if
SuffName = UCase(SuffName)
FileWrite "C:\NTC32\RegistrantInfo\suffname.txt", SuffName
else
CName = Mid$(ScnLine, 15, 32) ' Grab the entire Company Name
lastpos = 0
lastpos = InStr(1, CName, "_") ' Finds two spaces after the name
if lastpos = 0 then
lastpos = InStr(1, CName, " ") ' if company name has an underscore
else
CName = Mid$(CName, 1, lastpos - 1 )
end if
CName = UCase(CName)
sFullName = CName
FileWrite "C:\NTC32\RegistrantInfo\cname.txt", CName
FileWrite "C:\NTC32\RegistrantInfo\fname.txt", " "
FileWrite "C:\NTC32\RegistrantInfo\mname.txt", " "
FileWrite "C:\NTC32\RegistrantInfo\lname.txt", " "
FileWrite "C:\NTC32\RegistrantInfo\suffname.txt", " "
end if
' To collect the First, Middle, Last and Suffix Names for Second Owner
EMReadScreen ScnLine,80,10,1 ' Reads line 7 company name
xpos = InStr(12, ScnLine, ":") ' Find first colon
firstpos = xpos + 2 ' Should be on first char of company name
CNameTemp = Mid$(ScnLine, firstpos, 1) ' looks for the string
Conj = Mid$(ScnLine, 54, 4) 'Grab the second Conjunction field from screen
lastpos = 0
lastpos = Instr(1, Conj, "_") 'See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, Conj, " ") ' See if has a space
else
Conj = Mid$(Conj, 1, lastpos - 1) ' lastpos = count of chars
end if
if Conj = "" then
Conj = " "
end if
Conj = UCase(Conj)
FileWrite "C:\NTC32\RegistrantInfo\conj2.txt", Conj
if CNameTemp = " " Or CNameTemp = "_" then ' if the company name line is empty or has an underscore then.......
' we have a person to deal with
CName = " "
FileWrite "C:\NTC32\RegistrantInfo\cname2.txt", CName
' First Name of Second Owner
EMReadScreen ScnLine,80,8,1 ' Reads line 8
FName = Mid$(ScnLine, 15, 16) 'Grab the entire first name field from screen
lastpos = 0
lastpos = Instr(1, FName, "_") 'See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, FName, " ") ' See if has a space
else
FName = Mid$(FName, 1, lastpos - 1) ' lastpos = count of chars
end if
FName = UCase(FName)
' sFullName = FName
if FName = "" then
FName = " "
end if ' We now have the first name with out _'s or spaces
FileWrite "C:\NTC32\RegistrantInfo\fname2.txt", FName
lastpos = 0
MName = Mid$(ScnLine, 31, 16) ' Grab the Middle Name
lastpos = Instr(1, MName, "_") ' See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, MName, " ") ' See if has a space
else
MName = Mid$(MName, 1, lastpos - 1 ) ' lastpos = count of chars
MName = UCase(MName)
' sFullName = sFullName + " " + MName
end if
if MName = "" then
MName = " "
end if
FileWrite "C:\NTC32\RegistrantInfo\mname2.txt", MName
lastpos = 0
LName = Mid$(ScnLine, 47, 26) ' Grab the Last Name
lastpos = Instr(1, LName, "_") ' See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, LName, " ") ' See if has a space
else
LName = Mid$(LName, 1, lastpos - 1 ) ' lastpos = count of chars
LName = UCase(LName)
' sFullName = sFullName + " " + LName
end if
if LName = "" then
LName = " "
end if
FileWrite "C:\NTC32\RegistrantInfo\lname2.txt", LName
lastpos = 0
SuffName = Mid$(ScnLine, 73, 5) ' Grab the suffix
lastpos = Instr(1, SuffName, "_") ' See if underscore char is there
if lastpos = 0 then
lastpos = Instr(1, SuffName, " ") ' See if has a space
else
SuffName = Mid$(SuffName, 1, lastpos - 1 ) ' lastpos = count of chars
SuffName = UCase(SuffName)
' sFullName = sFullName + " " + SuffName
end if
if SuffName = "" then
SuffName = " "
end if
SuffName = UCase(SuffName)
FileWrite "C:\NTC32\RegistrantInfo\suffname2.txt", SuffName
else
CName = Mid$(ScnLine, 15, 32) ' Grab the entire Company Name
lastpos = 0
lastpos = InStr(1, CName, "_") ' Finds two spaces after the name
if lastpos = 0 then
lastpos = InStr(1, CName, " ") ' if company name has an underscore
else
CName = Mid$(CName, 1, lastpos - 1 )
end if
CName = UCase(CName)
' sFullName = CName
FileWrite "C:\NTC32\RegistrantInfo\cname2.txt", CName
FileWrite "C:\NTC32\RegistrantInfo\fname2.txt", " "
FileWrite "C:\NTC32\RegistrantInfo\mname2.txt", " "
FileWrite "C:\NTC32\RegistrantInfo\lname2.txt", " "
FileWrite "C:\NTC32\RegistrantInfo\suffname2.txt", " "
end if
if prismflag <> "Y" then
FileWrite "C:\NTC32\DMVPRISMClient\PRISMClientParams1.txt"," /axels: /carrier: /tin:" + " /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + Chr(34) + sMCRFS + Chr(34)
EMSendKeyFast "<ENTER>"
Exit Sub
end if
FileRead "C:\NTC32\DMVPRISMClient\CarrierID.txt", sCarrierID, 0
if NM_ResultCode = 3 then ' file not found ..... so prompt for DOT Number, Tax ID, No. of Axels and MCRFS to change.
Shell ("C:\NTC32\DMVPRISMClient\PRISMPrompt.exe") ' Run PRISMPrompt.exe, which will prompt user for above 4 items
Do
FileRead "C:\NTC32\DMVPRISMClient\CarrierID.txt", sCarrierID, 0
If NM_ResultCode <> 3 Then
FileRead "C:\NTC32\DMVPRISMClient\TaxID.txt", sTaxID, 0
If NM_ResultCode <> 3 Then
FileRead "C:\NTC32\DMVPRISMClient\AxelCount.txt", sAxelCount, 0
If NM_ResultCode <> 3 Then
FileRead "C:\NTC32\DMVPRISMClient\MCRFS.txt",sMCRFS,0
If NM_ResultCode <> 3 Then
Exit Do ' All 4 files were found, #Axles is > 0 ... so the user has hit OK at the prompt
End If
End If
End If
End If
Dim sCancel As String
FileRead "C:\NTC32\DMVPRISMClient\PRISMPromptCancel.txt", sCancel, 0
If NM_ResultCode <> 3 Then
Stop
End If
Loop
end if
' we are past the do ... loop above so we have sCarrierID, sTaxID, sAxelCount and sMCRFS values
FileRead "C:\NTC32\DMVPRISMClient\CarrierID.txt", sCarrierID, 0
FileRead "C:\NTC32\DMVPRISMClient\TaxID.txt", sTaxID, 0
FileRead "C:\NTC32\DMVPRISMClient\AxelCount.txt", sAxelCount, 0
FileRead "C:\NTC32\DMVPRISMClient\MCRFS.txt", sMCRFS, 0
FileRead "C:\NTC32\DMVPRISMClient\PRISMClientParams.txt",Scnline,0
FileWrite "C:\NTC32\DMVPRISMClient\PRISMClientParams1.txt"," /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + " /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + Chr(34) + sMCRFS + Chr(34)
dim sPRISMClientSuccess as string
dim sPRISMClientError As string
dim sPRISMClientFailMsg as string
dim sPRISMClientFailMsg1 as string
dim sPRISMClientFailMsg2 as string
dim Error_Checker as Integer
Kill "C:\NTC32\DMVPRISMClient\Success.txt" ' indicates passing PRISM check
Kill "C:\NTC32\DMVPRISMClient\Fail.txt" ' indicates failure of PRISM check ... print letter and stop
Kill "C:\NTC32\DMVPRISMClient\Error.txt" ' indicates a DOT / PRISM problem .... continue registration using DMV barcode
' Shell ("C:\NTC32\DMVPRISMClient\PRISMClient.exe " + ScnLine + " /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + _
' " /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + sMCRFS)
' June 2013 update: Check for 'EXEMPT' and bypass PRISM call if found - PB
if sCarrierID = "EXEMPT" then
FileWrite "C:\NTC32\DMVPRISMClient\Success.txt","EXEMPT"
else
Shell ("C:\NTC32\DMVPRISMClient\PRISMClient.exe " + ScnLine + " /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + _
" /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + sMCRFS)
end if
Do 'Examine outcome of PRISM check .... if fails, option to retry using different/corrected sCarrierID, sTaxID, sAxelCount values
LoopLabel:
FileRead "C:\NTC32\DMVPRISMClient\Success.txt", sPRISMClientSuccess, 0
if NM_ResultCode <> 3 then ' Success.txt has been found ... the PRISM check has passed
EMSendKeyFast "<ENTER>"
Exit Sub
end if
FileRead "C:\NTC32\DMVPRISMClient\Error.txt", sPRISMClientError, 0
If NM_ResultCode <> 3 Then ' Error.txt has been found .... PRISM / DOT communication problem ... proceed using DMV barcode ... or opt to retry.
ret = MsgBox("Network/Communications error attempting to contact DOT PRISM Service" & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Do you want to retry PRISM check ?",4,"UNABLE TO CONTACT DOT")
if ret <> 6 then
EMSendKeyFast "<ENTER>" ' not opting to retry ....
Exit Sub ' dmv.vba script will check for Success.txt / Error.txt files to determine which barcode to use.
else ' retry the PRISM Check
Kill "C:\NTC32\DMVPRISMClient\Error.txt" ' indicates a DOT / PRISM problem ... opting to Retry
Shell ("C:\NTC32\DMVPRISMClient\PRISMClient.exe " + ScnLine + " /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + _
" /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + sMCRFS)
Goto LoopLabel
end if
end if
Error_Checker = 1
FileRead "C:\NTC32\DMVPRISMClient\Fail.txt", sPRISMClientFailMsg, 0 ' essentially
, remove the phone number from DOT
return message.
Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied TIN has" , 1)
if Error_Checker > 0 Then
sDotMsgL1 = "The supplied TIN has no USDOT# associated with it."
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied TIN is", 1)
if Error_Checker > 0 Then
sDotMsgL1 = "The supplied TIN is associated with a different USDOT#."
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "The person", 1)
if Error_Checker > 0 Then
sDotMsgL1 = "The person or company registering this vehicle is required to maintain a current MCS-150. Records indicate that your MCS-150 has not been updated within the past year."
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied USDOT" , 1)
if Error_Checker > 0 Then
sDotMsgL1 = "The supplied USDOT# is not associated with a carrier or a shipper."
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "Records indicate that the motor carrier associated with USDOT#", 1) '2E
if Error_Checker > 0 Then
sDotMsgL1 = "Records indicate that the motor carrier associated with this USDOT# is under a Federal Out of Service Order. This safety status precludes registration of this vehicle."
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "Records indicate that the motor carrier (USDOT#" , 1) ' 2F
if Error_Checker > 0 Then
sDotMsgL1 = "Records indicate that the motor carrier associated with this USDOT# for this vehicle identification number is under a Federal Out of Service Order. This safety status precludes registration of this vehicle."
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "The USDOT#", 1)
if Error_Checker > 0 Then
sDotMsgL1 = "The USDOT# presented by the registrant is inactive. The USDOT# must be active."
end if
If NM_ResultCode <> 3 Then ' Fail.txt has been found .... PRISM check has failed. Print letter and option to retry in order to proceed.
If (sPRISMClientFailMsg = "PROGRAM ERROR - Vehicle VIN is missing." Or _
sPRISMClientFailMsg = "PROGRAM ERROR - Registration Expiration Date must be format YYYYMM." Or _
sPRISMClientFailMsg = "PROGRAM ERROR - Registration Expiration Date cannot before today." Or _
sPRISMClientFailMsg = "PROGRAM ERROR - License Plate Number is missing." Or _
sPRISMClientFailMsg = "PROGRAM ERROR - Vehicle Make is missing." Or _
sPRISMClientFailMsg = "PROGRAM ERROR - Vehicle Model Year must be format YY." Or _
sPRISMClientFailMsg = "PROGRAM ERROR - Vehicle Type (Class Code) is missing.") Then
MsgBox Chr(13) & Chr(10) & "Vehicle Failed DOT PRISM Check." & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "DOT Responded with the message: " & Chr(13) & Chr(10) & sPRISMClientFailMsg, 0, "DOT PRISM Check"
Stop
end if
ret = MsgBox("DOT Responded with: " & Chr(13) & Chr(10) & Chr(13) & Chr(10) & sDotMsgL1 & Chr(13) & Chr(10) & Chr(13) & Chr(10) & "Do you want to retry PRISM check ?",4,"VEHICLE FAILED DOT PRISM CHECK")
if ret <> 6 then
' not opting to retry .... print letter and Stop
MsgBox "Remove the Vehicle Registration from the tray. An explanatory letter will be printed for your customer.",0,"DOT PRISM Check"
FileWrite "C:\NTC32\screen.trc", Space(80)
Open "C:\NTC32\screen.trc" For Append As #1
Print #1, Space(80) ' Padding at front of file for it to print correctly.
Print #1, Space(80)
Print #1, Space(80)
Print #1, Space(80)
Print #1, Space(80)
Print #1, Space(80)
Print #1, Space(80)
Print #1, Space(80)
Print #1, Space(80)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(80)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(81)
Print #1, Space(80)
Print #1, "INFO11 24 19558686"
Print #1, " "
x1 = len(sFullName) ' Find the len of full name
if x1 < 50 then
sFullName = sFullName + space(50-x1) ' Makes it a fixed 50 chars
end if
Print #1, sFullName ' Appends the full name of registrant
' Extract sResAdd sResCity sResState sResZip and sPlate from ScnLine
lastpostemp = ScnLine
firstpos = Instr(1,lastpostemp,"/vin:")
lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 4)))
firstpos = Instr(1,lastpostemp,"/plate:")
sVIN = left$(lastpostemp,firstpos - 2)
lastpostemp = ScnLine
firstpos = Instr(1,lastpostemp,"/plate:")
lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 6)))
firstpos = Instr(1,lastpostemp,"/make:")
sPlate = left$(lastpostemp,firstpos - 2)
firstpos = Instr(1,lastpostemp,"/street:")
lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 8)))
firstpos = Instr(1,lastpostemp,"/city:")
sResAdd = left$(lastpostemp,firstpos - 3)
firstpos = Instr(1,lastpostemp,"/city:")
lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 6)))
firstpos = Instr(1,lastpostemp,"/state:")
sResCity = left$(lastpostemp,firstpos - 3)
firstpos = Instr(1,lastpostemp,"/state:")
lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 7)))
firstpos = Instr(1,lastpostemp,"/zipcode:")
sResState = left$(lastpostemp,firstpos - 3)
firstpos = Instr(1,lastpostemp,"/zipcode:")
sResZip = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 8)))
x1 = len(sResAdd) ' Find the len of res addr
if x1 < 50 then
sResAdd = sResAdd + space(50-x1) ' Makes it a fixed 50 chars
end if
Print #1, sResAdd ' Appends the full name of registrant
sResCityStateZip = sResCity + " " + sResState + " " + sResZip ' Concat and make into a var
x1 = len(sResCityStateZip) ' Find the len of city,state,zip of res addr
if x1 < 50 then
sResCityStateZip = sResCityStateZip + space(50-x1) ' Makes it a fixed 50 chars
end if
Print #1, sResCityStateZip ' Appends the full name of registrant
x1 = len(sPlate) ' Find the len of vehicle plate
if x1 < 6 then
sPlate = sPlate + space(6-x1) ' Makes it a fixed 6 chars
end if
Print #1, sPlate ' Appends the full name of registrant
' Reads the fail message and appends each line to have a fixed 755 chars to the screen.trc file
' Each fail message includes 2A, 2B, 2C, 2D, 2E, 2F, 2G which will be printed on the SOA letter
Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied TIN has" , 1)
if Error_Checker > 0 Then
sDotMsgId = "2A"
sDotMsgL1 = "The supplied TIN has no USDOT# associated with it. (" + CStr(Date()) + ")"
sDotMsgL2 = Space(75)
sDotMsgL3 = Space(75)
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied TIN is", 1)
if Error_Checker > 0 Then
sDotMsgId = "2B"
sDotMsgL1 = "The supplied TIN is associated with a different USDOT#. (" + CStr(Date()) + ")"
sDotMsgL2 = Space(75)
sDotMsgL3 = Space(75)
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "The person", 1)
if Error_Checker > 0 Then
sDotMsgId = "2C"
sDotMsgL1 = "The person or company registering this vehicle is required to maintain"
sDotMsgL2 = "a current MCS-150. Records indicate that your MCS-150 has not been"
sDotMsgL3 = "updated within the past year. (" + CStr(Date()) + ")"
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied USDOT" , 1)
if Error_Checker > 0 Then
sDotMsgId = "2D"
sDotMsgL1 = "The supplied USDOT# is not associated with a carrier or a shipper."
sDotMsgL2 = "(" + CStr(Date()) + ")"
sDotMsgL3 = Space(75)
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "Records indicate that the motor carrier associated with USDOT#" , 1)
if Error_Checker > 0 Then
sDotMsgId = "2E"
sDotMsgL1 = "Records indicate that the motor carrier associated with this USDOT#"
sDotMsgL2 = "is under a Federal Out of Service Order. This safety status precludes"
sDotMsgL3 = "registration of this vehicle. (" + CStr(Date()) + ")"
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "Records indicate that the motor carrier (USDOT#", 1)
if Error_Checker > 0 Then
sDotMsgId = "2F"
sDotMsgL1 = "Records indicate that the motor carrier associated with this USDOT# for"
sDotMsgL2 = "this vehicle identification number is under a Federal Out of Service Order."
sDotMsgL3 = "This safety status precludes registration of this vehicle. (" + CStr(Date()) + ")"
end if
Error_Checker = Instr (1, sPRISMClientFailMsg, "The USDOT#", 1)
if Error_Checker > 0 Then
sDotMsgId = "2G"
sDotMsgL1 = "The USDOT# presented by the registrant is inactive. The USDOT# must be"
sDotMsgL2 = "active. (" + CStr(Date()) + ")"
sDotMsgL3 = Space(75)
end if
x1 = len(sDotMsgL1) ' Find the len of line 1
if x1 < 75 then
sDotMsgL1 = sDotMsgL1 + space(75-x1) ' Makes it a fixed 75 chars
end if
x1 = len(sDotMsgL2) ' Find the len of line 2
if x1 < 75 then
sDotMsgL2 = sDotMsgL2 + space(75-x1) ' Makes it a fixed 75 chars
end if
x1 = len(sDotMsgL3) ' Find the len of line 3
if x1 < 75 then
sDotMsgL3 = sDotMsgL3 + space(75-x1) ' Makes it a fixed 75 chars
end if
Print #1, sDotMsgId ' Appends each line to the trace file
Print #1, sDotMsgL1
Print #1, sDotMsgL2
Print #1, sDotMsgL3
x1 = len(sVIN)
if x1 < 17 then
sVIN = sVIN + space(17-x1)
end if
Print #1, sVIN
Close #1
Shell ("C:\DMVPrintEngine\dmvprint.exe /1:PrismFail") ' Print the thing
Stop
else ' re-trying the PRISM check ..... PRISMPrompt first, then run PRISMClient, loop back
Kill "C:\NTC32\DMVPRISMClient\CarrierID.txt"
Kill "C:\NTC32\DMVPRISMClient\TaxID.txt"
Kill "C:\NTC32\DMVPRISMClient\AxelCount.txt"
Shell ("C:\NTC32\DMVPRISMClient\PRISMPrompt.exe") ' Run PRISMPrompt.exe, which will prompt user for CarrierID (DOT #) and TaxID (TIN)
Do
FileRead "C:\NTC32\DMVPRISMClient\CarrierID.txt", sCarrierID, 0
If NM_ResultCode <> 3 Then
FileRead "C:\NTC32\DMVPRISMClient\TaxID.txt", sTaxID, 0
If NM_ResultCode <> 3 Then
FileRead "C:\NTC32\DMVPRISMClient\AxelCount.txt", sAxelCount, 0
If NM_ResultCode <> 3 Then
Exit Do ' All 3 files were found, so the user has hit OK at the prompt
End If
End If
End If
FileRead "C:\NTC32\DMVPRISMClient\PRISMPromptCancel.txt", sCancel, 0
If NM_ResultCode <> 3 Then
Stop
End If
Loop
Kill "C:\NTC32\DMVPRISMClient\Success.txt" ' indicates passing PRISM check
Kill "C:\NTC32\DMVPRISMClient\Fail.txt" ' indicates failure of PRISM check ... print letter and stop
Kill "C:\NTC32\DMVPRISMClient\Error.txt" ' indicates a DOT / PRISM problem .... continue registration using DMV barcode
Shell ("C:\NTC32\DMVPRISMClient\PRISMClient.exe " + ScnLine + " /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + _
" /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle )
end if
end If
Loop
EMSendKeyFast "<ENTER>" ' Send the enter key
Exit Sub
end if
Select Case foundit
Case -1 'No screen to process so pass Enter keystroke on and quit
EMSendKeyFast "<ENTER>"
stop
Exit Sub
' ***********************************************************
Case 0 ' Data(0) - Junk Titles - AVTU300P
' ***********************************************************
EMReadScreen sJunkStatus,1,20,3 ' Read Status and see if J
if sJunkStatus <> "J" then ' If not junked look at other spots for J then
EMReadScreen sJunkStatus,1,21,3 ' Read Status and see if J
if sJunkStatus <> "J" then ' If not junked look at other spots for J then
EMReadScreen sJunkStatus,1,22,3 ' Read Status and see if J
if sJunkStatus <> "J" then ' If not junked look at other spots for J then Stop
EMReadScreen sJunkStatus,1,23,3 ' Read Status and see if J
if sJunkStatus <> "J" then ' If not junked look at other spots for J then Stop
EMReadScreen sJunkStatus,1,23,3 ' Read Status and see if J
EMSendKeyFast "<ENTER>" ' Important to send the ENTER key regardless
stop
end if
end if
end if
end if
EMReadScreen sName,5,10,17
if sName = "PRESS" then 'There is an NMVTIS popup window onscreen ... send the ENTER key and exit
EMSendKeyFast "<ENTER>"
stop
end if
EMReadScreen sDate,8,3,59 ' Read the date
EMReadScreen sName,60,4,14 ' Read the Name
sName = Trim (sName) ' Strip trailing and leading spaces
EMReadScreen sVIN,20,5,33 ' VIN
sVIN = Trim(sVIN) ' Strip extra spaces away (leading and trailing)
sDocId = "JUNK-STATUS-DocType-40" ' Lead sheet title / description
' Contruct the cmdline with appropriate arguments for execution within windows, the name arg has to be last item by code
' design and the fact that .net arguments are delimted by spacebands thus the name is concated within the .net routine
CmdLine = "C:\IDRS\fldcoversheet\IDRSCoversheetFldWrk.exe "
CmdLine = CmdLine + "/print:true" + " " + "/date:" + sDate + " " + "/vin:" + sVIN + " " + "/title:" + sDocID + " " + "/name:" + sName
' MsgBox CmdLine
Shell ( CmdLine )
EMSendKeyFast "<ENTER>"
stop
Exit Sub
' ***********************************************************
Case 1 ' Data(1) - DL's New/Dup/Renew - GENIC
' ***********************************************************
'Start 001
cnt = 1
EMReadScreen ScrLine,80,cnt,1 'mlp/2/27/14 -for bar code print
FileWrite "C:\ntc32\screen.trc", ScnLine 'mlp/2/27/14 -for bar code print
'**JJM Get ISN and append to beggining of the file
DIM ISN as string
DIM TMPSTR as string
DIM sISN as string
ISN=""
EMReadScreen ScrLine,80,4,2
TMPSTR=ScrLine
ISN=Left$(TMPSTR,8)
ISN=PadString(ISN,80," ","right")
TMPSTR=" "
TMPSTR=PadString(TMPSTR,80," ","right")
FileAppend ISN
FileAppend TMPSTR
FileAppend ISN
'** 001
' Read the next 23 lines and append it to the existing file (totally 24 lines)
For cnt = 2 to 24
If cnt= 4 then
EMReadScreen ScrLine,80,cnt,9
TMPSTR=""
TMPSTR= Left$(ScrLine,50)
TMPSTR=PadString(TMPSTR,80," ","right")
' MsgBox TMPSTR
ScrLine=TMPSTR
FileAppend TMPSTR
else
EMReadScreen ScrLine,80,cnt,1
FileAppend ScrLine
end if
'msgbox ScrLine
Next cnt
'PLACEHOLDER
' mlp 3/25/14 - begin signature Pad capture
EMReadScreen sProgname,5,3,2
EMReadScreen sIsn,8,4,2
'if sProgname = "GENIC" and sISN = " " then
if sISN <> " " then
Dim DOB as string
Dim Sigflag as string
Dim Env as string
Dim sName1 as string
Dim sName2 as string
ChDir "c:\CIIV"
' ChDir "C:\Users\Public\Marquis ID Systems"
EMReadScreen sName1,23,9,12
EMReadScreen sName2,30,9,35
EMReadScreen mAddress1,60,13,12
EMReadScreen mAddress2,60,14,12
EMReadScreen DOB,10,19,12
EMReadScreen Sigflag,1,5,2
EMReadScreen Env,1,6,2
CmdLine = "C:\CIIV\AKDL_SIGCAPTURE.EXE " +Chr(34)+ISN+Chr(34) + " " +Chr(34)+sName1+Chr(34) + " " +Chr(34)+" "+Chr(34) + " "
CmdLine = CmdLine +Chr(34)+sName2+Chr(34) + " " + Chr(34)+mAddress1+Chr(34) + " " +Chr(34)+" "+Chr(34) + " " + Chr(34)+mAddress2+Chr(34) + " "
CmdLine = CmdLine + Chr(34)+" "+Chr(34) + " " + Chr(34)+" "+Chr(34) + " "
CmdLine = CmdLine +Chr(34)+DOB+Chr(34) + " " + Chr(34)+Sigflag+Chr(34) + " " + Chr(34)+"P"+Chr(34) 'add environment here mlp 3/25/14
'JJM 03/25/14 Do while till program returns true
Dim wsh As Object
Set wsh = CreateObject("WScript.Shell")
Dim waitOnReturn As Boolean: waitOnReturn = True
Dim windowStyle As Integer: windowStyle = 1
Dim intRetCode As Integer
intRetCode = 0
Do While intRetCode = 0
' MsgBox intRetCode
intRetCode =wsh.Run(CmdLine, windowStyle, waitOnReturn)
intRetCode = 1
' MsgBox intRetCode
Loop
'end JJM
'Shell ( CmdLine )
end if
thisType = ""
sAction = "APP" ' Make always an Application
EMReadScreen sDate,10,3,53 ' Read the date
EMReadScreen sName,60,9,12 ' Name
sName = Trim$(sName) ' Strip trailing and leading spaces
EMReadScreen sIDLic,7,20,2 ' ID or DL Number
EMReadScreen sType, 5,7,12 ' Type of ID/Lic
thisType = RTrim$(sType)
if len(thisType) > 2 then 'If 2 license classes, add a '_' character between them
xpos = Instr(1,sType," ")
sType1 = Left$(sType,xpos-1) + "_" + Right$(sType,len(SType)-xpos)
end if
sDocId = "DL/ID-APPLICATION-DocType-10" ' Lead sheet title / description
CmdLine = "C:\IDRS\fldcoversheet\IDRSCoversheetFldWrk.exe "
if len(SType1) > 2 then
CmdLine = CmdLine + "/dlid:" + sIDLic + " " + "/title:" + sDocID + " " + "/print:true" + " " + "/name:" + sName + " " + "/dltype:" + sType1
else
CmdLine = CmdLine + "/dlid:" + sIDLic + " " + "/title:" + sDocID + " " + "/print:true" + " " + "/name:" + sName + " " + "/dltype:" + thisType
end if
ret = MsgBox ("Print Receipt Yes to Print! (Click NO to Abort printing)",4,"DMV PRINT Receipt")
if ret = 6 then 'JJM 002
Shell ("C:\DMVPrintEngine\dmvprint.exe /1:IdLic") 'mlp/2/27/14 -for bar code print
end if
' This creates a message box when user is ready to print
ret = MsgBox ("Place DL Application in bypass tray and click Yes to Print! (Click NO to Abort printing)",4,"DMV PRINT CHECK POINT-DL Application")
if ret <> 6 then stop
Shell ( CmdLine ) ' Print barcode on application
' EMSendKeyFast "<ENTER>" ' Enters after the DL message box
CurPath = CurDir() ' Get current path.
' ChDir "c:\wei\bin"
' Shell ( "C:\wei\bin\AKMakeLic.exe" ) ' Coversheet printed - automatically call AKMakeLic.exe
ChDir CurPath ' Change back to user default.
EMSendKeyFast "<ENTER>" ' Enters after the DL message box
FileWrite "C:\NTC32\screen.trc", Space(80) '
stop
Exit Sub
' ***********************************************************
Case 2 ' Data(2) = "PVTM000P" Vehicle Menu - VIN Error exceeding 18 chars
' ***********************************************************
Dim sVinErrorMessage As String
FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' Initialization of PRISMCheck.txt Flag
Kill "C:\NTC32\DMVPRISMClient\CarrierID.txt"
Kill "C:\NTC32\DMVPRISMClient\TaxID.txt"
Kill "C:\NTC32\DMVPRISMClient\AxelCount.txt"
EMReadScreen ScnLine,21,18,16 ' Reads line 18 and grabs the VIN line
firstpos = InStr (16, ScnLine) ' gets the first pos
lastpos = InStr (16, ScnLine, "_" ) ' Looks for an underscore at the end
if lastpos = " " then ' or a space
lastpos = InStr (16, ScnLine, " " )
end if
lastpos = lastpos - 1 ' gets the
# which determines if it exceeds the VIN chars
if lastpos > 18 then
ret = MsgBox ("Warning: The VIN has exceeded 18 alphanumeric characters. Proceed?", 1, "ERROR-Vehicle Identification Number")
if ret <> 1 then stop
end if
EMSendKeyFast "<ENTER>"
Exit Sub
' ***********************************************************
Case 3 ' Data(3) - HC Permit
' ***********************************************************
EMReadScreen sDate,8,2,60 ' Read the date
EMReadScreen sName,60,5,17 ' Read the name
sName = LTrim (sName) ' Strip trailing and leading spaces
sName = RTrim (sName)
EMReadScreen sPermitKey,6,10,17 ' Read the name
sKey = Trim (sPermitKey) ' Strip trailing and leading spaces
EMReadScreen sIDLic,7,12,17 ' DL/ID
sDocId = "HANDICAP-PERMIT-DocType-30" ' Lead sheet title / description
' Contruct the cmdline with appropriate arguments for execution within windows, the name arg has to be last item by code
' design and the fact that .net arguments are delimted by spacebands thus the name is concated within the .net routine
CmdLine = "C:\IDRS\fldcoversheet\IDRSCoversheetFldWrk.exe "
CmdLine = CmdLine+"/date:"+sDate+" "+"/title:"+sDocID+" "+"/print:true"+" "+"/dlid:"+sIDLic +" "
CmdLine = CmdLine + "/key:"+sPermitKey +" "+"/name:"+sName
' MsgBox CmdLine
Shell ( CmdLine )
EMSendKeyFast "<ENTER>" 'Send a ENTER key and quit
stop
Exit Sub
' ***********************************************************
Case 4 ' Data(4) - Batch Open
' ***********************************************************
' When a batch is opened
for the first
time EMReadScreen LocNum,3,8,27 ' Reads the location number
EMReadScreen BatchDate, 10,10,27 ' Reads the batch date
EMSendKeyFast "<ENTER>" ' Waits to go to the next screen
EMWaitCursor 3,4,15
EMReadScreen BatchNum,4,1,13 'Then captures the batch number
if IsNumeric(BatchNum) Then ' If numeric write it else fix and then write
BatchInfo = LocNum + " " + BatchDate + BatchNum ' Concatenates it together as that var
else
BatchInfo = LocNum + " " + BatchDate + "8686"
end if
FileWrite "C:\NTC32\batchnum.txt", BatchInfo ' Writes to the file
Stop
Exit Sub
' ***********************************************************
Case 5 ' Data(5) - Change Batch Status
' ***********************************************************
' The following code saves the batchnum.txt file when a batch is opened/reopened or inactivated.
' The reason behind this is when the user switches stations, the file is saved on the computer and not by the user profile
' This screen is different from opening a batch for the first time as shown in Case 4
EMReadScreen Status, 1,12,26 ' Reads the status
if Status = "O" Or Status = "I" then ' If the status is open or inactivated
EMReadScreen LocNum,3,11,26 ' Reads the location number
EMReadScreen BatchDate, 10,10,26 ' Reads the batch date
EMReadScreen BatchNum,4,9,26 ' Reads the batch number
BatchInfo = LocNum + " " + BatchDate + BatchNum ' Concatenates it together as that var
FileWrite "C:\NTC32\batchnum.txt", BatchInfo ' Writes to the file
EMSendKeyFast "<ENTER>"
else
EMSendKeyFast "<ENTER>"
end if
Exit Sub
' Cases 6, 7, 8, 9, 10, 11, 12, 13 trapped by if statement for PRISM processing.
' Case 14 Vehicle Title screen ... trapped by earlier if statement for PRISM Check.
' ***********************************************************
Case 15 ' Data(15) = "ATPM000P" Temp Permit Menu-VIN Error exceeding 18 chars
FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' Initialization of PRISMCheck.txt Flag
Kill "C:\NTC32\DMVPRISMClient\CarrierID.txt"
Kill "C:\NTC32\DMVPRISMClient\TaxID.txt"
Kill "C:\NTC32\DMVPRISMClient\AxelCount.txt"
EMReadScreen ScnLine,21,19,16 ' Reads line 18 and grabs the VIN line
firstpos = InStr (16, ScnLine) ' gets the first pos
lastpos = InStr (16, ScnLine, "_" ) ' Looks for an underscore at the end
if lastpos = " " then ' or a space
lastpos = InStr (16, ScnLine, " " )
end if
lastpos = lastpos - 1 ' gets the
# which determines if it exceeds the VIN chars
if lastpos > 18 then
ret = MsgBox ("Warning: The VIN has exceeded 18 alphanumeric characters. Proceed?", 1, "ERROR-Vehicle Identification Number")
if ret <> 1 then stop
end if
EMSendKeyFast "<ENTER>"
Exit Sub
' Case 16 Vehicle Title screen (Temp Permits) ... trapped by earlier if statement for PRISM Check.
' Cases 17, 18 trapped by if statement for PRISM processing.
Case 19 ' Data(19) = "PMSP100P", jia 2/17/2009
EMReadScreen ScrLine,33,19,8
if (InStr(1,ScrLine,"INCOMING DIGTAL IMAGE RECORD")) then
EMReadScreen ScrLine,80,17,3
dim OLN as string
firstpos = InStr(1,ScrLine,"OLN/") + 4
lastpos = InStr(1,ScrLine,".OLS/")
OLN = Mid$(ScrLine,firstpos,(lastpos-firstpos)) 'third parameter of Mid function is the length
dim OLS as string
xpos = InStr(1,ScrLine,"OLS/") +4
OLS = Mid$(ScrLine,xpos,2)
CmdLine = "C:\Program Files\State of Alaska\SurrenderedLicense\SurrenderedLicense.exe"
CmdLine = CmdLine + " " + OLN + " " + OLS
Shell (CmdLine)
end if
EMSendKeyFast "<ENTER>"
Exit Sub
' *******************************************************************************
Case 20 ' Data(20) - Medical Certificate Cover Sheet - PXXM011N
' *******************************************************************************
EMReadScreen sAction,4,10,37 'check for TYPE at 10,37
if sAction <> "TYPE" then
EMSendKeyFast "<ENTER>"
Exit Sub
else
sAction = "APP" ' Make always an Application
end if
EMReadScreen sAction,1,10,43 'check for Driver Self Cert Type ? at 10,43
if sAction = "?" or sAction = "_" then 'i1
EMSendKeyFast "<ENTER>"
Exit Sub
else 'e1
if sAction = "N" then 'i2
EMReadScreen sAction,1,11,43 'check for Medical Specialty ? at 11,43