Repeat

Kenneth Brody kenbrody at spamcop.net
Fri Mar 4 10:56:48 PST 2011


On 3/4/2011 1:42 PM, Richard Kreiss wrote:
>
>> What keystroke(s) would you expect to be pushed, given the following:
>>
>>     aa = "[CDWN]"
>>     qq = "aa"
>>     pushkey qq
>
> In this case qq would be equal to the literal aa and not [CDWN], so none would be passed.

Nothing at all?  Are you sure?

>> No fair cheating by actually trying it.  Given your understanding of how filePro
>> works, what keystroke(s) would you expect to be pushed?
>>
>>> I have tested qq="CDWN"
>>
>> You need the brackets, unless you want to push the four keystrokes "C", "D",
>> "W", and "N".
>>
>>> I have not been able to get this to work.
>
> Doesn't work in all cases means that when the browse re-executes, the cursor in on the first record.
>
> Now, pushkey may be executing but be passing the wrong information as to how many times to move down.
>
>
>> DDW
>
> No cursor movement down

Well, the snippet below will push keystrokes.  What happens once they're 
pushed, we can only guess, as you don't show any other code.

[...]
> OK, reread the manual on repeat
>
> The following code does work
>
> 63  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If: br gt "1"
>         Then: zz=repeat("[CDWN]","6"*br)

Okay.  Assuming br contains the number of down-arrow keystrokes you want, 
this will fill zz with the correct string.  (Assuming zz is large enough to 
hold the value, and won't be padded with spaces.)

>   64  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>         ◄ If: br gt "1"
>         Then: pushkey "\""{zz{"\""

Why, why, why, why, why?  Why do you insist on adding those extra quotes?

> One odd thing, on some selections zz ends with [CDWN put pushkey still works.

I thought it didn't work at all?

> So, repeat looks at each letter or character rather then consider what is between the quotes as a unit.

Correct.  Repeat takes the number of characters you want to end up with, 
repeating the input value as needed, and not a count of the number of times 
you want to input value repeated.

[...]
> No syntax error.  However when zz if checked in the debugger, zz=[CDW  and blank out to the right.			

No syntax error where?

How is zz defined?  And how, exactly, was zz assigned a value when it ends 
up with "[CDW"?  (My guess is that you passed "4" to REPEAT.)

[...]

-- 
Kenneth Brody


More information about the Filepro-list mailing list