Jump to content
Macro Express Forums

Loops, I need to learn them - Question


Tropic

Recommended Posts

:blink:

Hi,

 

I'd like a simple Loop

 

Repeat until T2 = ""

Repeat Start @ 10 times

Copy Screen position @ 822 T1 to T2

Variable Modify String Trim T2

Repeat End

Repeat End

 

Basically here is the end result I have a application:

 

I'd like to copy starting position 822 value, however I'd like it to copy 72 Characters only

Then jump to the next line with is not 822 away but 2 Values away and copy 72 Characters and Continue until there is no data left and it shows "".

 

If I'm confusing you let me know.. i'm watching this thread like a hawk and any input is appreciated.

Link to comment
Share on other sites

I'm new to this forum but not macro express. Is this for a spreadsheet or word document or what?

 

You want the macro to go to 822 value or you going to start it on 822?

 

Thanks

 

Hi Evilfrog,

 

I'd like to have it start out at 822 position, its on an application.

 

So start @ 822, but then continue 2 characters then copy 78 characters and follow that till i get null values.

Link to comment
Share on other sites

You could do something like this. There are many different ways to create loops.

 

This is assuming you are start the macro on line 822

 

 

Repeat Start (99999)

Clear Variable %T1%

Shift down

Repeat Start (78)

Right arrow

end repeat

Shift up

delay 150

altec --- (or some kind of copy command)

delay 150

variable set string %T1% from clipboard

delay 150

If variable %T1% = ""

macro stop

end if

Repeat Start (2)

Arrow down

end repeat

end repeat

 

 

 

This is a loop that will copy the first 78 char of for line you are on and check if it is blank, if it is then the macro will stop. If the variable is not blank it will go down 2 lines and do the same. 99999 times.

 

 

Thanks

Link to comment
Share on other sites

I'm completely lost as to the aim of the macro. "Then jump to the next line with is not 822 away but 2 Values away" escapes me as well as what "822 value" is. 822 lines down? across? 822nd character? What is being done with the 72 characters copied each time? Copied to the same variable? What is the point of that if so? If xxevilfrogxx has cracked it, well done!

 

A few comments:

 

If you want to make an endless loop (which normally you would exit with some If condition) you can use things like:

Repeat Until T99<>T99

Repeat Until T99 = Never (T99 is not set in the macro so is always blank "")

 

I was not sure what this does:

Shift down

Repeat Start (78)

Right arrow

end repeat

Shift up

Shift across a repeat seems unusual. What does the shift do?

 

If you want to copy 72 characters you can use Variable Modify String and copy 72 characters to a new variable

Link to comment
Share on other sites

HI,

 

Not sure exactly Tropic is doing either, but I thought I throw out example of a loopy macro.

 

 

In most programs if you hold Shift down and hit the right arrow on characters you will select them. So if Tropic is needing to save the first 78 or 72, that is one way to do it.

 

Select the characters, copy, then save them to a variable.

 

 

Try it in your web browser do this...

 

alt + d -- to highlight your address bar.

home -- to put your cursor in the front of the address

 

Then hold down shift and hit the right arrow. If should start selecting characters.

 

You can select the entire line and use modify command like you said. Probably could ways to do it. Depending on what Topic is actually doing <_<

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...