This shows you the differences between two versions of the page.
pt:ifthen [2016/01/01 22:48] |
pt:ifthen [2020/02/28 10:46] (current) |
||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ===== If / Then ===== | ||
+ | ==== Formato ==== | ||
+ | **if** // | ||
+ | ---- | ||
+ | **if** // | ||
+ | // | ||
+ | **end if** | ||
+ | ---- | ||
+ | **if** // | ||
+ | // | ||
+ | **else**\\ | ||
+ | // | ||
+ | **end if** | ||
+ | |||
+ | ==== Descrição ==== | ||
+ | Trata-se de uma instrução com várias formas. IF avalia // | ||
+ | ==== Exemplo ==== | ||
+ | < | ||
+ | print "Guess my letter - press a key" | ||
+ | # wait for the user to press a key | ||
+ | do | ||
+ | a = key | ||
+ | pause .01 | ||
+ | until a <> 0 | ||
+ | # | ||
+ | if chr(a) = " | ||
+ | print " | ||
+ | else | ||
+ | print "darn, you pressed something else." | ||
+ | end if | ||
+ | # | ||
+ | end | ||
+ | </ | ||
+ | |||
+ | ==== Introdução ==== | ||
+ | 0.9.4g | ||