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
 How to generate dataset names?

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
ashvilki Posted - 08/26/2003 : 8:58:34 PM
Hi, guys!
I work with imported worksheets with different number of columns. To do column calculations, I was trying to create datasets for each column by creating dataset names like ds0, ds1, ds2 etc using the following script (see below). For obvious reasons, this does not work - both string variable and dataset have the same name. Is there a way around it? (I am sorry for my poor basic C skills...)
Thanks,

Alexei

Worksheet wks1 = Project.ActiveLayer();
UINT ncols = wks1.GetNumCols();
UINT nrows = wks1.GetNumRows();
for (int ij =0; ij<ncols; ij++)
{
String dname2 = ij;
String dname1 = "ds";
String Dname =lstrcat(dname1,dname2) ;
Dataset Dname(wks1, ij);
}
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 08/27/2003 : 9:09:23 PM
Hi Alexei,

Unless you really need to give the datasets specific names (not sure it can be done easily) I'd try something like this...

Worksheet wks1 = Project.ActiveLayer();
UINT ncols = wks1.GetNumCols();
UINT nrows = wks1.GetNumRows();
Dataset ds;
for (int i =0; i<ncols; i++)
{
ds.Attach(wks1,i);
- do what you want to col i -
}

Mike Buess
Origin WebRing Member

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