OSDN Git Service

499c0e6eca401ff7ceb130a66cfe3140b5b239bb
[bacon/BaCon-Japanese.git] / 関数・命令 / IF.txt
1   IF\r\r   IF <expression> THEN\r       <body>\r   [ELIF]\r       <body>\r   [ELSE]\r       [body]\r   ENDIF | END IF | FI\r\r   Type: statement\r\r   Execute <body> if <expression> is true. If <expression> is not true then\r   run the optional ELSE body. Multiple IF's can be written with ELIF. The\r   IF construction should end with ENDIF or END IF or FI. Example:\r\r   a = 0\r   IF a > 10 THEN\r       PRINT "This is strange:"\r       PRINT "a is bigger than 10"\r   ELSE\r       PRINT "a is smaller than 10"\r   END IF\r\r   If only one function or statement has to be executed, then the\r   if-statement also can be used without a body. For example:\r\r   IF age > 18 THEN PRINT "You are an adult"\r   ELSE INPUT "Your age: ", age\r\r   Use with care as nested IF/THEN statements using one function may\r   confuse the parser.\r\r