else if
구문
if (expression) {
/* code */
}
else if (expression) {
/* code */
}
설명
앞 if 의 명령문에 정의된 표현식이 평가 FALSE 되고 명령문에 정의된 else if 표현식이 으로 평가 TRUE될 경우 처리되는 명령을 포함합니다. 여러 else if 명령문을 포함할 수 있지만, 프로세서는 표현식이 으로 평가되는 첫 번째 else if 문에 포함된 명령어만 실행합니다 TRUE. 이후 else if 의 모든 진술은 무시됩니다.
SLAX 예
var $description2 = {
if (description) {
expr description;
}
else if (../description) {
expr ../description;
}
else {
expr "no description found";
}
}
XSLT 동급 제품
<xsl:variable name="description2">
<xsl:choose>
<xsl:when test="description">
<xsl:value-of select="description"/>
</xsl:when>
<xsl:when test="../description">
<xsl:value-of select="../description"/>
</xsl:when>
<xsl:otherwise>unknown</xsl:otherwise>
</xsl:choose>
</xsl:variable>
릴리스 정보
SLAX 언어의 버전 1.0에 도입된 성명서.