|
ForceDeclaration | ||
ForceDeclaration State | ||
Parameters: State = The State variable declaration ON= Explicit declaration, OFF = Implicit (default) |
||
Returns: NONE | ||
ForceDeclaration lets the user change what variable declaration mode that the compiler uses. When enabled (ForceDeclaration ON) PlayBASIC will force the user to declare every variable prior to the variable being used. The beauty of activating ForceDeclaration mode, is that it can help you locate faults in your program that might be due to a misspelled variable name. Such problems are quite common and very frustrating to track down. Moreover you can enable/disable ForceDeclaration mode anywhere you like through out your program. (see example) State Values ON = Explicit declaration: Variables must be declared prior to use. OFF = Implicit declaration: Variables will dynamically declared for you. This is the default state for PlayBASIC. FACTS: * ForceDeclaration can be turned ON/OFF at any time through a program. Allowing you activate it for some sections and not others. * ForceDeclaration parameter is optional. ForceDeclaration defaults to ON when the parameter is left off. * ForceDeclaration is obsolete, we recommend using Explicit in the future Mini Tutorial: This example just demos the basic of PlayBASIC Explicit mode.
This example would output.
|
Related Info: | Byte | Declaration | Dim | EndDeclaration | Explicit | Float | Global | Integer | Local | Pointer | Static | String | Type | Word : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |