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
 reading cell as string

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
couturier Posted - 06/04/2018 : 07:30:04 AM
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
4   L A T E S T    R E P L I E S    (Newest First)
couturier Posted - 06/04/2018 : 1:34:23 PM
Raaaaaaaaah
I search something like this in columns properties but couldn't find anything.

THANKS !!!!
Castiel Posted - 06/04/2018 : 12:54:25 PM
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_______ /____\____ 
couturier Posted - 06/04/2018 : 12:33:10 PM
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 :-/
Castiel Posted - 06/04/2018 : 10:32:56 AM
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_______ /____\____ 

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