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
 Active sheet column access by name

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
AKazak Posted - 09/02/2020 : 2:02:34 PM
OriginPro 2021 (64-bit) Beta 4 9.8.0.138
Windows 7 Pro x64 SP1

Greetings!

https://www.originlab.com/doc/LabTalk/ref/Wks-Col-obj suggests:

// Set col(1)'s short name in active sheet as "Time"
wks.col1.name$ = Time;


But this code doesn't work for me.
Can I change the column's short name?
How do I access to column by its short name instead of its serial number, for example wks.col1. or col(1)?


Thank you.

---
Andrey
9   L A T E S T    R E P L I E S    (Newest First)
AKazak Posted - 09/03/2020 : 12:16:40 PM
Nikolay, CP

Got it.
Thank you.

---
Andrey
cpyang Posted - 09/03/2020 : 11:57:54 AM
variables are local and automatically deleted on existing a scope.
Typically we put codes into ogs sections which is a type of a scope.

See

https://d2mvzyuse3lwjc.cloudfront.net/doc/LabTalk/guide/Data-Types-and-vars#Scope_of_Variables

CP
nick_n Posted - 09/03/2020 : 11:12:29 AM
or -rar

Nikolay
nick_n Posted - 09/03/2020 : 11:09:36 AM
Seems, right way is:
del -ra rr;

Nikolay
nick_n Posted - 09/03/2020 : 11:00:04 AM
Hi,

What for you would like to clear range var? I've never done that.
Try:
range rr=%();
Not sure if it is legal :))
Best,

Nikolay
AKazak Posted - 09/03/2020 : 09:41:26 AM
quote:
Originally posted by nick_n

Hi,

range rr = A;
rr.lname$=;


Nikolay



OK, got it.
How do I clear memory of a range variable after using it?

---
Andrey
nick_n Posted - 09/03/2020 : 07:54:43 AM
Hi,

range rr = A;
rr.lname$=;


Nikolay
AKazak Posted - 09/03/2020 : 05:39:41 AM
quote:
Originally posted by cpyang

You have to turn off SCN (Spreadsheet Cell Notation), so

page.xlcolname=0;
wks.col1.name$=Time;


Once you turn SCN off, you won't be able to use such notation in formula, so better just use long name?

wks.col1.lname$=Time;


CP




Got it!

I will continue working in SCN-on mode.
How do I access to column by its short name instead of its serial number, for example wks.col1. or col(1)?
Can I call something like wks.col(A) or wks.col("A")?

Thank you.

---
Andrey
cpyang Posted - 09/02/2020 : 4:06:31 PM
You have to turn off SCN (Spreadsheet Cell Notation), so

page.xlcolname=0;
wks.col1.name$=Time;


Once you turn SCN off, you won't be able to use such notation in formula, so better just use long name?

wks.col1.lname$=Time;



CP

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