{{htmlmetatags>
metatag-description=(반복문, 반복, 루프문, 루프, 프로그래밍 언어, Programming Language, ASP, JSP, Java, JSTL, JavaScript, Shell Script, MyBatis)
metatag-og:description=(반복문, 반복, 루프문, 루프, 프로그래밍 언어, Programming Language, ASP, JSP, Java, JSTL, JavaScript, Shell Script, MyBatis)
}}
====== 반복문 ======
===== ASP =====
* 대/소문자 구분 없음
* 파스칼 표기법 지향
' For
For 변수 = 시작값 To 종료값
구문
Next
' For
For 변수 = 시작값 To 종료값 Step 증감값
구문
Next
' For Each
For Each 변수 In 객체
구문
Next
' Do While
Do While 조건식
구문
Loop
' Do
Do
구문
Loop While 조건식
' Do Until (역조건문)
Do Until 조건식
구문
Loop
' Do (역조건문)
Do
구문
Loop Until 조건식
' Exit
Exit For
Exit Do
===== JSP/Java =====
// for
for (초기화식; 조건식; 증감식) {
구문;
}
// for
for (변수 : 객체) {
구문;
}
// while
while (조건식) {
구문;
}
// do ~ while
do {
구문;
} while (조건식);
// label, continue, break
loop1:
for (초기화식; 조건식; 증감식) {
if (조건식) {
continue loop1;
}
loop2:
for (초기화식; 조건식; 증감식) {
if (조건식) {
break loop2;
}
}
}
===== JSTL =====
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
${변수}
${변수}
${변수}
${변수}
${status.current}
${status.index}
${status.count}
${status.first}
${status.last}
${status.begin}
${status.end}
${status.step}
===== JavaScript =====
// for
for (초기화식; 조건식; 증감식) {
구문;
}
// for ~ in
for (변수 in 객체) {
구문;
}
// for ~ of
for (변수 of 객체) {
구문;
}
// while
while (조건식) {
구문;
}
// do ~ while
do {
구문;
} while (조건식);
// label, continue, break
loop1:
for (초기화식; 조건식; 증감식) {
if (조건식) {
continue loop1;
}
loop2:
for (초기화식; 조건식; 증감식) {
if (조건식) {
break loop2;
}
}
}
===== Shell Script =====
# for
for ((초기화식; 조건식; 증감식))
do
구문
done
# for
for 변수 in {시작값..종료값}
do
구문
done
# for
for 변수 in {시작값..종료값..증감값}
do
구문
done
# for
for 변수 in 범위
do
구문
done
# while
while [ 조건식 ]
do
구문
done
# until (역조건문)
until [ 조건식 ]
do
구문
done
# continue, break
continue
break
===== MyBatis =====
#{item}
#{index}