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
 array of curves

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
ovince Posted - 10/30/2006 : 02:21:09 AM
hi,


I realise that it is possible to define something like this

Database db[10];

I have tried the same with curves. It compiles but have a problem when executing the code. Basically, this is the idea



//define curve array
Curve crv[10];


int j = 0;
foreach (PageBase pb in Project.Pages)
{
.....

////copy datasets to curve
Curve crvCopy( Dn, HdA ); //Dn and HdA are datasets
crv[j]=crvCopy;

.....

j++;
}

//PLOTTING PART

for (int k=0; k<10; k++)
{

Curve tmpC;
tmpC=crv[k];

int kk = gly.AddPlot( tmpC, IDM_PLOT_SCATTER );
DataPlot dpLine = gly.DataPlots(kk);

gly.Rescale();
}




Why it does not work?

oliver
2   L A T E S T    R E P L I E S    (Newest First)
ovince Posted - 10/30/2006 : 05:06:20 AM
yes, it is a good idea


thanks Deanna, Mike and Zachary for helping me in a last few days
Deanna Posted - 10/30/2006 : 03:58:59 AM
The main problem is that you cannot copy a curve like
crv[j]=crvCopy

Actually, I don't think you really need a curve array. You may just need two string arrays to save the names of Dn and HdA.

I suggest that you can do it in the following way:


//define string arrays
string DnString[2];
string HdAString[2];

int j = 0;
foreach (PageBase pb in Project.Pages)
{
.....

//copy dataset names
DnString[j] = Dn.GetName();
HdAString[j] = HdA.GetName();

.....

j++;
}


//plotting part
for (int k=0; k<10; k++)
{
Curve tmpC(DnString[k], HdAString[k]);

int kk = gly.AddPlot( tmpC, IDM_PLOT_SCATTER );
DataPlot dpLine = gly.DataPlots(kk);

gly.Rescale();
}


Deanna
OriginLab Technical Services

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