Need to run a script x number of times

SKUMAR

Usenet Archive
Joined
Jul 30, 2003
Messages
7
Reaction score
0
Hello,
I have a script that will print the current page then open the next and print and the next, etc. I would like to know if I want to print 10 pages that I can somehow have the script run only 10 times.

Thanks
Sanjiv
 
Have each page in paperspace and use the tabs. print the selection of 10 as many time as u like.

"SKUMAR" <> wrote:

Hello,
I have a script that will print the current page then open the next and print and the next, etc. I would like to know if I want to print 10 pages that I can somehow have the script run only 10 times.

Thanks
Sanjiv
 
Clive, thank you for the response but this script does a little more to the page it opens before printing it. What I want is to "tell" the script to run ONLY x times.

thanks
Sanjiv
 
SKUMAR,
You could write a sub routine that fires at the end of the script and checks a counter. First set up a text file with the character "0". (setq fl (open "c:/txt_cntr.txt" "w")) (write-line "0" fl) (close fl). Then when you write your script add this to the end of the script. (write-line "(load \"c:/counter\")" fl2)       (write-line "(counter)" fl2)
Now the defun:
(defun counter
  (setq fl (open "c:/txt_cntr.txt" "r"))
   (setq cntr (read-line fl))
    (close fl)
     (setq cntr (itoa (1+ (atoi cntr))))       (setq fl (open "c:/txt_cntr.txt" "w"))        (write-line cntr fl)         (close fl)          (if (<= (atoi cntr) 10)(command "rscript"))
 ) ;end defun

Make the call to the subr the last line of the script. Kind of klunky but should work.
Bill
 

Latest threads

Back
Top