fork(1) download
  1. Sub Main
  2. ' This is DMV's steal the ENTER key script (sometimes the F10 key) and do some behind the scenes processing
  3. ' This script only does ENTER key processing. A copy and different variation of this code is saved as F10.vba for PF10 processing
  4. ' The ENTER keys must be mapped to this script (enter.vba) and the users must use the keyboard.KBD
  5. ' located in the folder c:\ntc32 as are the scripts (*.vba)
  6. '
  7. ' All of DMV screens provide a program or screen ID on line 2 column 2 up to 9 chars (maybe 8)
  8. ' The main purpose thus far is to identify which screens require a Lead / Cover sheet for scanning
  9. ' field / office work documents ...
  10. '
  11. ' The story is that every time the users presses ENTER that this script is executed. The script looks at the
  12. ' 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
  13. ' the data and saving it into local string vars to be passed to the windows application specified in the shell
  14. ' or winexec command within this script. The app name is currently named IDRSCoversheetFldWrk.exe.
  15. ' The end result is a piece of paper with some info and bar codes in 128 format printed on it to allow searching
  16. ' for the documents that are scanned behind it when they are processed in FISCAL scanning section
  17. 'Modifications
  18. '=======Date========VER=======Programmer==============Notes
  19. ' 02/28/14 001 MLP,JJM Adding barcode and new template for central issuance receipt, bar code place at the top
  20. ' 03/25/14 MLP Added new CIIV signature pad call
  21. ' 05/19/14 MLP Changed sig pad from "T" to "P" environment
  22. ' 12/11/14 002 JJM Added option to print receipt or not to print
  23. Dim ScrLine As String
  24. Dim NextScr As String
  25. Dim retmsg As Variant
  26. Dim Data(21) As String
  27. Dim MaxElements as Integer
  28. Dim pos As Integer
  29. Dim foundit As Integer
  30. Dim ret as Integer
  31. Dim CmdLine As String
  32. Dim FeeCheck As String
  33. Dim xpos As Integer
  34. Dim firstpos As Integer
  35. Dim lastpos As Integer
  36. Dim endpos as Integer
  37. dim prismflag as string
  38.  
  39. ' Vars to collect the screen data into
  40. Dim sName As String
  41. Dim sIDLic As String
  42. dim sVIN As string
  43. dim sVIN1 as string
  44. Dim sPermitKey As String
  45. Dim sDate As String
  46. Dim sAction As String
  47. Dim sBatch As String
  48. Dim sType As String
  49. Dim sType1 As String
  50. Dim thisType As String
  51. Dim sLoc As String
  52. Dim sDocId As String
  53. Dim sJunkStatus As String
  54. Dim sResAdd as String
  55. Dim sResCity as String
  56. dim sResCity1 as string
  57. Dim sResState as String
  58. dim sResState1 as string
  59. Dim sResZip as String
  60. dim sResZip1 as string
  61. Dim sPlate as String
  62. dim sPlate1 as string
  63. dim sModelYear as string
  64. Dim sMake as String
  65. dim sMake1 as String
  66. dim sModel as string
  67. dim sModel1 as string
  68. Dim sYear as String
  69. Dim sStyle as String
  70. Dim sUnit as String
  71. dim sUnit1 as string
  72. Dim sGrossVehWeight as String
  73. dim sGrossVehWeight1 as string
  74. Dim sRegExpYear as String
  75. Dim sRegExpMonth as String
  76. Dim sRegExpPrismFormat as String
  77. dim sCarrierID as string
  78. dim sTaxID as string
  79. dim sAxelCount as string
  80. dim sMCRFS as string
  81.  
  82. Dim Status As String
  83. Dim BatchNum As String
  84. Dim ScrName As String
  85. Dim LocNum As String
  86. Dim BatchDate As String
  87. Dim BatchInfo As String
  88. Dim s as String
  89. Dim found as integer
  90. Dim rCity as String
  91. dim rCity1 as string
  92. Dim rAddress1 as String
  93. Dim rAddress11 as string
  94. Dim rAddress2 as String
  95. Dim rAddress21 as string
  96. Dim mAddress1 as String
  97. dim mAddress11 as string
  98. Dim mAddress2 as String
  99. Dim mAddress21 as string
  100. Dim Country as String
  101. dim Country1 as string
  102.  
  103. ' Vars collected for barcode
  104. Dim FName As String
  105. Dim MName As String
  106. Dim LName As String
  107. Dim SuffName As String
  108. Dim CName As String
  109. dim sFullName as string
  110. Dim x, x1 As String
  111. Dim User As String
  112. Dim L5 As String
  113. Dim ScnLine As String
  114. Dim CNameTemp As String
  115. Dim lastpostemp As String
  116.  
  117. ' Var collected for PRISM check
  118. Dim sRegVehTitle As String
  119.  
  120. ' Var(s) collected for HVUT check
  121. Dim sHVUT As String
  122. Dim sPrismClassCode As String
  123. Dim sPerformPrismCheck As String
  124. Dim sProgname as String
  125.  
  126.  
  127. 'Array of screen types / values
  128. Data(0) = "AVTU300P" ' Junk Title Screen
  129. Data(1) = "GENIC " ' The DL screen for New/Renewal/Duplicate
  130. Data(2) = "PVTM000P" ' Vehicle Menu - VIN Error exceeding 18 chars
  131. Data(3) = "PMVU152P" ' Handicap permit also uses f10.vba
  132. Data(4) = "PMVU100P" ' Operator Batch Status
  133. Data(5) = "PMVU110P" ' Change Batch Status
  134. Data(6) = "AVTU200P" ' Funct 1 Title&Reg
  135. Data(7) = "AVTU205P" ' Funct 1 Title&Reg
  136. Data(8) = "ATPU200P" ' Temp Permit Function 1 existing vehicle Title & Registration
  137. Data(9) = "ATPU210P" ' Temp Funct 5 Title&Reg
  138. Data(10) = "AVTU220P" ' Funct 4 NTI .. no title issued
  139. Data(11) = "AVTU225P" ' Funct 4 NTI .. no title issued
  140. Data(12) = "AVTU230P" ' Funct 5 Duplicate Registration
  141. Data(13) = "AVTU235P" ' Funct 6 Renewal
  142. Data(14) = "AVTU270P" ' Vehicle Title Information - scrape owner/company name and PRISM check
  143. Data(15) = "ATPM000P" ' Temp Permit Menu-VIN Error exceeding 18 chars
  144. Data(16) = "ATPU270P" ' Vehicle Title Information / Temp Permit - scrape owner/company name and PRISM check
  145. Data(17) = "ATPU205P" ' Temp Funct 1 & 4 Title&Reg
  146. Data(18) = "ATPU230P" ' Temp Funct 4 Title&Reg
  147. Data(19) = "PMSP100P" ' View ALVIN Msg / Incoming Digital Image Record (jia 2/17/2010)
  148. Data(20) = "PXXM011N" ' Medical Certificate Cover Sheet
  149. Data(21) = "empty" ' empty
  150.  
  151. ' Set the maximum number of screen possibilities
  152. ' Bump this up as additional screens are added
  153. MaxElements = 20 'pb 11/25/2011
  154. foundit = -1
  155.  
  156.  
  157. 'Read line 3 col 2 and snag 8 chars might be the Screen Id
  158. EMReadScreen ScrLine,8,3,2
  159. '
  160. ' Check to see if we detected a screen that needs processing
  161. '
  162. for pos = 0 to MaxElements ' Set loop for max elements for speed
  163. if ScrLine = Data(pos) then ' See if a match is made
  164. foundit = pos ' Set the var to the value needed in the select case below
  165. pos = MaxElements ' Set the loop control var to max as to exit the loop so as not to continue looking
  166. end if
  167. next pos
  168.  
  169. if foundit = -1 then ' Check we have detected a screen that needs scraping yet
  170. 'Read line 3 col 3 and snag 8 chars might be the Screen Id
  171. EMReadScreen ScrLine,8,3,3
  172. '
  173. ' Check to see if we detected a screen that needs processing
  174. '
  175. for pos = 0 to MaxElements ' Set loop for max elements for speed
  176. if ScrLine = Data(pos) then ' See if a match is made
  177. foundit = pos ' Set the var to the value needed in the select case below
  178. pos = MaxElements ' Set the loop control var to max as to exit the loop so as not to continue looking
  179. end if
  180. next pos
  181. end if
  182.  
  183. if foundit = -1 then
  184.  
  185. 'Read line 2 col 3 and snag 8 chars might be the Screen Id
  186. EMReadScreen ScrLine,8,2,3
  187. '
  188. ' Again check to see if we detected a screen that needs processing
  189. ' for some screen id's are on line 2 and others on line 3
  190. '
  191. for pos = 0 to MaxElements ' Set loop for max elements for speed
  192. if ScrLine = Data(pos) then ' See if a match is made
  193. foundit = pos ' Set the var to the value needed in the select case below
  194. pos = MaxElements ' Set the loop control var to max as to exit the loop so as not to continue looking
  195. end if
  196. next pos
  197. end if
  198.  
  199. if foundit = -1 then ' Check we have detected a screen that needs scraping yet
  200.  
  201. 'Read line 2 col 2 and snag 8 chars might be the Screen Id
  202. EMReadScreen ScrLine,8,2,2
  203. '
  204. ' Again check to see if we detected a screen that needs processing
  205. ' for some screen id's are on line 2 and others on line 3
  206. '
  207. for pos = 0 to MaxElements ' Set loop for max elements for speed
  208. if ScrLine = Data(pos) then ' See if a match is made
  209. foundit = pos ' Set the var to the value needed in the select case below
  210. pos = MaxElements ' Set the loop control var to max as to exit the loop so as not to continue looking
  211. end if
  212. next pos
  213. end if
  214.  
  215.  
  216.  
  217. 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
  218. ' We have detected a screen that will potentially require a PRISM Check
  219.  
  220. FileRead "C:\NTC32\DMVPRISMClient\PRISMCheck.txt",prismflag,0
  221. if NM_ResultCode = 3 then
  222. FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' file wasn't found .... first time processing this screen
  223. end if
  224.  
  225. if foundit = 6 or foundit = 7 then
  226. EMReadScreen sPrismClassCode,2,7,32 ' Read the classcode
  227. else
  228. EMReadScreen sPrismClassCode,2,7,33
  229. end if
  230. if foundit = 8 or foundit = 9 then
  231. EMReadScreen ScrLine,1,7,31 ' checking for the : in CLASS: onscreen
  232. if ScrLine <> ":" then
  233. EMReadScreen sPrismClassCode,2,7,32
  234. end if
  235. end if
  236.  
  237. if foundit = 6 or foundit = 7 then
  238. EMReadScreen sHVUT,1,8,46 ' Read the HVUT flag (Y or N)
  239. else
  240. EMReadScreen sHVUT,1,8,47
  241. end if
  242.  
  243. if foundit = 8 then
  244. EMReadScreen ScrLine,1,8,45 ' checking for the : in HV TAX: onscreen
  245. if ScrLine <> ":" then
  246. EMReadScreen sHVUT,1,8,46
  247. end if
  248. end if
  249.  
  250. if foundit = 9 then
  251. EMReadScreen ScrLine,1,8,45 ' checking for the : in HV Tax: onscreen
  252. if ScrLine <> ":" then
  253. EMReadScreen sHVUT,1,9,62 ' new screen position due to NMVTIS - screen map ATPM2101 on screen ATPU210P
  254. end if
  255. end if
  256.  
  257. FileRead "C:\NTC32\DMVPRISMClient\PRISMCheck.txt",prismflag,0
  258. if prismflag = "Y" then 'indicates that screen has been processed earlier ... no need to process this screen again
  259. sPerformPrismCheck = "N"
  260. else
  261. If (sPrismClassCode = "92" Or sPrismClassCode = "93" Or sPrismClassCode = "94") Or _
  262. ((sPrismClassCode = "42" Or sPrismClassCode = "52" Or _
  263. sPrismClassCode = "43" Or sPrismClassCode = "44" Or sPrismClassCode = "5P" Or sPrismClassCode = "4P" Or _
  264. sPrismClassCode = "53" Or sPrismClassCode = "54" Or sPrismClassCode = "55") And sHVUT = "Y") Then ' A PRISM Check is required ....
  265. sPerformPrismCheck = "Y"
  266. else
  267. FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' PRISM Check is not applicable for this Vehicle.
  268. sPerformPrismCheck = "N"
  269. end if
  270. end if
  271.  
  272. If sPerformPrismCheck = "Y" Then ' A PRISM Check is required ....
  273.  
  274. FileRead "C:\NTC32\DMVPRISMClient\PRISMCheck.txt",prismflag,0
  275. if prismflag = "N" then ' first time processing this screen
  276. FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "Y" ' flag that we have processed this screen
  277. end if
  278.  
  279. if foundit = 6 or foundit = 7 then
  280. EMReadScreen sVIN,20,4,32 ' Read the VIN (SERIAL: onscreen)
  281. else
  282. EMReadScreen sVIN,20,4,33
  283. end if
  284. if foundit = 8 or foundit = 9 then
  285. EMReadScreen ScrLine,1,4,31 ' checking for the : in SERIAL: onscreen
  286. if ScrLine <> ":" then
  287. EMReadScreen sVIN,20,4,32
  288. end if
  289. end if
  290. xpos = instr(1,sVIN,"_")
  291. sVIN1 = left(sVIN,(xpos-1))
  292. sVIN1 = RTrim(sVIN)
  293.  
  294. EMReadScreen sPlate,6,4,15
  295. xpos = instr(1,sPlate,"_")
  296. sPlate1 = left(sPlate,(xpos-1))
  297. if len(sPlate1) < 6 or sPlate1 = " " then
  298. sPlate1 = "NA1234"
  299. end if
  300.  
  301. if foundit = 6 or foundit = 7 then
  302. EMReadScreen sMake,4,6,32 ' Read the MAKE
  303. else
  304. EMReadScreen sMake,4,6,33
  305. end if
  306. if foundit = 8 or foundit = 9 then
  307. EMReadScreen ScrLine,1,6,31 ' checking for the : in MAKE: onscreen
  308. if ScrLine <> ":" then
  309. EMReadScreen sMake,4,6,32
  310. end if
  311. end if
  312. xpos = instr(1,sMake,"_")
  313. sMake1 = left(sMake,(xpos-1))
  314.  
  315. if foundit = 6 or foundit = 7 then
  316. EMReadScreen sModel,3,6,46 ' Read the MODEL
  317. else
  318. EMReadScreen sModel,3,6,47
  319. end if
  320. if foundit = 8 or foundit = 9 then
  321. EMReadScreen ScrLine,1,6,45 ' checking for the : in MODEL: onscreen
  322. if ScrLine <> ":" then
  323. EMReadScreen sModel,4,6,46
  324. end if
  325. end if
  326. xpos = instr(1,sModel,"_")
  327. sModel1 = left(sModel,(xpos-1))
  328.  
  329. EMReadScreen sModelyear,4,6,15
  330.  
  331. EMReadScreen sStyle,2,6,69
  332.  
  333.  
  334. if foundit = 6 or foundit = 7 or foundit = 10 or foundit = 11 or foundit = 13 then
  335. EMReadScreen sUnit,7,17,73 ' Read the UNIT NO:
  336. else
  337. EMReadScreen sUnit,7,17,71
  338. end if
  339. if foundit = 12 or foundit = 18 then
  340. EMReadScreen sUnit,7,17,68
  341. end if
  342. xpos = instr(1,sUnit,"_")
  343. sUnit1 = left(sUnit,(xpos-1))
  344. ' sUnit = Trim(sUnit)
  345. SUnit1 = sUnit1.Replace(" ", "")
  346.  
  347.  
  348.  
  349. if foundit = 6 or foundit = 7 then
  350. EMReadScreen sGrossVehWeight,5,7,46 ' Read the Weight
  351. else
  352. EMReadScreen sGrossVehWeight,5,7,47
  353. end if
  354. if foundit = 8 or foundit = 9 then
  355. EMReadScreen ScrLine,1,7,45 ' checking for the : in UNLDN WGT: onscreen
  356. if ScrLine <> ":" then
  357. EMReadScreen sGrossVehWeight,5,7,46
  358. end if
  359. end if
  360. xpos = instr(1,sGrossVehWeight,"_")
  361. sGrossVehWeight1 = left(sGrossVehWeight,(xpos-1))
  362.  
  363. EMReadScreen sRegExpYear,4,9,31
  364.  
  365. EMReadScreen sRegExpMonth,2,9,15
  366. sRegExpPrismFormat = sRegExpYear + sRegExpMonth
  367. sYear = Right$(sModelYear,2)
  368.  
  369. if foundit = 7 or foundit = 11 or foundit = 17 then
  370. EMReadScreen rAddress1,25,15,18
  371. else
  372. EMReadScreen rAddress1,25,14,18
  373. end if
  374.  
  375. xpos = instr(1,rAddress1,"_")
  376. rAddress11 = left(rAddress1,(xpos-1))
  377.  
  378. if foundit = 7 or foundit = 11 or foundit = 17 then
  379. EMReadScreen rCity,20,15,44
  380. else
  381. EMReadScreen rCity,20,14,44
  382. end if
  383.  
  384. xpos = instr(1,rCity,"_")
  385. rCity1 = left(rCity,(xpos-1))
  386. if rCity1 = "" then
  387. if rAddress11 = "" then ' stop .... ALVIN will validate and object to this.
  388. FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N"
  389. stop
  390. else
  391. if left$(rAddress1,4) = "SAME" then ' use the Mailing Address, City, State, Zip
  392.  
  393. if foundit = 7 or foundit = 11 or foundit = 17 then
  394. EMReadScreen mAddress1,25,13,18
  395. else
  396. EMReadScreen mAddress1,25,12,18
  397. end if
  398.  
  399. xpos = instr(1,mAddress1,"_")
  400. mAddress11 = left(mAddress1,(xpos-1))
  401.  
  402. if foundit = 7 or foundit = 11 or foundit = 17 then
  403. EMReadScreen mAddress2,25,14,18
  404. else
  405. EMReadScreen mAddress2,25,13,18
  406. end if
  407.  
  408. xpos = instr(1,mAddress2,"_")
  409. mAddress21 = left(mAddress2,(xpos-1))
  410. if len(mAddress21) > 0 then
  411. sResAdd = mAddress11 + " " + mAddress21 ' Residence address and Mailing address are the same.
  412. else
  413. sResAdd = mAddress11
  414. end if
  415.  
  416. if foundit = 7 or foundit = 11 or foundit = 17 then
  417. EMReadScreen sResCity,20,13,44
  418. else
  419. EMReadScreen sResCity,20,12,44 ' .... the Mailing Address City onscreen
  420. end if
  421.  
  422. xpos = instr(1,sReSCity,"_")
  423. sResCity1 = left(sResCity,(xpos-1))
  424.  
  425. if foundit = 7 or foundit = 11 or foundit = 17 then
  426. EMReadScreen sResState,2,13,65
  427. else
  428. EMReadScreen sResState,2,12,65 ' .... the Mailing Address State onscreen
  429. end if
  430.  
  431. xpos = instr(1,sResState,"_")
  432. sResState1 = left(sResState,(xpos-1))
  433.  
  434. if foundit = 7 or foundit = 11 or foundit = 17 then
  435. EMReadScreen sResZip,9,13,68
  436. else
  437. EMReadScreen sResZip,9,12,68 ' .... the Mailing Address Zipcode onscreen
  438. end if
  439.  
  440. xpos = instr(1,sResZip,"_")
  441. sResZip1 = left(sResZip,(xpos-1))
  442.  
  443. if foundit = 7 or foundit = 11 or foundit = 17 then
  444. EMReadScreen Country,15,14,44
  445. else
  446. EMReadScreen Country,15,13,44 ' .... the Mailing Address Country onscreen
  447. end if
  448.  
  449. xpos = instr(1,Country,"_")
  450. Country1 = left(Country,(xpos-1))
  451. if len(Country1) > 0 then
  452. sResState1 = sResState1 + Country1
  453. end if
  454. if sResCity1 = "" then
  455. if sResZip1 = "" then
  456. FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N"
  457. stop ' stop .... ALVIN will validate and object to this.
  458. else
  459. open "C:\ntc32\zipcodes.txt" for INPUT as #1 ' Zip Code Look-up
  460. found = 0
  461. Do While not EOF(1) and found = 0
  462. Line Input #1, s
  463. if left(s,5) = left(sResZip1,5) then
  464. found = 1
  465. sResCity1 = right(s,len(s)-6)
  466. sResState1 = "AK"
  467. end if
  468. Loop
  469. close #1
  470. end if
  471. end if
  472. end if
  473. end if
  474. else ' Residence City is not empty - we have a Residence Address onscreen
  475.  
  476. if foundit = 7 or foundit = 11 or foundit = 17 then
  477. EMReadScreen rAddress2,25,16,18
  478. else
  479. EMReadScreen rAddress2,25,15,18 ' Residence Address extra line
  480. end if
  481.  
  482. xpos = instr(1,rAddress2,"_")
  483. rAddress21 = left(rAddress2,(xpos-1))
  484. if len(rAddress22) > 0 then
  485. sResAdd = rAddress11 + " " + rAddress21
  486. else
  487. sResAdd = rAddress11
  488. end if
  489. sResCity1 = rCity1 ' Residence City
  490.  
  491. if foundit = 7 or foundit = 11 or foundit = 17 then
  492. EMReadScreen sResState,2,15,65
  493. else
  494. EMReadScreen sResState,2,14,65 ' Residence State
  495. end if
  496.  
  497. xpos = instr(1,sResState,"_")
  498. sResState1 = left(sResState,(xpos-1))
  499.  
  500. if foundit = 7 or foundit = 11 or foundit = 17 then
  501. EMReadScreen sResZip,9,15,68
  502. else
  503. EMReadScreen sResZip,9,14,68 ' Residence Zip
  504. end if
  505.  
  506. xpos = instr(1,sResZip,"_")
  507. sResZip1 = left(sResZip,(xpos-1))
  508.  
  509. if foundit = 7 or foundit = 11 or foundit = 17 then
  510. EMReadScreen Country,15,16,44
  511. else
  512. EMReadScreen Country,15,15,44 ' Residence Country
  513. end if
  514.  
  515. xpos = instr(1,sCountry,"_")
  516. sCountry1 = left(sCountry,(xpos-1))
  517. if len(Country1) > 0 then
  518. sResState1 = sResState1 + Country1
  519. end if
  520. end if
  521.  
  522. if sResZip1 = "" then
  523.  
  524. if foundit = 7 or foundit = 11 or foundit = 17 then
  525. EMReadScreen sResZip,9,15,68
  526. else
  527. EMReadScreen sResZip,9,14,68 ' Residence Zip
  528. end if
  529.  
  530. xpos = instr(1,sResZip,"_")
  531. sResZip1 = left(sResZip,(xpos-1))
  532. end if
  533.  
  534. if sResState1 = "" or sResCity1 = "" then
  535. open "C:\ntc32\zipcodes.txt" for INPUT as #1 ' Zip Code Look-up
  536. found = 0
  537. Do While not EOF(1) and found = 0
  538. Line Input #1, s
  539. if left(s,5) = left(sResZip1,5) then
  540. found = 1
  541. if sResCity1 = "" then
  542. sResCity1 = right(s,len(s)-6)
  543. end if
  544. sResState1 = "AK"
  545. end if
  546. Loop
  547. close #1
  548. end if
  549.  
  550. if sResState1 = "" or sResZip1 = "" or sResCity1 = "" then
  551. Msgbox "City, State and ZipCode are all mandatory fields for DOT PRISM checks",0,"PRISM Information Required"
  552. FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N"
  553. stop ' State and ZipCode are mandatory fields.
  554. end if
  555.  
  556. clientparams = " /vin:" + sVIN1 + " /plate:" + sPlate1 + " /make:" + sMake1 + " /model:" + sModel1 + _
  557. " /modelyear:" + sYear + " /classcode:" + sStyle + " /fleet:" + sUnit1 + _
  558. " /weight:" + sGrossVehWeight1 + " /expiredate:" + sRegExpPrismFormat + " /hvut:FALSE" + " /street:" + _
  559. Chr(34) + sResAdd + Chr(34) + " /city:" + Chr(34) + sResCity1 + Chr(34) + " /state:" + _
  560. Chr(34) + sResState1 + Chr(34) + " /zipcode:" + sResZip1
  561.  
  562. kill("C:\NTC32\DMVPRISMClient\PRISMClientParams.txt")
  563. FileWrite "C:\NTC32\DMVPRISMClient\PRISMClientParams.txt", clientparams
  564. kill("C:\NTC32\DMVPRISMClient\CarrierID.txt")
  565. kill("C:\NTC32\DMVPRISMClient\TaxID.txt")
  566. kill("C:\NTC32\DMVPRISMClient\AxelCount.txt")
  567.  
  568. ' * else
  569. ' * FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' PRISM Check is not applicable for this Vehicle.
  570. end if
  571.  
  572. EMSendKeyFast "<ENTER>"
  573. Exit Sub
  574. end if
  575.  
  576. if foundit = 14 or foundit = 16 then ' Vehicle Title screens full reg (14) and temp permits (16)
  577.  
  578. ' * This consists of the company name, first, middle, last name and suffix which
  579. ' * is needed for the 2D barcode and is written in their own files.
  580. ' * There are seven screens that scrape the info, however there are two possible ways
  581. ' * of processing. One of them enables the user to input the info and the other does not.
  582. ' * There can only be only be ONE first owner and could be a person or a company name,
  583. ' * therefore a person's first name or a company name will be written to the lname.txt file.
  584. ' * rev 01-04-08
  585. ' *
  586. ' * Modified July 2010 - Patrick Brosnan
  587. ' * Since we print up to two Owner's names on the registration form, we need to provide for including two
  588. ' * names in the 2D barcode (OW subfile on top barcode on form, as per AAMVA specifications).
  589. ' * If present, the SECOND owner's name (Person or Company) is written to the fname2.txt, mname2.txt, lname2.txt
  590. ' * suffname2.txt (cname2.txt if a Company).
  591.  
  592.  
  593. FileRead "C:\NTC32\DMVPRISMCLient\PRISMCheck.txt",prismflag,0
  594.  
  595. ' To collect for PRISM check
  596. EMReadScreen sRegVehTitle, 7,19,15
  597. sRegVehTitle = RTrim(sRegVehTitle)
  598.  
  599. ' To collect the First, Middle, Last and Suffix Names
  600. ' First Name of First Owner
  601. EMReadScreen ScnLine,80,7,1 ' Reads line 7 company name
  602. xpos = InStr(12, ScnLine, ":") ' Find first colon
  603. firstpos = xpos + 2 ' Should be on first char of company name
  604. CNameTemp = Mid$(ScnLine, firstpos, 1) ' looks for the string
  605.  
  606. Conj = Mid$(ScnLine, 54, 4) 'Grab the first Conjunction field from screen
  607. lastpos = 0
  608. lastpos = Instr(1, Conj, "_") 'See if underscore char is there
  609. if lastpos = 0 then
  610. lastpos = Instr(1, Conj, " ") ' See if has a space
  611. else
  612. Conj = Mid$(Conj, 1, lastpos - 1) ' lastpos = count of chars
  613. end if
  614. if Conj = "" then
  615. Conj = " "
  616. end if
  617. Conj = UCase(Conj)
  618. FileWrite "C:\NTC32\RegistrantInfo\conj1.txt", Conj
  619.  
  620. if CNameTemp = " " Or CNameTemp = "_" then ' if the company name line is empty or has an underscore then.......
  621. ' we have a person to deal with
  622. CName = " "
  623. FileWrite "C:\NTC32\RegistrantInfo\cname.txt", CName
  624.  
  625. ' First Name of First Owner
  626. EMReadScreen ScnLine,80,5,1 ' Reads line 5
  627.  
  628. FName = Mid$(ScnLine, 15, 16) 'Grab the entire first name field from screen
  629. lastpos = 0
  630. lastpos = Instr(1, FName, "_") 'See if underscore char is there
  631. if lastpos = 0 then
  632. lastpos = Instr(1, FName, " ") ' See if has a space
  633. else
  634. FName = Mid$(FName, 1, lastpos - 1) ' lastpos = count of chars
  635. end if
  636. FName = UCase(FName)
  637. sFullName = FName ' We now have the first name with out _'s or spaces
  638. FileWrite "C:\NTC32\RegistrantInfo\fname.txt", FName
  639.  
  640. lastpos = 0
  641. MName = Mid$(ScnLine, 31, 16) ' Grab the Middle Name
  642. lastpos = Instr(1, MName, "_") ' See if underscore char is there
  643. if lastpos = 0 then
  644. lastpos = Instr(1, MName, " ") ' See if has a space
  645. else
  646. MName = Mid$(MName, 1, lastpos - 1 ) ' lastpos = count of chars
  647. MName = UCase(MName)
  648. end if
  649. if MName = "" then
  650. MName = " "
  651. else
  652. sFullName = sFullName + " " + MName
  653. end if
  654. FileWrite "C:\NTC32\RegistrantInfo\mname.txt", MName
  655.  
  656. lastpos = 0
  657. LName = Mid$(ScnLine, 47, 26) ' Grab the Last Name
  658. lastpos = Instr(1, LName, "_") ' See if underscore char is there
  659. if lastpos = 0 then
  660. lastpos = Instr(1, LName, " ") ' See if has a space
  661. else
  662. LName = Mid$(LName, 1, lastpos - 1 ) ' lastpos = count of chars
  663. LName = UCase(LName)
  664. sFullName = sFullName + " " + LName
  665. end if
  666. FileWrite "C:\NTC32\RegistrantInfo\lname.txt", LName
  667.  
  668. lastpos = 0
  669. SuffName = Mid$(ScnLine, 73, 5) ' Grab the suffix
  670. lastpos = Instr(1, SuffName, "_") ' See if underscore char is there
  671. if lastpos = 0 then
  672. lastpos = Instr(1, SuffName, " ") ' See if has a space
  673. else
  674. SuffName = Mid$(SuffName, 1, lastpos - 1 ) ' lastpos = count of chars
  675. SuffName = UCase(SuffName)
  676. end if
  677. if SuffName = "" then
  678. SuffName = " "
  679. else
  680. sFullName = sFullName + " " + SuffName
  681. end if
  682. SuffName = UCase(SuffName)
  683. FileWrite "C:\NTC32\RegistrantInfo\suffname.txt", SuffName
  684.  
  685. else
  686. CName = Mid$(ScnLine, 15, 32) ' Grab the entire Company Name
  687. lastpos = 0
  688. lastpos = InStr(1, CName, "_") ' Finds two spaces after the name
  689. if lastpos = 0 then
  690. lastpos = InStr(1, CName, " ") ' if company name has an underscore
  691. else
  692. CName = Mid$(CName, 1, lastpos - 1 )
  693. end if
  694. CName = UCase(CName)
  695. sFullName = CName
  696. FileWrite "C:\NTC32\RegistrantInfo\cname.txt", CName
  697. FileWrite "C:\NTC32\RegistrantInfo\fname.txt", " "
  698. FileWrite "C:\NTC32\RegistrantInfo\mname.txt", " "
  699. FileWrite "C:\NTC32\RegistrantInfo\lname.txt", " "
  700. FileWrite "C:\NTC32\RegistrantInfo\suffname.txt", " "
  701. end if
  702.  
  703. ' To collect the First, Middle, Last and Suffix Names for Second Owner
  704.  
  705. EMReadScreen ScnLine,80,10,1 ' Reads line 7 company name
  706. xpos = InStr(12, ScnLine, ":") ' Find first colon
  707. firstpos = xpos + 2 ' Should be on first char of company name
  708. CNameTemp = Mid$(ScnLine, firstpos, 1) ' looks for the string
  709.  
  710. Conj = Mid$(ScnLine, 54, 4) 'Grab the second Conjunction field from screen
  711. lastpos = 0
  712. lastpos = Instr(1, Conj, "_") 'See if underscore char is there
  713. if lastpos = 0 then
  714. lastpos = Instr(1, Conj, " ") ' See if has a space
  715. else
  716. Conj = Mid$(Conj, 1, lastpos - 1) ' lastpos = count of chars
  717. end if
  718. if Conj = "" then
  719. Conj = " "
  720. end if
  721. Conj = UCase(Conj)
  722. FileWrite "C:\NTC32\RegistrantInfo\conj2.txt", Conj
  723.  
  724. if CNameTemp = " " Or CNameTemp = "_" then ' if the company name line is empty or has an underscore then.......
  725. ' we have a person to deal with
  726. CName = " "
  727. FileWrite "C:\NTC32\RegistrantInfo\cname2.txt", CName
  728.  
  729. ' First Name of Second Owner
  730. EMReadScreen ScnLine,80,8,1 ' Reads line 8
  731.  
  732. FName = Mid$(ScnLine, 15, 16) 'Grab the entire first name field from screen
  733. lastpos = 0
  734. lastpos = Instr(1, FName, "_") 'See if underscore char is there
  735. if lastpos = 0 then
  736. lastpos = Instr(1, FName, " ") ' See if has a space
  737. else
  738. FName = Mid$(FName, 1, lastpos - 1) ' lastpos = count of chars
  739. end if
  740. FName = UCase(FName)
  741. ' sFullName = FName
  742. if FName = "" then
  743. FName = " "
  744. end if ' We now have the first name with out _'s or spaces
  745. FileWrite "C:\NTC32\RegistrantInfo\fname2.txt", FName
  746.  
  747. lastpos = 0
  748. MName = Mid$(ScnLine, 31, 16) ' Grab the Middle Name
  749. lastpos = Instr(1, MName, "_") ' See if underscore char is there
  750. if lastpos = 0 then
  751. lastpos = Instr(1, MName, " ") ' See if has a space
  752. else
  753. MName = Mid$(MName, 1, lastpos - 1 ) ' lastpos = count of chars
  754. MName = UCase(MName)
  755. ' sFullName = sFullName + " " + MName
  756. end if
  757. if MName = "" then
  758. MName = " "
  759. end if
  760. FileWrite "C:\NTC32\RegistrantInfo\mname2.txt", MName
  761.  
  762. lastpos = 0
  763. LName = Mid$(ScnLine, 47, 26) ' Grab the Last Name
  764. lastpos = Instr(1, LName, "_") ' See if underscore char is there
  765. if lastpos = 0 then
  766. lastpos = Instr(1, LName, " ") ' See if has a space
  767. else
  768. LName = Mid$(LName, 1, lastpos - 1 ) ' lastpos = count of chars
  769. LName = UCase(LName)
  770. ' sFullName = sFullName + " " + LName
  771. end if
  772. if LName = "" then
  773. LName = " "
  774. end if
  775. FileWrite "C:\NTC32\RegistrantInfo\lname2.txt", LName
  776.  
  777. lastpos = 0
  778. SuffName = Mid$(ScnLine, 73, 5) ' Grab the suffix
  779. lastpos = Instr(1, SuffName, "_") ' See if underscore char is there
  780. if lastpos = 0 then
  781. lastpos = Instr(1, SuffName, " ") ' See if has a space
  782. else
  783. SuffName = Mid$(SuffName, 1, lastpos - 1 ) ' lastpos = count of chars
  784. SuffName = UCase(SuffName)
  785. ' sFullName = sFullName + " " + SuffName
  786. end if
  787. if SuffName = "" then
  788. SuffName = " "
  789. end if
  790. SuffName = UCase(SuffName)
  791. FileWrite "C:\NTC32\RegistrantInfo\suffname2.txt", SuffName
  792.  
  793. else
  794. CName = Mid$(ScnLine, 15, 32) ' Grab the entire Company Name
  795. lastpos = 0
  796. lastpos = InStr(1, CName, "_") ' Finds two spaces after the name
  797. if lastpos = 0 then
  798. lastpos = InStr(1, CName, " ") ' if company name has an underscore
  799. else
  800. CName = Mid$(CName, 1, lastpos - 1 )
  801. end if
  802. CName = UCase(CName)
  803. ' sFullName = CName
  804. FileWrite "C:\NTC32\RegistrantInfo\cname2.txt", CName
  805. FileWrite "C:\NTC32\RegistrantInfo\fname2.txt", " "
  806. FileWrite "C:\NTC32\RegistrantInfo\mname2.txt", " "
  807. FileWrite "C:\NTC32\RegistrantInfo\lname2.txt", " "
  808. FileWrite "C:\NTC32\RegistrantInfo\suffname2.txt", " "
  809. end if
  810.  
  811. if prismflag <> "Y" then
  812. FileWrite "C:\NTC32\DMVPRISMClient\PRISMClientParams1.txt"," /axels: /carrier: /tin:" + " /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + Chr(34) + sMCRFS + Chr(34)
  813. EMSendKeyFast "<ENTER>"
  814. Exit Sub
  815. end if
  816.  
  817. FileRead "C:\NTC32\DMVPRISMClient\CarrierID.txt", sCarrierID, 0
  818. if NM_ResultCode = 3 then ' file not found ..... so prompt for DOT Number, Tax ID, No. of Axels and MCRFS to change.
  819. Shell ("C:\NTC32\DMVPRISMClient\PRISMPrompt.exe") ' Run PRISMPrompt.exe, which will prompt user for above 4 items
  820. Do
  821. FileRead "C:\NTC32\DMVPRISMClient\CarrierID.txt", sCarrierID, 0
  822. If NM_ResultCode <> 3 Then
  823. FileRead "C:\NTC32\DMVPRISMClient\TaxID.txt", sTaxID, 0
  824. If NM_ResultCode <> 3 Then
  825. FileRead "C:\NTC32\DMVPRISMClient\AxelCount.txt", sAxelCount, 0
  826. If NM_ResultCode <> 3 Then
  827. FileRead "C:\NTC32\DMVPRISMClient\MCRFS.txt",sMCRFS,0
  828. If NM_ResultCode <> 3 Then
  829. Exit Do ' All 4 files were found, #Axles is > 0 ... so the user has hit OK at the prompt
  830. End If
  831. End If
  832. End If
  833. End If
  834.  
  835. Dim sCancel As String
  836. FileRead "C:\NTC32\DMVPRISMClient\PRISMPromptCancel.txt", sCancel, 0
  837. If NM_ResultCode <> 3 Then
  838. Stop
  839. End If
  840. Loop
  841. end if
  842.  
  843. ' we are past the do ... loop above so we have sCarrierID, sTaxID, sAxelCount and sMCRFS values
  844.  
  845. FileRead "C:\NTC32\DMVPRISMClient\CarrierID.txt", sCarrierID, 0
  846. FileRead "C:\NTC32\DMVPRISMClient\TaxID.txt", sTaxID, 0
  847. FileRead "C:\NTC32\DMVPRISMClient\AxelCount.txt", sAxelCount, 0
  848. FileRead "C:\NTC32\DMVPRISMClient\MCRFS.txt", sMCRFS, 0
  849.  
  850. FileRead "C:\NTC32\DMVPRISMClient\PRISMClientParams.txt",Scnline,0
  851. 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)
  852.  
  853. dim sPRISMClientSuccess as string
  854. dim sPRISMClientError As string
  855. dim sPRISMClientFailMsg as string
  856. dim sPRISMClientFailMsg1 as string
  857. dim sPRISMClientFailMsg2 as string
  858. dim Error_Checker as Integer
  859.  
  860. Kill "C:\NTC32\DMVPRISMClient\Success.txt" ' indicates passing PRISM check
  861. Kill "C:\NTC32\DMVPRISMClient\Fail.txt" ' indicates failure of PRISM check ... print letter and stop
  862. Kill "C:\NTC32\DMVPRISMClient\Error.txt" ' indicates a DOT / PRISM problem .... continue registration using DMV barcode
  863. ' Shell ("C:\NTC32\DMVPRISMClient\PRISMClient.exe " + ScnLine + " /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + _
  864. ' " /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + sMCRFS)
  865. ' June 2013 update: Check for 'EXEMPT' and bypass PRISM call if found - PB
  866.  
  867. if sCarrierID = "EXEMPT" then
  868. FileWrite "C:\NTC32\DMVPRISMClient\Success.txt","EXEMPT"
  869. else
  870. Shell ("C:\NTC32\DMVPRISMClient\PRISMClient.exe " + ScnLine + " /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + _
  871. " /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + sMCRFS)
  872. end if
  873.  
  874. Do 'Examine outcome of PRISM check .... if fails, option to retry using different/corrected sCarrierID, sTaxID, sAxelCount values
  875.  
  876. LoopLabel:
  877.  
  878. FileRead "C:\NTC32\DMVPRISMClient\Success.txt", sPRISMClientSuccess, 0
  879. if NM_ResultCode <> 3 then ' Success.txt has been found ... the PRISM check has passed
  880. EMSendKeyFast "<ENTER>"
  881. Exit Sub
  882. end if
  883.  
  884. FileRead "C:\NTC32\DMVPRISMClient\Error.txt", sPRISMClientError, 0
  885. If NM_ResultCode <> 3 Then ' Error.txt has been found .... PRISM / DOT communication problem ... proceed using DMV barcode ... or opt to retry.
  886. 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")
  887. if ret <> 6 then
  888. EMSendKeyFast "<ENTER>" ' not opting to retry ....
  889. Exit Sub ' dmv.vba script will check for Success.txt / Error.txt files to determine which barcode to use.
  890. else ' retry the PRISM Check
  891. Kill "C:\NTC32\DMVPRISMClient\Error.txt" ' indicates a DOT / PRISM problem ... opting to Retry
  892. Shell ("C:\NTC32\DMVPRISMClient\PRISMClient.exe " + ScnLine + " /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + _
  893. " /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle + " /mcrfs:" + sMCRFS)
  894.  
  895. Goto LoopLabel
  896. end if
  897. end if
  898.  
  899. Error_Checker = 1
  900. FileRead "C:\NTC32\DMVPRISMClient\Fail.txt", sPRISMClientFailMsg, 0 ' essentially, remove the phone number from DOT return message.
  901. Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied TIN has" , 1)
  902. if Error_Checker > 0 Then
  903. sDotMsgL1 = "The supplied TIN has no USDOT# associated with it."
  904. end if
  905. Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied TIN is", 1)
  906. if Error_Checker > 0 Then
  907. sDotMsgL1 = "The supplied TIN is associated with a different USDOT#."
  908. end if
  909. Error_Checker = Instr (1, sPRISMClientFailMsg, "The person", 1)
  910. if Error_Checker > 0 Then
  911. 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."
  912. end if
  913. Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied USDOT" , 1)
  914. if Error_Checker > 0 Then
  915. sDotMsgL1 = "The supplied USDOT# is not associated with a carrier or a shipper."
  916. end if
  917. Error_Checker = Instr (1, sPRISMClientFailMsg, "Records indicate that the motor carrier associated with USDOT#", 1) '2E
  918. if Error_Checker > 0 Then
  919. 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."
  920. end if
  921. Error_Checker = Instr (1, sPRISMClientFailMsg, "Records indicate that the motor carrier (USDOT#" , 1) ' 2F
  922. if Error_Checker > 0 Then
  923. 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."
  924. end if
  925. Error_Checker = Instr (1, sPRISMClientFailMsg, "The USDOT#", 1)
  926. if Error_Checker > 0 Then
  927. sDotMsgL1 = "The USDOT# presented by the registrant is inactive. The USDOT# must be active."
  928. end if
  929. If NM_ResultCode <> 3 Then ' Fail.txt has been found .... PRISM check has failed. Print letter and option to retry in order to proceed.
  930. If (sPRISMClientFailMsg = "PROGRAM ERROR - Vehicle VIN is missing." Or _
  931. sPRISMClientFailMsg = "PROGRAM ERROR - Registration Expiration Date must be format YYYYMM." Or _
  932. sPRISMClientFailMsg = "PROGRAM ERROR - Registration Expiration Date cannot before today." Or _
  933. sPRISMClientFailMsg = "PROGRAM ERROR - License Plate Number is missing." Or _
  934. sPRISMClientFailMsg = "PROGRAM ERROR - Vehicle Make is missing." Or _
  935. sPRISMClientFailMsg = "PROGRAM ERROR - Vehicle Model Year must be format YY." Or _
  936. sPRISMClientFailMsg = "PROGRAM ERROR - Vehicle Type (Class Code) is missing.") Then
  937. 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"
  938. Stop
  939. end if
  940.  
  941. 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")
  942. if ret <> 6 then
  943. ' not opting to retry .... print letter and Stop
  944. MsgBox "Remove the Vehicle Registration from the tray. An explanatory letter will be printed for your customer.",0,"DOT PRISM Check"
  945.  
  946. FileWrite "C:\NTC32\screen.trc", Space(80)
  947. Open "C:\NTC32\screen.trc" For Append As #1
  948. Print #1, Space(80) ' Padding at front of file for it to print correctly.
  949. Print #1, Space(80)
  950. Print #1, Space(80)
  951. Print #1, Space(80)
  952. Print #1, Space(80)
  953. Print #1, Space(80)
  954. Print #1, Space(80)
  955. Print #1, Space(80)
  956. Print #1, Space(80)
  957. Print #1, Space(81)
  958. Print #1, Space(81)
  959. Print #1, Space(81)
  960. Print #1, Space(81)
  961. Print #1, Space(81)
  962. Print #1, Space(81)
  963. Print #1, Space(81)
  964. Print #1, Space(81)
  965. Print #1, Space(81)
  966. Print #1, Space(80)
  967. Print #1, Space(81)
  968. Print #1, Space(81)
  969. Print #1, Space(81)
  970. Print #1, Space(80)
  971.  
  972. Print #1, "INFO11 24 19558686"
  973. Print #1, " "
  974.  
  975. x1 = len(sFullName) ' Find the len of full name
  976. if x1 < 50 then
  977. sFullName = sFullName + space(50-x1) ' Makes it a fixed 50 chars
  978. end if
  979.  
  980. Print #1, sFullName ' Appends the full name of registrant
  981.  
  982. ' Extract sResAdd sResCity sResState sResZip and sPlate from ScnLine
  983.  
  984. lastpostemp = ScnLine
  985. firstpos = Instr(1,lastpostemp,"/vin:")
  986. lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 4)))
  987. firstpos = Instr(1,lastpostemp,"/plate:")
  988. sVIN = left$(lastpostemp,firstpos - 2)
  989.  
  990. lastpostemp = ScnLine
  991. firstpos = Instr(1,lastpostemp,"/plate:")
  992. lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 6)))
  993. firstpos = Instr(1,lastpostemp,"/make:")
  994. sPlate = left$(lastpostemp,firstpos - 2)
  995.  
  996. firstpos = Instr(1,lastpostemp,"/street:")
  997. lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 8)))
  998. firstpos = Instr(1,lastpostemp,"/city:")
  999. sResAdd = left$(lastpostemp,firstpos - 3)
  1000.  
  1001. firstpos = Instr(1,lastpostemp,"/city:")
  1002. lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 6)))
  1003. firstpos = Instr(1,lastpostemp,"/state:")
  1004. sResCity = left$(lastpostemp,firstpos - 3)
  1005.  
  1006. firstpos = Instr(1,lastpostemp,"/state:")
  1007. lastpostemp = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 7)))
  1008. firstpos = Instr(1,lastpostemp,"/zipcode:")
  1009. sResState = left$(lastpostemp,firstpos - 3)
  1010.  
  1011. firstpos = Instr(1,lastpostemp,"/zipcode:")
  1012. sResZip = Right$(lastpostemp,(len(lastpostemp) - (firstpos + 8)))
  1013.  
  1014. x1 = len(sResAdd) ' Find the len of res addr
  1015. if x1 < 50 then
  1016. sResAdd = sResAdd + space(50-x1) ' Makes it a fixed 50 chars
  1017. end if
  1018. Print #1, sResAdd ' Appends the full name of registrant
  1019.  
  1020. sResCityStateZip = sResCity + " " + sResState + " " + sResZip ' Concat and make into a var
  1021. x1 = len(sResCityStateZip) ' Find the len of city,state,zip of res addr
  1022. if x1 < 50 then
  1023. sResCityStateZip = sResCityStateZip + space(50-x1) ' Makes it a fixed 50 chars
  1024. end if
  1025. Print #1, sResCityStateZip ' Appends the full name of registrant
  1026.  
  1027. x1 = len(sPlate) ' Find the len of vehicle plate
  1028. if x1 < 6 then
  1029. sPlate = sPlate + space(6-x1) ' Makes it a fixed 6 chars
  1030. end if
  1031. Print #1, sPlate ' Appends the full name of registrant
  1032.  
  1033.  
  1034. ' Reads the fail message and appends each line to have a fixed 755 chars to the screen.trc file
  1035. ' Each fail message includes 2A, 2B, 2C, 2D, 2E, 2F, 2G which will be printed on the SOA letter
  1036.  
  1037. Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied TIN has" , 1)
  1038. if Error_Checker > 0 Then
  1039. sDotMsgId = "2A"
  1040. sDotMsgL1 = "The supplied TIN has no USDOT# associated with it. (" + CStr(Date()) + ")"
  1041. sDotMsgL2 = Space(75)
  1042. sDotMsgL3 = Space(75)
  1043. end if
  1044.  
  1045. Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied TIN is", 1)
  1046. if Error_Checker > 0 Then
  1047. sDotMsgId = "2B"
  1048. sDotMsgL1 = "The supplied TIN is associated with a different USDOT#. (" + CStr(Date()) + ")"
  1049. sDotMsgL2 = Space(75)
  1050. sDotMsgL3 = Space(75)
  1051. end if
  1052.  
  1053. Error_Checker = Instr (1, sPRISMClientFailMsg, "The person", 1)
  1054. if Error_Checker > 0 Then
  1055. sDotMsgId = "2C"
  1056. sDotMsgL1 = "The person or company registering this vehicle is required to maintain"
  1057. sDotMsgL2 = "a current MCS-150. Records indicate that your MCS-150 has not been"
  1058. sDotMsgL3 = "updated within the past year. (" + CStr(Date()) + ")"
  1059. end if
  1060.  
  1061. Error_Checker = Instr (1, sPRISMClientFailMsg, "The supplied USDOT" , 1)
  1062. if Error_Checker > 0 Then
  1063. sDotMsgId = "2D"
  1064. sDotMsgL1 = "The supplied USDOT# is not associated with a carrier or a shipper."
  1065. sDotMsgL2 = "(" + CStr(Date()) + ")"
  1066. sDotMsgL3 = Space(75)
  1067. end if
  1068.  
  1069. Error_Checker = Instr (1, sPRISMClientFailMsg, "Records indicate that the motor carrier associated with USDOT#" , 1)
  1070. if Error_Checker > 0 Then
  1071. sDotMsgId = "2E"
  1072. sDotMsgL1 = "Records indicate that the motor carrier associated with this USDOT#"
  1073. sDotMsgL2 = "is under a Federal Out of Service Order. This safety status precludes"
  1074. sDotMsgL3 = "registration of this vehicle. (" + CStr(Date()) + ")"
  1075. end if
  1076.  
  1077. Error_Checker = Instr (1, sPRISMClientFailMsg, "Records indicate that the motor carrier (USDOT#", 1)
  1078. if Error_Checker > 0 Then
  1079. sDotMsgId = "2F"
  1080. sDotMsgL1 = "Records indicate that the motor carrier associated with this USDOT# for"
  1081. sDotMsgL2 = "this vehicle identification number is under a Federal Out of Service Order."
  1082. sDotMsgL3 = "This safety status precludes registration of this vehicle. (" + CStr(Date()) + ")"
  1083. end if
  1084.  
  1085. Error_Checker = Instr (1, sPRISMClientFailMsg, "The USDOT#", 1)
  1086. if Error_Checker > 0 Then
  1087. sDotMsgId = "2G"
  1088. sDotMsgL1 = "The USDOT# presented by the registrant is inactive. The USDOT# must be"
  1089. sDotMsgL2 = "active. (" + CStr(Date()) + ")"
  1090. sDotMsgL3 = Space(75)
  1091. end if
  1092.  
  1093. x1 = len(sDotMsgL1) ' Find the len of line 1
  1094. if x1 < 75 then
  1095. sDotMsgL1 = sDotMsgL1 + space(75-x1) ' Makes it a fixed 75 chars
  1096. end if
  1097. x1 = len(sDotMsgL2) ' Find the len of line 2
  1098. if x1 < 75 then
  1099. sDotMsgL2 = sDotMsgL2 + space(75-x1) ' Makes it a fixed 75 chars
  1100. end if
  1101. x1 = len(sDotMsgL3) ' Find the len of line 3
  1102. if x1 < 75 then
  1103. sDotMsgL3 = sDotMsgL3 + space(75-x1) ' Makes it a fixed 75 chars
  1104. end if
  1105.  
  1106. Print #1, sDotMsgId ' Appends each line to the trace file
  1107. Print #1, sDotMsgL1
  1108. Print #1, sDotMsgL2
  1109. Print #1, sDotMsgL3
  1110.  
  1111. x1 = len(sVIN)
  1112. if x1 < 17 then
  1113. sVIN = sVIN + space(17-x1)
  1114. end if
  1115. Print #1, sVIN
  1116. Close #1
  1117. Shell ("C:\DMVPrintEngine\dmvprint.exe /1:PrismFail") ' Print the thing
  1118. Stop
  1119. else ' re-trying the PRISM check ..... PRISMPrompt first, then run PRISMClient, loop back
  1120. Kill "C:\NTC32\DMVPRISMClient\CarrierID.txt"
  1121. Kill "C:\NTC32\DMVPRISMClient\TaxID.txt"
  1122. Kill "C:\NTC32\DMVPRISMClient\AxelCount.txt"
  1123. Shell ("C:\NTC32\DMVPRISMClient\PRISMPrompt.exe") ' Run PRISMPrompt.exe, which will prompt user for CarrierID (DOT #) and TaxID (TIN)
  1124. Do
  1125. FileRead "C:\NTC32\DMVPRISMClient\CarrierID.txt", sCarrierID, 0
  1126.  
  1127. If NM_ResultCode <> 3 Then
  1128. FileRead "C:\NTC32\DMVPRISMClient\TaxID.txt", sTaxID, 0
  1129. If NM_ResultCode <> 3 Then
  1130. FileRead "C:\NTC32\DMVPRISMClient\AxelCount.txt", sAxelCount, 0
  1131. If NM_ResultCode <> 3 Then
  1132. Exit Do ' All 3 files were found, so the user has hit OK at the prompt
  1133. End If
  1134. End If
  1135. End If
  1136.  
  1137. FileRead "C:\NTC32\DMVPRISMClient\PRISMPromptCancel.txt", sCancel, 0
  1138. If NM_ResultCode <> 3 Then
  1139. Stop
  1140. End If
  1141. Loop
  1142.  
  1143. Kill "C:\NTC32\DMVPRISMClient\Success.txt" ' indicates passing PRISM check
  1144. Kill "C:\NTC32\DMVPRISMClient\Fail.txt" ' indicates failure of PRISM check ... print letter and stop
  1145. Kill "C:\NTC32\DMVPRISMClient\Error.txt" ' indicates a DOT / PRISM problem .... continue registration using DMV barcode
  1146. Shell ("C:\NTC32\DMVPRISMClient\PRISMClient.exe " + ScnLine + " /axels:" + sAxelCount + " /carrier:" + sCarrierID + " /tin:" + sTaxID + _
  1147. " /name:" + Chr(34) + sFullName + Chr(34) + " /title:" + sRegVehTitle )
  1148. end if
  1149. end If
  1150. Loop
  1151.  
  1152. EMSendKeyFast "<ENTER>" ' Send the enter key
  1153. Exit Sub
  1154. end if
  1155.  
  1156. Select Case foundit
  1157. Case -1 'No screen to process so pass Enter keystroke on and quit
  1158. EMSendKeyFast "<ENTER>"
  1159. stop
  1160. Exit Sub
  1161. ' ***********************************************************
  1162. Case 0 ' Data(0) - Junk Titles - AVTU300P
  1163. ' ***********************************************************
  1164. EMReadScreen sJunkStatus,1,20,3 ' Read Status and see if J
  1165. if sJunkStatus <> "J" then ' If not junked look at other spots for J then
  1166. EMReadScreen sJunkStatus,1,21,3 ' Read Status and see if J
  1167. if sJunkStatus <> "J" then ' If not junked look at other spots for J then
  1168. EMReadScreen sJunkStatus,1,22,3 ' Read Status and see if J
  1169. if sJunkStatus <> "J" then ' If not junked look at other spots for J then Stop
  1170. EMReadScreen sJunkStatus,1,23,3 ' Read Status and see if J
  1171. if sJunkStatus <> "J" then ' If not junked look at other spots for J then Stop
  1172. EMReadScreen sJunkStatus,1,23,3 ' Read Status and see if J
  1173. EMSendKeyFast "<ENTER>" ' Important to send the ENTER key regardless
  1174. stop
  1175. end if
  1176. end if
  1177. end if
  1178. end if
  1179.  
  1180. EMReadScreen sName,5,10,17
  1181. if sName = "PRESS" then 'There is an NMVTIS popup window onscreen ... send the ENTER key and exit
  1182. EMSendKeyFast "<ENTER>"
  1183. stop
  1184. end if
  1185.  
  1186. EMReadScreen sDate,8,3,59 ' Read the date
  1187. EMReadScreen sName,60,4,14 ' Read the Name
  1188. sName = Trim (sName) ' Strip trailing and leading spaces
  1189. EMReadScreen sVIN,20,5,33 ' VIN
  1190. sVIN = Trim(sVIN) ' Strip extra spaces away (leading and trailing)
  1191. sDocId = "JUNK-STATUS-DocType-40" ' Lead sheet title / description
  1192.  
  1193. ' Contruct the cmdline with appropriate arguments for execution within windows, the name arg has to be last item by code
  1194. ' design and the fact that .net arguments are delimted by spacebands thus the name is concated within the .net routine
  1195.  
  1196. CmdLine = "C:\IDRS\fldcoversheet\IDRSCoversheetFldWrk.exe "
  1197. CmdLine = CmdLine + "/print:true" + " " + "/date:" + sDate + " " + "/vin:" + sVIN + " " + "/title:" + sDocID + " " + "/name:" + sName
  1198. ' MsgBox CmdLine
  1199. Shell ( CmdLine )
  1200.  
  1201. EMSendKeyFast "<ENTER>"
  1202. stop
  1203. Exit Sub
  1204. ' ***********************************************************
  1205. Case 1 ' Data(1) - DL's New/Dup/Renew - GENIC
  1206. ' ***********************************************************
  1207. 'Start 001
  1208.  
  1209. cnt = 1
  1210. EMReadScreen ScrLine,80,cnt,1 'mlp/2/27/14 -for bar code print
  1211. FileWrite "C:\ntc32\screen.trc", ScnLine 'mlp/2/27/14 -for bar code print
  1212. '**JJM Get ISN and append to beggining of the file
  1213. DIM ISN as string
  1214. DIM TMPSTR as string
  1215. DIM sISN as string
  1216.  
  1217. ISN=""
  1218. EMReadScreen ScrLine,80,4,2
  1219.  
  1220. TMPSTR=ScrLine
  1221. ISN=Left$(TMPSTR,8)
  1222. ISN=PadString(ISN,80," ","right")
  1223. TMPSTR=" "
  1224. TMPSTR=PadString(TMPSTR,80," ","right")
  1225. FileAppend ISN
  1226. FileAppend TMPSTR
  1227. FileAppend ISN
  1228.  
  1229.  
  1230. '** 001
  1231.  
  1232. ' Read the next 23 lines and append it to the existing file (totally 24 lines)
  1233.  
  1234. For cnt = 2 to 24
  1235.  
  1236. If cnt= 4 then
  1237. EMReadScreen ScrLine,80,cnt,9
  1238. TMPSTR=""
  1239. TMPSTR= Left$(ScrLine,50)
  1240. TMPSTR=PadString(TMPSTR,80," ","right")
  1241. ' MsgBox TMPSTR
  1242. ScrLine=TMPSTR
  1243.  
  1244. FileAppend TMPSTR
  1245. else
  1246. EMReadScreen ScrLine,80,cnt,1
  1247. FileAppend ScrLine
  1248. end if
  1249.  
  1250. 'msgbox ScrLine
  1251. Next cnt
  1252.  
  1253.  
  1254. 'PLACEHOLDER
  1255.  
  1256.  
  1257.  
  1258.  
  1259. ' mlp 3/25/14 - begin signature Pad capture
  1260.  
  1261. EMReadScreen sProgname,5,3,2
  1262. EMReadScreen sIsn,8,4,2
  1263. 'if sProgname = "GENIC" and sISN = " " then
  1264. if sISN <> " " then
  1265.  
  1266. Dim DOB as string
  1267. Dim Sigflag as string
  1268. Dim Env as string
  1269. Dim sName1 as string
  1270. Dim sName2 as string
  1271. ChDir "c:\CIIV"
  1272. ' ChDir "C:\Users\Public\Marquis ID Systems"
  1273. EMReadScreen sName1,23,9,12
  1274. EMReadScreen sName2,30,9,35
  1275. EMReadScreen mAddress1,60,13,12
  1276. EMReadScreen mAddress2,60,14,12
  1277. EMReadScreen DOB,10,19,12
  1278. EMReadScreen Sigflag,1,5,2
  1279. EMReadScreen Env,1,6,2
  1280. CmdLine = "C:\CIIV\AKDL_SIGCAPTURE.EXE " +Chr(34)+ISN+Chr(34) + " " +Chr(34)+sName1+Chr(34) + " " +Chr(34)+" "+Chr(34) + " "
  1281. CmdLine = CmdLine +Chr(34)+sName2+Chr(34) + " " + Chr(34)+mAddress1+Chr(34) + " " +Chr(34)+" "+Chr(34) + " " + Chr(34)+mAddress2+Chr(34) + " "
  1282. CmdLine = CmdLine + Chr(34)+" "+Chr(34) + " " + Chr(34)+" "+Chr(34) + " "
  1283. CmdLine = CmdLine +Chr(34)+DOB+Chr(34) + " " + Chr(34)+Sigflag+Chr(34) + " " + Chr(34)+"P"+Chr(34) 'add environment here mlp 3/25/14
  1284. 'JJM 03/25/14 Do while till program returns true
  1285.  
  1286. Dim wsh As Object
  1287. Set wsh = CreateObject("WScript.Shell")
  1288. Dim waitOnReturn As Boolean: waitOnReturn = True
  1289. Dim windowStyle As Integer: windowStyle = 1
  1290. Dim intRetCode As Integer
  1291. intRetCode = 0
  1292. Do While intRetCode = 0
  1293. ' MsgBox intRetCode
  1294. intRetCode =wsh.Run(CmdLine, windowStyle, waitOnReturn)
  1295. intRetCode = 1
  1296. ' MsgBox intRetCode
  1297. Loop
  1298.  
  1299.  
  1300. 'end JJM
  1301. 'Shell ( CmdLine )
  1302.  
  1303. end if
  1304. thisType = ""
  1305. sAction = "APP" ' Make always an Application
  1306. EMReadScreen sDate,10,3,53 ' Read the date
  1307. EMReadScreen sName,60,9,12 ' Name
  1308. sName = Trim$(sName) ' Strip trailing and leading spaces
  1309. EMReadScreen sIDLic,7,20,2 ' ID or DL Number
  1310. EMReadScreen sType, 5,7,12 ' Type of ID/Lic
  1311. thisType = RTrim$(sType)
  1312.  
  1313. if len(thisType) > 2 then 'If 2 license classes, add a '_' character between them
  1314. xpos = Instr(1,sType," ")
  1315. sType1 = Left$(sType,xpos-1) + "_" + Right$(sType,len(SType)-xpos)
  1316. end if
  1317.  
  1318. sDocId = "DL/ID-APPLICATION-DocType-10" ' Lead sheet title / description
  1319.  
  1320.  
  1321. CmdLine = "C:\IDRS\fldcoversheet\IDRSCoversheetFldWrk.exe "
  1322.  
  1323.  
  1324. if len(SType1) > 2 then
  1325. CmdLine = CmdLine + "/dlid:" + sIDLic + " " + "/title:" + sDocID + " " + "/print:true" + " " + "/name:" + sName + " " + "/dltype:" + sType1
  1326. else
  1327. CmdLine = CmdLine + "/dlid:" + sIDLic + " " + "/title:" + sDocID + " " + "/print:true" + " " + "/name:" + sName + " " + "/dltype:" + thisType
  1328. end if
  1329.  
  1330.  
  1331.  
  1332. ret = MsgBox ("Print Receipt Yes to Print! (Click NO to Abort printing)",4,"DMV PRINT Receipt")
  1333. if ret = 6 then 'JJM 002
  1334. Shell ("C:\DMVPrintEngine\dmvprint.exe /1:IdLic") 'mlp/2/27/14 -for bar code print
  1335. end if
  1336. ' This creates a message box when user is ready to print
  1337. 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")
  1338. if ret <> 6 then stop
  1339.  
  1340. Shell ( CmdLine ) ' Print barcode on application
  1341. ' EMSendKeyFast "<ENTER>" ' Enters after the DL message box
  1342.  
  1343. CurPath = CurDir() ' Get current path.
  1344. ' ChDir "c:\wei\bin"
  1345.  
  1346. ' Shell ( "C:\wei\bin\AKMakeLic.exe" ) ' Coversheet printed - automatically call AKMakeLic.exe
  1347.  
  1348. ChDir CurPath ' Change back to user default.
  1349.  
  1350. EMSendKeyFast "<ENTER>" ' Enters after the DL message box
  1351.  
  1352. FileWrite "C:\NTC32\screen.trc", Space(80) '
  1353. stop
  1354. Exit Sub
  1355.  
  1356. ' ***********************************************************
  1357. Case 2 ' Data(2) = "PVTM000P" Vehicle Menu - VIN Error exceeding 18 chars
  1358. ' ***********************************************************
  1359.  
  1360. Dim sVinErrorMessage As String
  1361.  
  1362. FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' Initialization of PRISMCheck.txt Flag
  1363. Kill "C:\NTC32\DMVPRISMClient\CarrierID.txt"
  1364. Kill "C:\NTC32\DMVPRISMClient\TaxID.txt"
  1365. Kill "C:\NTC32\DMVPRISMClient\AxelCount.txt"
  1366.  
  1367. EMReadScreen ScnLine,21,18,16 ' Reads line 18 and grabs the VIN line
  1368. firstpos = InStr (16, ScnLine) ' gets the first pos
  1369. lastpos = InStr (16, ScnLine, "_" ) ' Looks for an underscore at the end
  1370. if lastpos = " " then ' or a space
  1371. lastpos = InStr (16, ScnLine, " " )
  1372. end if
  1373. lastpos = lastpos - 1 ' gets the # which determines if it exceeds the VIN chars
  1374.  
  1375. if lastpos > 18 then
  1376. ret = MsgBox ("Warning: The VIN has exceeded 18 alphanumeric characters. Proceed?", 1, "ERROR-Vehicle Identification Number")
  1377. if ret <> 1 then stop
  1378. end if
  1379. EMSendKeyFast "<ENTER>"
  1380. Exit Sub
  1381.  
  1382. ' ***********************************************************
  1383. Case 3 ' Data(3) - HC Permit
  1384. ' ***********************************************************
  1385. EMReadScreen sDate,8,2,60 ' Read the date
  1386. EMReadScreen sName,60,5,17 ' Read the name
  1387. sName = LTrim (sName) ' Strip trailing and leading spaces
  1388. sName = RTrim (sName)
  1389. EMReadScreen sPermitKey,6,10,17 ' Read the name
  1390. sKey = Trim (sPermitKey) ' Strip trailing and leading spaces
  1391. EMReadScreen sIDLic,7,12,17 ' DL/ID
  1392. sDocId = "HANDICAP-PERMIT-DocType-30" ' Lead sheet title / description
  1393.  
  1394. ' Contruct the cmdline with appropriate arguments for execution within windows, the name arg has to be last item by code
  1395. ' design and the fact that .net arguments are delimted by spacebands thus the name is concated within the .net routine
  1396.  
  1397. CmdLine = "C:\IDRS\fldcoversheet\IDRSCoversheetFldWrk.exe "
  1398. CmdLine = CmdLine+"/date:"+sDate+" "+"/title:"+sDocID+" "+"/print:true"+" "+"/dlid:"+sIDLic +" "
  1399. CmdLine = CmdLine + "/key:"+sPermitKey +" "+"/name:"+sName
  1400. ' MsgBox CmdLine
  1401. Shell ( CmdLine )
  1402.  
  1403. EMSendKeyFast "<ENTER>" 'Send a ENTER key and quit
  1404. stop
  1405. Exit Sub
  1406.  
  1407. ' ***********************************************************
  1408. Case 4 ' Data(4) - Batch Open
  1409. ' ***********************************************************
  1410. ' When a batch is opened for the first time
  1411. EMReadScreen LocNum,3,8,27 ' Reads the location number
  1412. EMReadScreen BatchDate, 10,10,27 ' Reads the batch date
  1413. EMSendKeyFast "<ENTER>" ' Waits to go to the next screen
  1414. EMWaitCursor 3,4,15
  1415. EMReadScreen BatchNum,4,1,13 'Then captures the batch number
  1416. if IsNumeric(BatchNum) Then ' If numeric write it else fix and then write
  1417. BatchInfo = LocNum + " " + BatchDate + BatchNum ' Concatenates it together as that var
  1418. else
  1419. BatchInfo = LocNum + " " + BatchDate + "8686"
  1420. end if
  1421. FileWrite "C:\NTC32\batchnum.txt", BatchInfo ' Writes to the file
  1422. Stop
  1423. Exit Sub
  1424.  
  1425. ' ***********************************************************
  1426. Case 5 ' Data(5) - Change Batch Status
  1427. ' ***********************************************************
  1428. ' The following code saves the batchnum.txt file when a batch is opened/reopened or inactivated.
  1429. ' The reason behind this is when the user switches stations, the file is saved on the computer and not by the user profile
  1430. ' This screen is different from opening a batch for the first time as shown in Case 4
  1431.  
  1432. EMReadScreen Status, 1,12,26 ' Reads the status
  1433. if Status = "O" Or Status = "I" then ' If the status is open or inactivated
  1434. EMReadScreen LocNum,3,11,26 ' Reads the location number
  1435. EMReadScreen BatchDate, 10,10,26 ' Reads the batch date
  1436. EMReadScreen BatchNum,4,9,26 ' Reads the batch number
  1437. BatchInfo = LocNum + " " + BatchDate + BatchNum ' Concatenates it together as that var
  1438. FileWrite "C:\NTC32\batchnum.txt", BatchInfo ' Writes to the file
  1439. EMSendKeyFast "<ENTER>"
  1440. else
  1441. EMSendKeyFast "<ENTER>"
  1442. end if
  1443. Exit Sub
  1444.  
  1445.  
  1446. ' Cases 6, 7, 8, 9, 10, 11, 12, 13 trapped by if statement for PRISM processing.
  1447.  
  1448. ' Case 14 Vehicle Title screen ... trapped by earlier if statement for PRISM Check.
  1449.  
  1450. ' ***********************************************************
  1451.  
  1452. Case 15 ' Data(15) = "ATPM000P" Temp Permit Menu-VIN Error exceeding 18 chars
  1453.  
  1454. FileWrite "C:\NTC32\DMVPRISMClient\PRISMCheck.txt", "N" ' Initialization of PRISMCheck.txt Flag
  1455. Kill "C:\NTC32\DMVPRISMClient\CarrierID.txt"
  1456. Kill "C:\NTC32\DMVPRISMClient\TaxID.txt"
  1457. Kill "C:\NTC32\DMVPRISMClient\AxelCount.txt"
  1458.  
  1459. EMReadScreen ScnLine,21,19,16 ' Reads line 18 and grabs the VIN line
  1460. firstpos = InStr (16, ScnLine) ' gets the first pos
  1461. lastpos = InStr (16, ScnLine, "_" ) ' Looks for an underscore at the end
  1462. if lastpos = " " then ' or a space
  1463. lastpos = InStr (16, ScnLine, " " )
  1464. end if
  1465. lastpos = lastpos - 1 ' gets the # which determines if it exceeds the VIN chars
  1466.  
  1467. if lastpos > 18 then
  1468. ret = MsgBox ("Warning: The VIN has exceeded 18 alphanumeric characters. Proceed?", 1, "ERROR-Vehicle Identification Number")
  1469. if ret <> 1 then stop
  1470. end if
  1471. EMSendKeyFast "<ENTER>"
  1472. Exit Sub
  1473.  
  1474. ' Case 16 Vehicle Title screen (Temp Permits) ... trapped by earlier if statement for PRISM Check.
  1475.  
  1476. ' Cases 17, 18 trapped by if statement for PRISM processing.
  1477.  
  1478. Case 19 ' Data(19) = "PMSP100P", jia 2/17/2009
  1479. EMReadScreen ScrLine,33,19,8
  1480. if (InStr(1,ScrLine,"INCOMING DIGTAL IMAGE RECORD")) then
  1481. EMReadScreen ScrLine,80,17,3
  1482.  
  1483. dim OLN as string
  1484. firstpos = InStr(1,ScrLine,"OLN/") + 4
  1485. lastpos = InStr(1,ScrLine,".OLS/")
  1486. OLN = Mid$(ScrLine,firstpos,(lastpos-firstpos)) 'third parameter of Mid function is the length
  1487.  
  1488. dim OLS as string
  1489. xpos = InStr(1,ScrLine,"OLS/") +4
  1490. OLS = Mid$(ScrLine,xpos,2)
  1491.  
  1492. CmdLine = "C:\Program Files\State of Alaska\SurrenderedLicense\SurrenderedLicense.exe"
  1493. CmdLine = CmdLine + " " + OLN + " " + OLS
  1494. Shell (CmdLine)
  1495. end if
  1496. EMSendKeyFast "<ENTER>"
  1497. Exit Sub
  1498.  
  1499. ' *******************************************************************************
  1500. Case 20 ' Data(20) - Medical Certificate Cover Sheet - PXXM011N
  1501. ' *******************************************************************************
  1502.  
  1503. EMReadScreen sAction,4,10,37 'check for TYPE at 10,37
  1504. if sAction <> "TYPE" then
  1505. EMSendKeyFast "<ENTER>"
  1506. Exit Sub
  1507. else
  1508. sAction = "APP" ' Make always an Application
  1509. end if
  1510.  
  1511.  
  1512. EMReadScreen sAction,1,10,43 'check for Driver Self Cert Type ? at 10,43
  1513. if sAction = "?" or sAction = "_" then 'i1
  1514. EMSendKeyFast "<ENTER>"
  1515. Exit Sub
  1516. else 'e1
  1517. if sAction = "N" then 'i2
  1518.  
  1519. EMReadScreen sAction,1,11,43 'check for Medical Specialty ? at 11,43
  1520.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Visual Basic.Net Compiler version 0.0.0.5943 (Mono 3.8 - tarball)
Copyright (C) 2004-2010 Rolf Bjarne Kvinge. All rights reserved.

/home/tQ7Lbr/prog.vb (1,5) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (23,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (24,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (25,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (26,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (27,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (28,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (29,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (30,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (31,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (32,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (33,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (34,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (35,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (36,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (37,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (40,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (41,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (42,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (43,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (44,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (45,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (46,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (47,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (48,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (49,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (50,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (51,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (52,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (53,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (54,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (55,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (56,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (57,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (58,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (59,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (60,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (61,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (62,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (63,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (64,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (65,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (66,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (67,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (68,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (69,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (70,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (71,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (72,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (73,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (74,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (75,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (76,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (77,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (78,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (79,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (80,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (82,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (83,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (84,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (85,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (86,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (87,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (88,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (89,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (90,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (91,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (92,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (93,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (94,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (95,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (96,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (97,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (98,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (99,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (100,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (101,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (104,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (105,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (106,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (107,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (108,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (109,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (110,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (111,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (112,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (113,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (114,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (115,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (118,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (121,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (122,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (123,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (124,6) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (128,7) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (129,7) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (130,7) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (131,7) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (132,7) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (133,7) : error VBNC30203: Identifier expected.
/home/tQ7Lbr/prog.vb (134,7) : error VBNC30203: Identifier expected.
vbnc : Command line : error VBNC30041: Too many errors.
stdout
Standard output is empty