lace6921 Posted May 14, 2008 Report Share Posted May 14, 2008 I am trying to create what I think is a simple macro I want it to compare the information I have in a text file to the information from an application. Basically If ‘A’ does not ‘A’ Log the information into a txt file (basically an error report) and then move onto the next value in the text file. I am completely lost with the if then statements. This is just a portion of the macro I am using!!! Let me know if you need more information, of course this blog thing is new to me also. Please help! Thanks Leslie Quote Link to comment Share on other sites More sharing options...
jason Posted May 15, 2008 Report Share Posted May 15, 2008 I would try something like this: ASCII File Begin Process: "TestFile" (Comma Delimited Text ) If Variable %T1% = "A" Variable Set String %T99% "%T2% %T3% %T4%" Clipboard Append Text: "LogFile,txt" End If If Variable %T1% <> "A" Variable Set String %T99% "%T2% %T3% %T4%" Clipboard Append Text: "ErrorLog,txt" End If ASCII File End Process I have also attached a copy of the macro for you to look at. Also, I have set the macro to bypass file existence checking for these files as they are just examples. I would recommend using this unchecking this option when using these commands in your macro. Log_File_Not_Equal.mex Quote Link to comment Share on other sites More sharing options...
lace6921 Posted May 15, 2008 Author Report Share Posted May 15, 2008 Jason, I really appreciate your response. I have one more issue though Now my issue is the ‘A’, which is variable from a screen from a system. How do I capture the variable and then compare it to the %T1% and use the If / Then Statement? I have a Get Control %C1% and want to compare that to the %T1% use the If / Then Statement. ASCII File Begin Process: "TestFile" (Comma Delimited Text ) If Variable %T1% = "A" Variable Set String %T99% "%T2% %T3% %T4%" Clipboard Append Text: "LogFile,txt" End If If Variable %T1% <> "A" Variable Set String %T99% "%T2% %T3% %T4%" Clipboard Append Text: "ErrorLog,txt" End If ASCII File End Process Thank you so much. Leslie Quote Link to comment Share on other sites More sharing options...
jason Posted May 16, 2008 Report Share Posted May 16, 2008 You can use the Variable Get Control Text found under the Window Controls commands. Using this command will allow you to copy the contents of %C1% to %T1%. This will then allow you to run the comparison. 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.