Passing Parameters to a Run Program>

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Me_again

Passing Parameters to a Run Program>

Post by Me_again » Tue Jan 04, 2005 4:43 pm

I have a macro that steps vertically down a line of pixels to find the lower edge "Y" of a varying height feature that I want to capture off a webpage. That part works fine. Then I need to calculate the height of the capture area and pass it to my capture program.

Let>H=Y-241
Run Program>C:\captureprog.exe x:3 y:240 w:600 h:%H%

By putting a message line after the Let> I can see it works OK, but unless I put a Wait> between the Let and the Run Program> I seem to get random values in the %H%. With a Wait>2 it works prefectly.

Am I passing the parameter incorrectly? Or should I just be happy it works with the Wait> in there?

User avatar
Captive
Macro Veteran
Posts: 213
Joined: Sun Oct 20, 2002 8:37 pm
Location: Colorado, USA

Re: Passing Parameters to a Run Program>

Post by Captive » Tue Jan 04, 2005 7:55 pm

What you have should work.

You could try:
Let>H=%Y%-241

How large is the "wait" you use when it works? You can use more than an integer:
Wait>0.5
(etc)

If you *seem* to get random values with H, perhaps it's because you're getting values of Y that you're not expecting?

Me_again

Re: Passing Parameters to a Run Program>

Post by Me_again » Tue Jan 04, 2005 8:47 pm

Captive wrote:What you have should work.

How large is the "wait" you use when it works? You can use more than an integer:
Wait>0.5
Wait>2 works every time. I didn't know I could Wait> less than 1, I'll try some shorter times tonight and see what happens.
If you *seem* to get random values with H, perhaps it's because you're getting values of Y that you're not expecting?
If I substitute a message displaying Y and H it always shows correct numbers. The page I'm loading (NWS Forecast) only changes twice a day so it's not like trying to hit a moving target in a game. I'm using the IE.busy code from this http://www.mjtnet.com/usergroup/viewtopic.php?t=1305 thread so I know the page is fully loaded.

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts