PDA

Click to See Complete Forum and Search --> : byte in an if statement?


birthjay
Feb 28th, 2005, 07:27 AM
How do I use a byte in an if statement?


public byte MyByte;

if (MyByte)
{
//Code here;
}

PilgrimPete
Feb 28th, 2005, 07:43 AM
Do you mean byte or bool?
A byte holds an integer between 0 and 255, so you would just use it like this:

public byte MyByte;

if ( MyByte == 0 )
{
//Code here;
}