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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Arrays in Origin C
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

sualk

Germany
Posts

Posted - 07/05/2004 :  03:48:51 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
While it seems to be possible to declare arrays of complex object in
Origin C it is not possible to access them

Example :

Dataset DD[3];
DD[0].Attach("Data1_A");
DD[1].Attach("Data1_B");
DD[2].Attach("Data1_C");
(DD[0])[1] = j;
(DD[1])[2] = j;
(DD[2])[3] = j;

Compiles fine but
(DD[0])[1] = j;
results in a crash

it seems that the []operator is not fully implemented and not documented in Origin C

Can anyone help ?

cpyang

USA
1406 Posts

Posted - 07/05/2004 :  12:48:55 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Which version of Origin are you using? I tried the following code in Origin75 SR1, and it works fine


void tt()
{
Worksheet wks = Project.ActiveLayer();

Dataset dd[3];
int ii;
for(ii = 0; ii < 3; ii++)
{
dd[ii].Attach(wks, ii);
dd[ii].SetSize(100);
}

for(ii =0; ii < 3; ii++)
{
for(int jj = 0; jj < 100; jj++)
dd[ii][jj] = ii+ 0.1*jj;
}
}





Go to Top of Page

Mike Buess

USA
3037 Posts

Posted - 07/05/2004 :  1:48:38 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Perhaps the parenthesis are the problem. Should probably be this...

DD[0][1] = j;
DD[1][2] = j;
DD[2][3] = j;

Mike Buess
Origin WebRing Member
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000