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
 LabTalk Forum
 Bitwise operator in OriginC
 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 - 03/26/2004 :  04:38:06 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Hi,
Are bitiwse operations possible OriginC?
Should I include a header file for it?
I encountered compilation errors when using & and |.Does OriginC use a different syntax for them?
Thanks

cpyang

USA
1407 Posts

Posted - 03/26/2004 :  07:56:09 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Can you post code? should not have problem, maybe data type double/float?

CP


Go to Top of Page

cosy

Germany
Posts

Posted - 03/26/2004 :  08:24:40 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi, whenever I use a bit wise operator in Origin C I get a compiler error : incompatible variable type.
The following is a piece of my code

Dataset ds1("MyData_a");
Dataset ds2("MyData_b");
Dataset ds3("MyData_c");
Dataset ds4("MyData_d");
if(ds2 & 1024 == 1024)
{
ds3 = ds1;
}

I get an error at the if statement (Incompatible variable type)
Can any explain the cause of it?
Thanks.
Deepak Samuel
Go to Top of Page

cpyang

USA
1407 Posts

Posted - 03/26/2004 :  09:11:48 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
what are you trying to do here?

ds2 is a Dataset, which is a vector, so I don't see how that can work. If you are trying to get the 1st element to test for a bit, then maybe

int nn = ds2[0];
if((nn & 1024) == 1024)
{
ds3 = ds1;
}

CP


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