메뉴 건너뛰기

enjoyTools.net

#5. 조건문

2015.02.22 15:38

꿈돌이 조회 수:4276

#5. 조건문


문법에 융통성이 없어서  괄호의 붙여쓰기와 띄어쓰기에 주의해야 함.


....


if()


myStatus = t

yourStatus = t


;1번 스타일

if( myStatus

print(myStatus)

myStatus = nil

print(myStatus)

else

print("here is else.")

)


;2번 스타일

if( (myStatus == t) || (yourStatus == t) then

print(myStatus)

myStatus = nil

print(myStatus)

else

print("here is else.")

)


;3번 스타일

if( myStatus == t then

print(myStatus)

myStatus = nil

print(myStatus)

else

print("here is else.")

)



case(), cond()





when(), unless()








번호 제목 글쓴이 날짜 조회 수
9 #6. 함수(프로시저) 꿈돌이 2015.02.22 10121
8 #2. 출력문 꿈돌이 2015.02.21 5503
7 #4. 폼 꿈돌이 2015.02.22 4537
» #5. 조건문 꿈돌이 2015.02.22 4276
5 #8. map 시리즈 꿈돌이 2015.04.05 3948
4 #0. 개요 꿈돌이 2015.02.21 2077
3 #1. 기본 문법 꿈돌이 2015.02.21 1925
2 #7. 리스트 꿈돌이 2015.04.04 1736
1 #3. 순환문 꿈돌이 2015.02.22 1047