locked
My calculator RRS feed

  • Question

  • QPB125

    OK so this is my calculator but it isnt working fine because of one line...

    If a <> 1 Then

    So i cant figure out how to add more numbers to that like:

    If a <> 1,2,3,4 Then

    If someone knows that would be great,thanks in advance


    Thursday, November 17, 2011 2:42 PM

Answers

  • This Works, 

     If a <> 1 And a <> 2 And a <> 3 And a <> 4 Then  

    Cheers

     

     


    • Edited by Kiwi Bert Saturday, November 19, 2011 12:33 AM
    • Marked as answer by litdev Tuesday, November 22, 2011 9:46 PM
    Saturday, November 19, 2011 12:33 AM

All replies

  • You could try

    if a<>1 or a<>2 or a<>3 or a<>4 Then ...

    Thursday, November 17, 2011 3:37 PM
  • That didnt work cause they cancel each other, but you did help me tho...

    here is what i came up with

    edit:found bug,fixing it now

    there are probably shorter ways of doing this but this is fine for now... its only my second day of proggraming :P

     


    • Edited by pks734 Thursday, November 17, 2011 4:05 PM bug
    Thursday, November 17, 2011 4:04 PM
  • This Works, 

     If a <> 1 And a <> 2 And a <> 3 And a <> 4 Then  

    Cheers

     

     


    • Edited by Kiwi Bert Saturday, November 19, 2011 12:33 AM
    • Marked as answer by litdev Tuesday, November 22, 2011 9:46 PM
    Saturday, November 19, 2011 12:33 AM