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
 Origin Forum
 String values in cell
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

ermano

France
3 Posts

Posted - 05/22/2003 :  5:22:08 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Could anybody tell me how I could read/access an individual cell of a text column (each cell containing string values) from/into Origin C ?

Thank you

rlewis

Canada
253 Posts

Posted - 05/22/2003 :  6:42:09 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
The following function is a listing of a function in which the text of an origin Worksheet cell is accessed ... Hope this helps..

void HartStringToDouble(String WorkSheetName, int ColNumber, int NumChars)
{
/*
Removes a User-Defined number of Characters from the beginning of strings
Stored in an Origin Worksheet Text Column. The column is assumed to the
"Text" or "Text & Numeric"
*/
Dataset MyWksColumn;
int SizeOfColumn, i, StringLength;
String MyBuffer;
if(MyWksColumn.Attach(WorkSheetName,(ColNumber-1)))
{
SizeOfColumn=MyWksColumn.GetSize();
for (i=0;i<SizeOfColumn;i++)
{
if(MyWksColumn.GetText(i,MyBuffer))
{
MyBuffer.Delete(0,NumChars);
MyWksColumn.SetText(i,MyBuffer);
}
}

}
}
Go to Top of Page

hajo_old

Germany
141 Posts

Posted - 05/23/2003 :  02:58:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hello, ermano

try out the function TCell()

Worksheet::TCell
Prototype: PUBLIC string TCell(int nRow, int nCol)

Worksheet::SetCell
Prototype: PUBLIC BOOL SetCell(int nRow, int nCol, LPCSTR lpcszText)

This should work with string values within worksheets
(more details - see programming help)

Cio
Hajo

-- --
Dipl.-Ing. Hans-Joerg Koch
Siemens VDO, Regensburg

SVDO_Origin1
Go to Top of Page

ermano

France
3 Posts

Posted - 05/23/2003 :  03:46:06 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks a lot/ Vielen Dank

Both do actually work, I spent ages to find this information
since the manual is not very explicative on the subject.

ermano


P.s.: Tcell hat in det Tat den Vorteil einfacher und uebersichtlicher
zu sein
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