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
 set colum values

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
rafaelenr Posted - 05/14/2008 : 06:50:51 AM
Origin Version (Select Help-->About Origin): 7.5
Operating System: windows xp

I started to use origin c a couple of days ago to try to automate some work. I wrote a code that imports an ascii file and create some columns in the worksheet, but when I try to set the column values everything works find to the row number 30th (my worksheet has 173 rows), when I get the following error: "Origin C Function Runtime Error, general operation failure"

The code I wrote is as follows:

void main()
{
simple_import();
del_col();
insert_col();
Worksheet wks = Project.ActiveLayer();
int /*nRow = wks.GetNumRows(),*/ i;
Dataset angle_corr( wks, 0 ), angle ( wks, 9 ), u1v ( wks, 2 ), rho ( wks, 3 ), curr (wks, 1 );
angle.Trim();
int nRow = angle.GetSize();
printf("there is %d components\n",nRow);//fflush(stdout);
//we correct the angle
for(i=0 ; i < nRow; i++)
{
angle_corr[i] = 360 - angle[i];
}
}

anybody can tell me how to solve this?
thanks,

Rafa
1   L A T E S T    R E P L I E S    (Newest First)
5*10 Posted - 05/21/2008 : 09:51:39 AM
Hi,

try to set the dimension of the Dataset in this way:

void main()
{
simple_import();
del_col();
insert_col();
Worksheet wks = Project.ActiveLayer();
int i;
Dataset angle_corr( wks, 0 ), angle ( wks, 9 ), u1v ( wks, 2 ), rho ( wks, 3 ), curr (wks, 1 );
int nRow = angle.GetSize();

angle_corr.SetSize(nRow);
angle.SetSize(nRow);
u1v.SetSize(nRow);
rho.SetSize(nRow);
curr.SetSize(nRow);
angle.Trim();

printf("there is %d components\n",nRow);//fflush(stdout);

//we correct the angle
for(i=0 ; i < nRow; i++)
{
angle_corr[i] = 360 - angle[i];
}
}

Good luck.

5*10


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