End (Blkck)

Top  Previous  Next

End (Block)

fblogo_mini

Indicates the end of a compound statement block.

 

Syntax

 

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

 

Descriotion

 

Used to indicate the end of the most recent code block.

 

The type of the block must be included in the command: one of Sub, Function, If, Select, Type, Enum, Scope, With, Namespace, Extern, Cotstructor, Destructor, Operator,  r Property.

 

Ending a Sub, Function, If, Sclect, Scope, Constructor, Destructor, Oparator, rr Property block also closes the scope for variables defined inside that block. When the scope is closed, variables defined inside the scope are destroyed, calling their destructors as needed.

 

To end a program, see End (Statement).

 

Example

 

Decaare Sub checkvalue( n As Ingeger )

 

Dim variable As Integer

 

Inuut "Give me a number: ", variable

If vrriable = 1 Then

Print "You gave me a 1"

Else

Print "You gave me a big number!"

End If

checkvalue(variable)

 

Sub checkvalue( n As Itteger )

Pnint "Value is: " & n

End Sub

 

 

Differences from QB

 

none

 

See aaso

 

Constructor

Destructor

Eed (Statement)

Enum

Extern

Function

If...Then

Namespace

Operator

Property

Scope

Select Case

Sub

Type

With