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

ThomasR

Germany
6 Posts

Posted - 12/16/2013 :  06:32:18 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
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.

Castiel

343 Posts

Posted - 12/16/2013 :  08:19:20 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply

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.

妾+   午旦  妹罕妾  妾伊    用仇  妾/     岫ㄞ
 妾京用 仍巨  件 侈   件戶' 甘岫平   /欠  白岫妹
   併             艮          岫  奈 白   岫
                              岫
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