| T O P I C R E V I E W |
| rmtruji |
Posted - 01/15/2004 : 7:07:28 PM My code currently outputs my 48 lines of header to the script window using %Z=;
I want to open a blank worksheet and capture those 48 lines of header in it. I try this with the following code, but it doesn't work. Does anyone know how to redirect the output from the script window to a worksheet??
Code: /////////////////////////////////////////////////////
%F=FileA FileB FileC; loop(ii,1,3) {
win -t data LWIS_Navstrike_DataWks_Template; //create new worksheet for the next data file
open -w %[%F,#ii].hta;//open into wks
%W=%H; //store the name of the wks create H%W -w 50 Parameter Data; // This is my new worksheet where I want to put the 48 lines of header.
wks.col1.width=40; wks.col2.width=40; wks.col1.format = 2; file.rewind(); Z=; //Store header in %Z
if(rmod(ii,3)==1){ win -t plot "3-plot.otp"; %L=%H;} else win -a %L; switch(ii){ case 1 4 7 10: page.active=3; layer -i %(%W,2); layer -a; break; case 2 5 8 11: page.active=2; layer -i %(%W,2); layer -a; break; case 3 6 9 12: page.active=1; layer -i %(%W,2); layer -a; break;
}
} |
| 1 L A T E S T R E P L I E S (Newest First) |
| Mike Buess |
Posted - 01/15/2004 : 10:10:49 PM Presumably you've placed the header in %Z by setting up your ASCII options properly. I don't understand what file.rewind() is doing, but that's beside the point. It's also not clear what you mean by redirecting %Z to the worksheet. You can put it in a text label with
label -s %Z;
But I think you want to split %Z up and place its substrings in separate worksheet cells. You can do that with substring notation such as
%L=%[%Z, @n]; // nth line of %Z %A=%[%L,#m]; // mth token of %L
Then assign the substrings to worksheet cells (make sure columns are Text or Text&Numeric)...
cell(i,j)$=%A;
Depending on the structure of your header there might be easier ways to do this. Certainly if you're using Origin 7 or later it would be better to use Origin C.
Mike Buess Origin WebRing Member
Edited by - Mike Buess on 01/15/2004 10:11:59 PM |
|
|