Skip to content
Narta Xaymar Dirks edited this page Nov 25, 2026 · 3 revisions

Local BlitzBasic

Local name[type] [= value][, name2[type] ...]

Description

Declares a variable that only exists in the function (or the main program) that declares it, and hides a Global of the same name. A variable that is assigned without a declaration is local too, but declaring it makes that clear.

Examples

Global x = 1

Function Show()
	Local x = 99
	Print x
End Function

Show()
Print x
99
1

Related Commands

Global BlitzBasic, Include BlitzBasic, Stop BlitzBasic

Home · Command Index


Getting started

Language

Tools


Language Features
BlitzBasic
Blitz3D
BlitzPlus
Differences

More

Clone this wiki locally