Results 1 to 2 of 2

Thread: byte in an if statement?

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Jul 2003
    Posts
    830

    byte in an if statement?

    How do I use a byte in an if statement?


    public byte MyByte;

    if (MyByte)
    {
    //Code here;
    }

  2. #2
    Frenzied Member PilgrimPete's Avatar
    Join Date
    Feb 2002
    Posts
    1,313

    Re: byte in an if statement?

    Do you mean byte or bool?
    A byte holds an integer between 0 and 255, so you would just use it like this:
    Code:
    public byte MyByte;
    
    if ( MyByte == 0 )
    { 
    //Code here;
    }

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width