MrBiggz Posted August 2, 2012 Report Share Posted August 2, 2012 I need to create a Macro that prompts for an office number, and when the office number is given, it checks against a CSV file to see if that office is listed. If listed it returns a message on the screen of "VERIFIED" and if not's found in the file, returns a separate message of "UNVERIFIED". The problem I'm having is it checks against the file, but it returns both VERIFIED and UNVERIFIED messages even the office numbers are listed. Here's a copy of the code. <CLEARVAR1:T:ALL><TVAR2:01:02:FEnter 5 Digit Branch NumberFFCenter:Center><BTFBEG:002:000001:000000:C:\Test.csv><IFVAR2:4:02:1:T1><TBOX4:T:4:CenterCenter000278000200:000:DIAVERIFIED><ENDIF><IFVAR2:4:02:8:T1><TBOX4:T:4:CenterCenter000278000200:000:NO DIAUNVERIFIED><ENDIF><BTFEND> Quote Link to comment Share on other sites More sharing options...
Samrae Posted August 2, 2012 Report Share Posted August 2, 2012 This might work better Clear Text Variables: All Variable Set String %T1% from Prompt Text File Begin Process: "Test.csv" If Variable %T2% = variable %T1% Text Box Display: DIA Else Text Box Display: NO DIA End If Text File End Process Quote Link to comment Share on other sites More sharing options...
MrBiggz Posted August 3, 2012 Author Report Share Posted August 3, 2012 Thanks. It kinda worked. So the CSV file has in the first column about 300 cells filled with information. I just need to do a check against that CSV file to see if the data entered from prompt (%T1%) is anywhere in that column. And if so display "Verified" and if not, display "NOT Verified". Unfortunately it's only reading the last cell that has data and putting that into variable %T2%. I'm not sure if I'm doing this correctly at all, I'm just kind of playing around to see if it is actually possible. Thanks for the help!! Quote Link to comment Share on other sites More sharing options...
Samrae Posted August 6, 2012 Report Share Posted August 6, 2012 So, maybe something like this? Clear Text Variables: All Variable Set String %T1% from Prompt Text File Begin Process: "Test.csv" If Variable %T2% Contains %T1% Text Box Display: DIA Else Text Box Display: NO DIA End If Text File End Process Quote Link to comment Share on other sites More sharing options...
MrBiggz Posted August 6, 2012 Author Report Share Posted August 6, 2012 I GOT IT!! So here's the final code that got it to work! Clear Text Variables: All Variable Set String %T1% from Prompt Text File Begin Process: "Test.csv" If Variable %T2% Contains %T1% Break End If Text File End Process If Variable %T1% = variable %T2% Text Box Display: DIA End If If Variable %T2 does not contain variable %T1% Text Box Display: NO DIA End If Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.