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
 Forum for Origin C
 Extract Header Names

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
ThomasR Posted - 12/16/2013 : 06:32:18 AM
How can I get the column names out off a table in Origin?

Let's say my sheet looks like:


   Current     Voltage   ... 
   [mA]        [mV]
   1000        300
   1200        310
   ...


How can I get all the first row entries?

With this:

   DataRange dr;
	dr.Add("X", wks, 0, 0, 0, -1);

I only get the data starting in line 3 (the actual content, 1000 and so on).
But I need to access "Current, Voltage, ...".
Any hints would be great.
1   L A T E S T    R E P L I E S    (Newest First)
Castiel Posted - 12/16/2013 : 08:19:20 AM

int getLabel()
{
	Worksheet wks = Project.ActiveLayer();
	if( !wks )
		return -1;
	
	Column colA(wks, 0);
	if( !colA )
		return -2;
	
	string strShortName, strLongName, strUnits, strComments;
	colA.GetName(strShortName);
	strLongName = colA.GetLongName();
	strUnits = colA.GetUnits();
	strComments = colA.GetComments();
	printf("Name: %s\nLong Name: %s\nUnits: %s\nComments: %s\n", 			strShortName, strLongName, strUnits, strComments);
			
	return 0;
/*
Name: A
Long Name: Current
Units: [mA]
Comments: some comments
*/
}

Column::GetExtendedLabel or Grid::GetUserDefinedLabelNames for more information.

©c¡Ï   ¤È¥¹  ©f¨u©c  ©c¥ì    ¥Î¤³  ©c/     ©¦£¯
 ©c¨Ê¥Î ¤´¥¨  ¥ó ¨×   ¥ó¤á' ¥Ì©¦¥­   /¤í  ¥Õ©¦©f
   ¨Ö             ¦á          ©¦£þ  ©` ¥Õ   ©¦
                              ©¦

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