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
 Placing strings in worksheet columns

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
beenyy Posted - 04/08/2004 : 8:04:59 PM
I'm trying to place strings in to columns of a worksheet. Currently I'm using something like this:

Dataset number_data(wks, 0);
number_data.SetSize(length);
number_data[0] = 5;

string str;
str = "some string";
Dataset string_data(wks, 1);
string_data.SetSize(length);
string_data[0] = str;

The above works fine when the data is a number, but when it's a string I get the error: Error, Incompatible variable types in expression. How do I get the string data into my worksheet columns?

Thanks,
beenyy
2   L A T E S T    R E P L I E S    (Newest First)
beenyy Posted - 04/09/2004 : 2:50:20 PM
Thanks Iris!
Iris_Bai Posted - 04/08/2004 : 10:51:32 PM
Hi beenyy,


// Worksheet column Data1_B must exist prior to execution.
void ttgp()
{
Column col("Data1", 1);
if(!col)
return;
//Must make sure the format of the column should be Text type
if( OKCOLTYPE_TEXT_NUMERIC != col.GetFormat() || OKCOLTYPE_TEXT != col.GetFormat())
col.SetFormat(OKCOLTYPE_TEXT_NUMERIC);

string str;
Dataset dsB("Data1_B");

dsB.SetSize(2);
for(int ii=0; ii<dsB.GetSize(); ii++)
{
str.Format("Row %d", ii);
dsB.SetText(ii, str);
}

}


Iris

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