Topic: create a column of incrementing numbers (1 of 3), Read 35 times
Conf: VEDIT Macro Language Support
From: Tim Landry
Date: Tuesday, December 03, 2002 04:05 PM

I need help with what probably has a simple solution.
I want to create a column of numbers that have a defined starting point and ending point. I am using
get_input(9,"ENTER BEGINNING RECORD NUMBER ",STATLINE + NOCR)
get_input(10,"ENTER ENDING RECORD NUMBER ",STATLINE + NOCR)
to get the number range, but I can't figure out the loop.
Any suggestions?

 


Topic: Re: create a column of incrementing numbers (2 of 3), Read 38 times
Conf: VEDIT Macro Language Support
From: Ted Green
Date: Tuesday, December 03, 2002 04:13 PM

At 04:05 PM 12/3/2002, you wrote:
>I need help with what probably has a simple solution.
>I want to create a column of numbers that have a defined starting point and ending point.

The supplied key-mac.lib file has a "Renumber" macro which adds line numbers. That should help you understand how to create the loop.

Ted.

 


Topic: Re: create a column of incrementing numbers (3 of 3), Read 41 times
Conf: VEDIT Macro Language Support
From: Fritz Heberlein
Date: Tuesday, December 03, 2002 05:15 PM

The core of the macro could be something like this:

#12=get_num("ENTER BEGINNING RECORD NUMBER: ")
#13=get_num("ENTER ENDING RECORD NUMBER: ")
for (#14=#12;#14<=#13;#14++) {
BOL()
num_ins(#14)
}

If you use it often or if somebody else has to use it, some polishing, e.g.
prompting for the values by means of a DI1 box would be helpful.

Fritz