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
 Display Column Labels and loop
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cougar2

Germany
Posts

Posted - 02/19/2004 :  09:44:30 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi everybody,

I need some help on the following questions:

(i) How can you make Origin to display column labels automatically using Labtalk (as Origin asks you when you enter a new label)?
I am creating a new worksheet and label it like this:

create.wksName$ = "s1orig";create.wks(A B C D E F G H);
s1orig!wks.col1.type=4;
s1orig!wks.col1.label$="B-Field";
tt=0;for (ii=2;ii<=6;ii++){s1orig!wks.col$(ii).label$=$(tt);tt=$(tt)+36;};

(ii) In the same script I am using the following to normalize my worksheet columns. It works fine for the first 2 columns then it produces one empty column and then goes on with the next 2. The first column is not altered (intentionally) so the loop starts at 2. The original worksheet columns do exist (s1orig etc). What´s wrong?

loop (var,2,6) {%v=s1!wks.col$(var).name$;s1_%v=(s1orig_%v-s1orig_%v[23])/(s1orig_%v[1]-s1orig_%v[23])};
loop (var,2,6) {%v=s2!wks.col$(var).name$;s2_%v=(s2orig_%v-s2orig_%v[23])/(s2orig_%v[1]-s2orig_%v[23])};

Thanks for any help

Cougar

Mike Buess

USA
3037 Posts

Posted - 02/19/2004 :  12:25:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Cougar,

(i) Once you've defined at least one column label you can use wks.labels()...

create.wksName$ = "s1orig";create.wks(A B C D E F G H);
s1orig!wks.col1.type=4;
s1orig!wks.col1.label$="B-Field";
s1orig!wks.labels();
tt=0;for (ii=2;ii<=6;ii++){s1orig!wks.col$(ii).label$=$(tt);tt=$(tt)+36;};

(ii) I don't see any obvious mistakes, but why don't you do everything inside one loop?

Mike Buess
Origin WebRing Member
Go to Top of Page

cougar2

Germany
Posts

Posted - 02/20/2004 :  04:45:35 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Mike,

(i) works well, thank you.

(ii) You´re right, I can do it in one loop, but the problem seems to be when creating the first worksheets. In "s1orig" there is no D column being created, but I can´t see why. When I use the command
create.wks(A B C D D E F G H I J K L);
the worksheet contains one "D1" column so actually there must have been a first "D" column, right?

Go to Top of Page

cougar2

Germany
Posts

Posted - 02/20/2004 :  10:55:29 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,

I got the mistake myself, the problem was not in the script I presented but in some other part which wasn´t displayed here. There column was deleted erroneously.

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