943,938 Members | Top Members by Rank

Ad:
  • C# Discussion Thread
  • Unsolved
  • Views: 2095
  • C# RSS
May 18th, 2006
0

bitvector32 error

Expand Post »
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.

C# Syntax (Toggle Plain Text)
  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. }
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
sheepshower is offline Offline
1 posts
since May 2006

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in C# Forum Timeline: Average of prime number between 1 & 100
Next Thread in C# Forum Timeline: C# Project





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC