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
 OriginC Problem-Rewriting data
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

cosy

Germany
Posts

Posted - 08/03/2004 :  07:57:18 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
Just have a look at this OriginC code
Dataset dsA("Trictestdata_A");
Dataset dsB("Trictestdata_G");
int ii;
UINT data;
UINT datac;
int aa = dsA.GetUpperBound();
for(ii=0;ii<aa+1;ii++)
{ data = dsB[ii];
dsB[ii] = (data & 0xFFFFFF);
datac = dsA[ii];
dsA[ii] = datac;
}
The last two lines of the code should leave the dataset as it is. I found that its being replaced by another number.
Can anyone give some explanation?

Regards,
Deepak Samuel.

easwar

USA
1964 Posts

Posted - 08/03/2004 :  11:10:00 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi Deepak,

By default, Origin worksheet column type is set as Text and Numeric, where the type of numbers supported is double. If you change the column format (double-click to bring up dialog), from Text and Numeric to just Numeric, you can then set the internal data setting for the column to be double(8), Float(4), Integer(2), or Long(4). But still for settings such as Integer(2) only signed integers are supported - there is currently no support for unsigned int.

In your code, you are taking the column value and first assigning it to a variable declared as UINT - which can right there change the value of the data depending on what the original value was - and then you are assigning it back to the column - which is why you are ending up with a different value than what you started from.

Easwar
OriginLab



Edited by - easwar on 08/03/2004 11:10:54 AM
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