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
 reading cell as string
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

couturier

France
291 Posts

Posted - 06/04/2018 :  07:30:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: win10

Another basic question.
I have a col formatted as Time(HH:mm)
for example row 1 displays 12:00

I want to get in a string what is actually displayed.
In LT, I can read easily read a cell as string.

How to do that with OC ?
void test read() {
	Worksheet wks = Project.ActiveLayer();
	Column col1 = wks.Columns(0);
	vectorbase &v1 = col1.GetDataObject();
	string str = v1[0]; // --> displays 0.5
}

I want to get what is actually displayed because I don't want to care about col format and subformat

Castiel

343 Posts

Posted - 06/04/2018 :  10:32:56 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by couturier

Origin Ver. and Service Release (Select Help-->About Origin): 2018b
Operating System: win10

Another basic question.
I have a col formatted as Time(HH:mm)
for example row 1 displays 12:00

I want to get in a string what is actually displayed.
In LT, I can read easily read a cell as string.

How to do that with OC ?
void test read() {
	Worksheet wks = Project.ActiveLayer();
	Column col1 = wks.Columns(0);
	vectorbase &v1 = col1.GetDataObject();
	string str = v1[0]; // --> displays 0.5
}

I want to get what is actually displayed because I don't want to care about col format and subformat



https://www.originlab.com/doc/OriginC/ref/Datasheet-TCell

https://www.originlab.com/doc/OriginC/ref/Worksheet-GetCell


     #####
    #### _\_  ________
    ##=-[.].]| \      
    #(    _\ |  |------|
     #   __| |  ||||||||
      \  _/  |  ||||||||
   .--'--'-. |  | ____ |
  / __      `|__|[o__o]|
_(____nm_______ /____\____ 
Go to Top of Page

couturier

France
291 Posts

Posted - 06/04/2018 :  12:33:10 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thank you so much.

and now the auxiliary question.
I get the columns from a dataplot, as in
DataPlot dp = gly.DataPlots(0);
XYRange xy; 
Column colX, colY;  
dp.GetDataRange(xy);  
xy.GetXColumn(colX);  
xy.GetYColumn(colY);

I already got the row index I'm looking for with dp.XIndex() but can't find how can I get the col index of colX and colY, so I can pass them into the GetCell() function.

These are basic questions but quite hard to find in help :-/
Go to Top of Page

Castiel

343 Posts

Posted - 06/04/2018 :  12:54:25 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by couturier

Thank you so much.

and now the auxiliary question.
I get the columns from a dataplot, as in
DataPlot dp = gly.DataPlots(0);
XYRange xy; 
Column colX, colY;  
dp.GetDataRange(xy);  
xy.GetXColumn(colX);  
xy.GetYColumn(colY);

I already got the row index I'm looking for with dp.XIndex() but can't find how can I get the col index of colX and colY, so I can pass them into the GetCell() function.

These are basic questions but quite hard to find in help :-/



https://www.originlab.com/doc/OriginC/ref/OriginObject-GetIndex


     #####
    #### _\_  ________
    ##=-[.].]| \      
    #(    _\ |  |------|
     #   __| |  ||||||||
      \  _/  |  ||||||||
   .--'--'-. |  | ____ |
  / __      `|__|[o__o]|
_(____nm_______ /____\____ 
Go to Top of Page

couturier

France
291 Posts

Posted - 06/04/2018 :  1:34:23 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Raaaaaaaaah
I search something like this in columns properties but couldn't find anything.

THANKS !!!!
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