Repeat

Richard Kreiss rkreiss at verizon.net
Fri Mar 4 11:07:00 PST 2011



> -----Original Message-----
> From: filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com
> [mailto:filepro-list-bounces+rkreiss=verizon.net at lists.celestial.com] On
> Behalf Of Kenneth Brody
> Sent: Friday, March 04, 2011 1:57 PM
> To: rkreiss at gccconsulting.net
> Cc: filepro-list at lists.celestial.com
> Subject: Re: Repeat
> 
> 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.)

Zz=[CDWN][CDWN]CDWN][CDWN

And yes, 4 was passed in this case.  I am not quite sure how to account for all possibilities.

[CDWN] contains 6 characters which needs to be repeated 4 times.  Apparently even with the missing closing bracket pushkey works.

Richard

PS: will test with adding the additional quotes.


 
> [...]
> 
> --
> Kenneth Brody
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> Subscribe/Unsubscribe/Subscription Changes
> http://mailman.celestial.com/mailman/listinfo/filepro-list




More information about the Filepro-list mailing list