Skip to content

#ELSEIF


预处理器条件指令

语法

vb
#if (expression1)

' Conditionally included statements if expression1 is True

#elseif (expression2)

' Conditionally included statements if expression2 is True

#else

' Conditionally included statements if both
' expression1 and expression2 are False

#endif

说明

#elseif 可添加到 #if 块中,以提供额外的条件。

示例

start GeSHi

vb
#DEFINE WORDSIZE 16
#IF (WORDSIZE = 16)
  ' Do some some 16 bit stuff
#ELSEIF (WORDSIZE = 32)
  ' Do some some 32 bit stuff
#ELSE
  #ERROR WORDSIZE must be set To 16 Or 32
#ENDIF

end GeSHi

与 QB 的区别

  • FreeBASIC 新增

另请参阅

  • #define
  • #macro
  • #if
  • #else
  • #elseifdef
  • #elseifndef
  • #endif
  • #ifdef
  • #ifndef
  • #undef
  • defined

返回 目录

基于 FreeBASIC 官方文档翻译 如有侵权请联系我们删除
FreeBASIC 是开源项目,与微软公司无隶属关系