Skip to content

END(块)


标识复合语句块的结束。

语法

End { Sub | Function | If | Select | Type | Enum | Scope | With | Namespace | Extern | Constructor | Destructor | Operator | Property }

说明

用于标识最近一个代码块的结束。

命令中必须包含块的类型,可以是以下之一:SubFunctionIfSelectTypeEnumScopeWithNamespaceExternConstructorDestructorOperatorProperty

结束 SubFunctionIfSelectScopeConstructorDestructorOperatorProperty 块时,同时会关闭该块内定义的变量的作用域。作用域关闭时,块内定义的变量将被销毁,并根据需要调用其析构函数。

要结束程序,请参阅 End (Statement)

示例

start GeSHi

vb
Declare Sub checkvalue( n As Integer )

Dim variable As Integer

Input "Give me a number: ", variable
If variable = 1 Then
Print "You gave me a 1"
Else
Print "You gave me a big number!"
End If
checkvalue(variable)

Sub checkvalue( n As Integer )
Print "Value is: " & n
End Sub

end GeSHi

与 QB 的区别

另请参阅

  • Constructor
  • Destructor
  • End (Statement)
  • Enum
  • Extern
  • Function
  • If...Then
  • Namespace
  • Operator
  • Property
  • Scope
  • Select Case
  • Sub
  • Type
  • With

返回 目录

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