| T O P I C    R E V I E W | 
               
              
                | Schippi | 
                Posted - 12/17/2015 : 04:39:50 AM  Origin Ver. and Service Release (Select Help-->About Origin): 9.0 Operating System: Windows 7
  Hello everyone, this is my problem: I have got a workbook with about 20 worksheets which I have to integrate and then to form the average value. The program I have got works but it records everything in 1 workbook and within this workbook in 1 worksheet. How can it be managed to get several worksheets.
  Lots of thanks in advance! 
  // BEGIN SCRIPT // PROMPT for X range and calculation method ix1 = 1.0;				 ix2 = 2322.0;				 choice$ = Math Absolute;		 ichoice = 1;				 getn (From) ix1 (To) ix2 (Method) ichoice:choice$ (Integrate all plots);  // Setup ichoice--; 				 newbook name:=Results;		 layer.name$ = Areas;		 range raData = 1;			 range raArea = 2;			 count = 0;	 //range raAverage = 3;			 cnt =0; average= 0; // Loop over all graphs then all plots in each graph doc -e P				 { doc -e DY				 { count++;				 range -w raC = %C;			 xi1 = xindex(ix1,%C); xi2 = xindex1(ix2,%C); integ1 iy:=raC[xi1:xi2] baseline:=0 type:=$(ichoice) area:=myarea;  raData[count]$ = %C[x$(ix1):$(ix2)];	 raArea[count] = myarea;				 cnt = cnt +myarea ; //raAverage [count] = cnt;	 } } average= cnt / count; raData[count + 1]$ = Mittelwert;	 raArea[count + 1] = average;	
  | 
               
              
                | 1   L A T E S T    R E P L I E S    (Newest First) | 
               
              
                | SeanMao | 
                Posted - 12/19/2015 : 03:59:29 AM  Hi,
  If you want to output the integration results in different new sheets in a new book, you can run the following:
  newbook myresults;
  ... integ1 iy:=raC[xi1:xi2] baseline:=0 type:=$(ichoice) area:=myarea oy:=["myresults"]<new>!(<new>,<new>); ...
  Give it a try and see how it goes.
  Regards!
  Sean
  OriginLab Tech. | 
               
             
           | 
         
       
       
     |