Jump to content
Macro Express Forums

Ascii File Request Issue


Biohaz

Recommended Posts

Hey guys, im having a problem with a macro that I am creating and not sure how to fix it.

 

We use a web based program to enter information in for bill paying purposes. The browser does not have a Tax ID # lookup for address purposes and its a tedious effort to enter in the information all the time.

 

Currently I have a macro to enter correct paycodes into the system and according to certain peramaters it will place it in the correct field and tab to the next field and so on. Where this goes wrong is, I need to enter in the information to fill in the payee field and address information every time I have a new vendor. I created a macro to recall the variables and enter them in the appropriate fields if we have a similiar bill to speed up the process. However, what I would like to do is create a text file which can be placed on a shared drive and accessable to anyone paying bills, to where you are able to enter in a correct 9 digit tax id # and have it search the text file (cleanest format possible) and set that information into the correct variables which can then be entered into the correct fields after running a check on certain variables.

 

As it is, when I try and enter the command to pull up the ASCII File Begin Process, the macro halts for a few seconds (30 or so) then continues on with the rest of the macro without entereing in any information into the fields. I tried a text box display with the variables and it just isnt showing anything or even the text box.

 

Please help. I have attached the saved macro file, along with a excerpt of the problem area.

 

<REM2:Payee><IVAR2:80:02:FEnter Tax ID #TFCenter:Center><ADFBEG:F12:001:N00080:000009:C:\My Documents\Attorneys.txt><TBOX4:T:1:CenterCenter000278000200:000:Address%T1%><ADFEND><ACTIVATE2:ACT II - Microsoft Internet Explorer provided by Zurich North America><TEXTTYPE:%T2%<TAB><TAB><TAB>><REM2:Address line 1><TEXTTYPE:%T3%<TAB>><REM2:Address Line 2><TEXTTYPE:%T4%<TAB>><REM2:City><TEXTTYPE:%T5%<TAB>><REM2:State><TEXTTYPE:%T6%<TAB>><REM2:Zip><TEXTTYPE:%T7%<TAB><TAB><TAB>><TEXTTYPE:%T62%<TAB>><TEXTTYPE:%T8%<TAB>
>

 

Note that T2 represents the payee, T3 the first addy line, T4 the 2nd addy, T5 the city, T6 the state, T7 the zipcode, and T62 the amount to be paid and T8 is a letter for accounting purposes.

 

Thanks for looking at this...

 

Dan M

Paycode__New.mex

Link to comment
Share on other sites

when I try and enter the command to pull up the ASCII File Begin Process, the macro halts for a few seconds (30 or so)
How big is the file Attorneys.txt? It must be massive for the macro to pause for 30 seconds. Perhaps the macro priority is set kind of low? I would suggest you download Tweakme3.mxe from www.macros.com/downmore.htm and experiment with a different setting for macro priority.

 

 

You are retrieving the record 9 records beyond the one you entered with a TaxID. you ask for a TaxID and then, because you have set the Number of Records to Process to 9, you loop 9 times in the ASCII File Begin Process: "Attorneys.txt" (ASCII Delimited Text ) command. This will retrieve prompted record + 9.

 

I do not have your file Attorneys.txt but I would guess that a TaxID would be something like 10 digits in length. If you are entering a 10-digit number in the Variable Set Integer %N80% from Prompt command, then you are telling the ASCII File Begin/End Process loop to look at line (record) number 12-34567890. Are there that many records? Are the TaxID numbers in sequence? Do you have records 0000000001 through 1000000000?

 

To see what is going on I suggest you do the following to debug:

 

- Change the Text Box Display command within the ASCII File Begin/End Process to display variables T1 through T10.

- Run the macro and enter a lower number when prompted for the TaxID by line Variable Set Integer %N80% from Prompt. Something like 1 or 8 or, depending on the number of records in the file, 100.

 

You should see that the ASCII File Begin/End Process is processing 9 records beginning with the one you entered when prompted. Depending on your needs, you may decide to change the Number of Records to Process to 1.

Link to comment
Share on other sites

Kevin, thanks for answering.

 

When I look at what you had me do I think my logic in how this ASCII process works is a little flawed.

 

When I enter a TaxID # (think of it as a corporate Social security # so we can make payments to them) I want to be able to search through the Attorneys.txt file and find the appropriate record and then paste the following information into the correct variable string. Each record will contain 9 fields in which information can fit into (I think part of my logic here was wrong) which should go into fields T1-T9. That way I can then paste it into the correct fields in our bill screen.

 

Here is a sample of the attorneys.txt file (and i will attach it also).

"111111111","The Man Inc.","1 N. Rd.","Ste 1","Smallville","C","90605","Y","V"

 

Now as it stands, every record will look like this with the information changed to the appropriate vendor with their info. This is what each box means.

T1- TaxID (what I would like to use as seach peramaters)

T2- Payee

T3- Address L1

T4- Address L2

T5- City

T6- State (use codes which simulate key presses on a pulldown menu in our screen)

T7- Zip

T8- Y or N for accounting info

T9- If statement which checks if T8 is Y, then you have the option of A,B,C,or V, again for accounting info.

 

The rest of the macro variables will be set elsewhere in the macro, so these are only used by this portion.

Attorneys.txt

Link to comment
Share on other sites

I suggest you try something like this:

Variable Set String %T99% ""
Variable Set String %T80% from Prompt
ASCII File Begin Process: "attorney.txt" (Comma Delimited Text )
 If Variable %T1% = "%T80%"
   Variable Set String %T99% "FOUND"
   Break
 End If
ASCII File End Process

If Variable %T99% <> "FOUND"
 Text Box Display: TaxID Not Found
 Macro Stop
End If

// Here T1 through T9 should contain the information you want

Inside the ASCII File Begin Process command the 'Start Processing Record' is set to 1 and 'Process all Records' is checked.

Link to comment
Share on other sites

Ok its official, Kevin, you are the King!

 

That worked perfectly. It searches all the tax id's and I can even replace the stop macro command with the command to input the information by hand if the id isnt in the text file.

 

This macro will save hours of time paying our bills, thanks :D

 

Dan M.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...