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
 OriginC Problem-Rewriting data

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
cosy Posted - 08/03/2004 : 07:57:18 AM
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.
1   L A T E S T    R E P L I E S    (Newest First)
easwar Posted - 08/03/2004 : 11:10:00 AM
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

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