2015년 1월 30일 금요일

조건문(IF문)

If text1.text = "고구마" then
text2.text = "맛있다"
[elseif text1.text = "감자" then
text2.text = "맛없다"]
[else
text2.text = "모른다"]
end if

조건문(=IF문)

IF 조건 Then
실행할 명령어
end if

if 조건 then
실행할 명령어
else
실행할 명령어
End if

if 조건 then
Command
elseif 조건 then
Command
else
Command
end if

If 나이 = 12 then
msgbox 초등5
else
msgbox 아닙니다
end if


if age = 20 then '만약 age = 20 가 참이라면 다음 실행
magbox age
elseif age = 21 then '그겋지않으면 age = 21 가 참이라면 다음 실행
msgbox 21
elseif age=23 then '그렇지않으면  age = 23 가 참이라면 다음 실행
mwgbox 23
else '이것도 아니고 저것도 아닌 경우 다음 실행
msgbox non
end if


댓글 없음:

댓글 쓰기