else
구문
if (expression) { /* code */ } else { /* code */ }
설명
이전 및 else if
명령문이 으로 평가할 FALSE
경우 처리되는 기본 명령 집합을 if
포함합니다.
SLAX 예
if (starts-with(name, "fe-")) { if (mtu < 1500) { /* Select the Fast Ethernet interfaces with low MTUs */ } } else { if (mtu > 8096) { /* Select the non-Fast Ethernet interfaces with high MTUs */ } }
XSLT 등가물
<xsl:choose> <xsl:when select="starts-with(name, 'fe-')"> <xsl:if test="mtu < 1500"> <!-- Select with Fast Ethernet interfaces with low MTUs --> </xsl:if> </xsl:when> <xsl:otherwise> <xsl:if test="mtu > 8096"> <!-- Select the non-Fast Ethernet interfaces with high MTUs --> </xsl:if> </xsl:otherwise> </xsl:choose>
릴리스 정보
SLAX 언어의 버전 1.0에서 소개된 명령문입니다.