none
how do you use and in coding? RRS feed

  • Question

  • does anyone know how to code "and" for example I need to have 2 variables set to "y" in order to enter a room for example

    if a = "y" AND

    if b = "y" THEN

    so on and so forth.

    can anyone be of any help? sorry if the answer is simple I'm a beginner! x

    Thursday, March 9, 2017 8:22 PM

Answers

All replies

  • Hi

    A compound if statement with And:

    a = "y"
    b = "y"
    If (a = "y" And b = "y") Then
      TextWindow.WriteLine("Success")
    EndIf

    Thursday, March 9, 2017 8:56 PM
    Moderator
  • A statement with many ElseIf's can be faster then many If's because if the first If is fulfilled all then following ElseIf's have no need to be tested.

    Jan [ WhTurner ] The Netherlands

    Friday, March 10, 2017 10:33 AM
    Answerer