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
 Column long and short names
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

kfauth

Germany
33 Posts

Posted - 06/28/2016 :  03:44:26 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): Pro 2015G Sr2
Operating System: Win7Pro

Hello again,

I run into the problem of needing column names longer than the allowed 13 characters to be descriptive (not so much to the user but to other scripts which try to find a column based on a number of parameters).

I understand that the long names may serve this purpose. Since these would need to be recognized from script, it would be necessary to retrieve the column short name from the long name. Is there a function serving this purpose?

In general, the script looking for that column cannot know aforehand whether the desired column exists, is it possible to check the existence of a column by its long name?

Thanks for any help.

Hideo Fujii

USA
1582 Posts

Posted - 06/28/2016 :  12:11:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi kfauth,

You can access the short name or the column number via the universal identifier (UID). See the following sample:
(Suppose "cc" is the long name of the third column, C)
int nColUID = range2uid(col("cc")); 
range cuid = uid2range(nColUID)$;
string cname$=uid2Name(nColUID)$; 
cuid.name$=; //short name
cuid.LNAME$=; //long name
cuid.INDEX=; //column index
cname$=;
exist(cname$)=;  //test of the dataset

> C
> cc
> cuid.INDEX=3
> Book1_C
> exist(cname$)=1 //1: existing dataset

Keep in mind that the long name doesn't have to be unique in the worksheet.

Hope this answers to your question.

--Hideo Fujii
OriginLab

Edited by - Hideo Fujii on 06/28/2016 12:13:26 PM
Go to Top of Page

kfauth

Germany
33 Posts

Posted - 06/29/2016 :  5:07:59 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Dear Hideo Fujii,

thank you for this useful answer. Of course, uniqueness of long names would reside in the responsability of the coder/user.

I do have the same question in the context of OriginC. Should I open a separate post in that forum for this purpose?

Thanks again
Kai
Go to Top of Page

Hideo Fujii

USA
1582 Posts

Posted - 06/30/2016 :  09:31:27 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Kai,

> Should I open a separate post in that forum for this purpose?

Yes, please.

--Hideo
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