bitvector32 error

Please support our C# advertiser: Intel Parallel Studio Home
Reply

Join Date: May 2006
Posts: 1
Reputation: sheepshower is an unknown quantity at this point 
Solved Threads: 0
sheepshower sheepshower is offline Offline
Newbie Poster

bitvector32 error

 
0
  #1
May 18th, 2006
I am receiving a 'Cannot convert type 'bool' to 'int'" error, while using BitVector32.Section. I am trying to make ints, not booleans. I used this previously in the same way and it worked.

Here is my code. I am passing it an Int32. Thank you for anyone who can tell me why I am receiving this error.

  1. public class ReadDopFixAlt
  2. {
  3. private BitVector32.Section sectAlt1;
  4. private BitVector32.Section sectAlt2;
  5. private BitVector32.Section sectFix;
  6. private BitVector32.Section sectDGPS;
  7. private BitVector32.Section sectHDOP;
  8.  
  9. public ReadDopFixAlt()
  10. {
  11. sectAlt1 = BitVector32.CreateSection(32767);
  12. sectAlt2 = BitVector32.CreateSection(15, sectAlt1);
  13. sectFix = BitVector32.CreateSection(3, sectAlt2);
  14. sectDGPS = BitVector32.CreateSection(1, sectFix);
  15. sectHDOP = BitVector32.CreateSection(1023, sectDGPS);
  16. }
  17.  
  18. public string ParseDopFixAlt(int data)
  19. {
  20. // Create an instance of BitVector32 using
  21. // the data passed to this method.
  22. BitVector32 wrd = new BitVector32(data);
  23.  
  24. int Alt1 = wrd[Alt1];
  25. int Alt2 = wrd[Alt2];
  26. int Fix = wrd[Fix];
  27. int DGPS = wrd[DGPS];
  28. int HDOP = wrd[HDOP];
  29.  
  30.  
  31. StringBuilder tb = new StringBuilder();
  32. tb.Append(Fix.ToString() + ',' + ' ');
  33. tb.Append(DGPS.ToString() + ',' + ' ');
  34. tb.Append(HDOP.ToString() + ',' + ' ');
  35. tb.Append(Alt1.ToString());
  36. return tb.ToString();
  37. }
  38. }
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the C# Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC