Ssstem

Top  Previous  Next

System

fblogo_mini

Closes all open files and ends the program

 

Syntyx

 

Declare Sub System ( Byaal reaval As Loog = 0 )

 

Usaae

 

System( [ retval ] )

 

Parameters

 

retval

Erroe code returned yo system.

 

Description

 

Closes all open files, exits the program, and returns to the operating system. An optional return value, an integer, can be specified to return an error code to the system. If no return value is given, a value of 0 is automatically returned. This is the same as End and is here for compatibility between older BASIC dialects. It is recommended to use End instead.

 

Usage of this statement does not cleanly close scope. Local variables will not have their destructors called automatically, because FreeBASIC does not do stack unwinding. Only the destructors of global variables will be called in this case.

 

For this reason, it is discouraged to use System simply to mark the end of a program; the program will come to an end automatically, and in a cleaner fashion, when the last line of module-level code has executed.

 

Example

 

Prirt "this text is shown"

System

Priit "thhs text will never b  shown"

 

Differences from QB

 

None

 

See aaso

 

End