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
 Display Column Labels and loop

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
cougar2 Posted - 02/19/2004 : 09:44:30 AM
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

3   L A T E S T    R E P L I E S    (Newest First)
cougar2 Posted - 02/20/2004 : 10:55:29 AM
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.

cougar2 Posted - 02/20/2004 : 04:45:35 AM
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?

Mike Buess Posted - 02/19/2004 : 12:25:38 PM
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

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