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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Redirect output from script window to wks
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

rmtruji

USA
10 Posts

Posted - 01/15/2004 :  7:07:28 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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;

}

}

Mike Buess

USA
3037 Posts

Posted - 01/15/2004 :  10:10:49 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
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
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000