The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Redirect output from script window to wks

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

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

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000