Netduino home hardware projects downloads community

Jump to content


The Netduino forums have been replaced by new forums at community.wildernesslabs.co. This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.
Photo

Visual Basic vs C Sharp


  • Please log in to reply
2 replies to this topic

#1 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 21 April 2012 - 12:52 AM

I have 2 versions of the same program, one written in Visual Basic the other in C Sharp. Both versions do the same thing, they use a Poteniometer, Button & RGBLed module. Push the button cycles through 7 color then off, turn the pot changes the intensity of the Led.

The problem is when run with Visual Basic I get 4 warning errors (see attached image), when run with C Sharp it runs clean. Other than the warnings everything works the way I want it to.

Is there something missing from the references that would cause me to get the warnings. I am using the provided Netduino Go template.

      ColorValue = CByte(255 * Pot.GetValue) 'Warnings 1 & 3 at start of line
      If (PB.ButtonState Or OPB.Read) Then ' Use either button to change color
        i += 1 'Warnings 2 & 4 at start of line
        If i > 7 Then
          i = 0
        End If

Thanks,
Chuck

Attached Files



#2 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 21 April 2012 - 01:14 AM

Hi carb, The warnings are a feature of the Visual Basic compiler, telling you about differences between C# and VB. They're IL warnings. These warnings should only be cosmetic in most cases (unless you're working with edge cases or your counters are depending on an overflow sceanrio). We might be able to pool some ideas together on how to suppress them if they worry you :) Chris

#3 carb

carb

    Advanced Member

  • Members
  • PipPipPip
  • 352 posts
  • LocationCrystal River, Florida

Posted 21 April 2012 - 02:25 AM

Hi carb,

The warnings are a feature of the Visual Basic compiler, telling you about differences between C# and VB. They're IL warnings.

These warnings should only be cosmetic in most cases (unless you're working with edge cases or your counters are depending on an overflow sceanrio). We might be able to pool some ideas together on how to suppress them if they worry you :)

Chris

No that's all right, I will pretend that they are coming from a wife and ignore them! :lol:

Just mentioned it in case it was an indication of something more serious.

Thanks,
Chuck




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.