Topic: Repeat(n) - Can it be internally effected? (1 of 6), Read 15 times
Conf: VEDIT Macro Language Support
From: John H
Date: Thursday, May 13, 2004 08:12 PM

Would the following work to extend the repeat count so it would
execute more than 10 times?

#109=10

Repeat(#109) {
if(..) {
[..]
} else {
[..]
#109++
}
}

I'm using the #109 after this repeat loop and repeat appears to be
the best suited for what I am trying to do, unless of course in-loop
changes to #109 have no effect... :-)

--
John
VEDIT SN: 95651
VEDIT (DOS) Ver. 6.12.1 05/07/04
VEDIT (32-Bit) Ver. 6.12.1 05/07/04
VEDIT Pro (64-Bit) Beta Test Ver. 6.12.1 05/07/04
Windows 2000 (5.0.2195 Service Pack 4)

 


Topic: Re: Repeat(n) - Can it be internally effected? (2 of 6), Read 12 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Thursday, May 13, 2004 09:11 PM

At 08:13 PM 5/13/2004, you wrote:
>Would the following work to extend the repeat count so it would
>execute more than 10 times?
>
>#109=10
>
>Repeat(#109) {
> if(..) {
> [..]
> } else {
> [..]
> #109++
> }
>}

No, the Repeat() expression is executed only once. You might want to use a For() or While() loop, which re-tests its criteria each time through the loop.

Ted.

 


Topic: Repeat(n) - Can it be internally effected? (3 of 6), Read 10 times
Conf: VEDIT Macro Language Support
From: John H
Date: Thursday, May 13, 2004 10:06 PM

On Thu, 13 May 2004 21:12:31 -0400 GMT, Ted Green wrote:

> No, the Repeat() expression is executed only once. You might
> want to use a For() or While() loop, which re-tests its criteria
> each time through the loop.

Sorry about that, I had only looked in the online help. It's quite
clear in the PDF file.

--
John

 


Topic: Re: Repeat(n) - Can it be internally effected? (6 of 6), Read 13 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Tuesday, May 18, 2004 11:24 PM

At 10:06 PM 5/13/2004, you wrote:

>Sorry about that, I had only looked in the online help. It's quite
>clear in the PDF file.

Sorry for the terse on-line help for the flow control statements; I shouldn't assume everyone is familiar with C.

I added a little more explanation to the on-line help for repeat():

repeat (n) {
commands
}

Repeatedly execute 'commands' for a total of 'n' times. If 'n' is zero (or negative), 'commands' are not executed at all. The expression 'n' is evaluated only once.

repeat (ALL) {
commands
}

A repeat count of "ALL" makes a Repeat loop continuously ("forever") until a "break-out" condition occurs.

Ted.

 


Topic: Repeat(n) - Can it be internally effected? (4 of 6), Read 12 times
Conf: VEDIT Macro Language Support
From: Ian Binnie
Date: Thursday, May 13, 2004 10:08 PM

On 5/13/2004 8:12:42 PM, John H wrote:
>Would the following work to
>extend the repeat count

>Repeat(#109) {

> #109++
> }

These are basic programming techniques, not specific to Vedit.
Even if it worked, it would be poor programming practice, and is likely to lead to programs which are unreliable.

I do not know your programming background, but a good book or tutorial on C programming may help.

Vedit documentation assumes a certain background knowledge of programming technique.

 


Topic: Repeat(n) - Can it be internally effected? (5 of 6), Read 11 times
Conf: VEDIT Macro Language Support
From: John H
Date: Friday, May 14, 2004 06:07 AM

On Thu, 13 May 2004 22:08:56 -0400 GMT, Ian Binnie wrote:

>>Would the following work to
>>extend the repeat count

>>Repeat(#109) {

>> #109++
>> }

> These are basic programming techniques, not specific to Vedit.
> Even if it worked, it would be poor programming practice, and
> is likely to lead to programs which are unreliable.

I've bought some of those programs. ;-) Of course if the function
isn't designed to operate as above then it would be poor practice,
akin to taking advantage of an exploit or bug/feature.

> I do not know your programming background, but a good book or
> tutorial on C programming may help.

It's been a number of years since I wrote anything in C. And even
longer since I've done any vocational programming. Realistically I
guess C is sort of the Latin of modern programming languages. I
probably would be better off to have stuck with it. Then again,
programming is not my job.

> Vedit documentation assumes a certain background knowledge of
> programming technique.

Rightly so, and quite apparent in some parts of the manual. My
technique is to sit down a type.

--
John