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
 Beginner Needs Help

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
PUGrad Posted - 06/20/2007 : 10:09:58 AM
Origin Version (Select Help-->About Origin): 7.5 SR6
Operating System: Windows XP

I've got 2 1-D arrays, each with 500 points. They are created and filled in an origin C program. How to I write them to a worksheet, so that it will show the values of one array in Col A and one array in Col B. I've looked around and done a lot of readin, and am still a but confused on this point...
thanks..
1   L A T E S T    R E P L I E S    (Newest First)
Mike Buess Posted - 06/20/2007 : 11:07:15 AM
If you really mean array (e.g., double aa[500]) rather than vector (vector<double> vv(500)) then you must set the cell values one at a time...

double a1[500],a2[500];
// set array values
Worksheet wks = Project.ActiveLayer();
for(int i=0;i<500;i++)
{
wks.SetCell(i,0,a1[i]); // col A
wks.SetCell(i,1,a2[i]); // col B
}

It's much easier with vector...

vector v1(500),v2(500);
// set vector values
Worksheet wks = Project.ActiveLayer();
Dataset d1(wks,0),d2(wks,1);
d1 = v1; // set col A
d2 = v2; // set col B

Mike Buess
Origin WebRing Member

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