Variable Scopes

Prev Next

Introduction

B4P variables are created (also known as declared) at their first assignments. For example, a[] = 1; creates the variable a and assigns the numeric value 1 to it. 3 different variable scopes exist:

  • Global variables: Visible througout entire program execution
  • Local variables: Visible within a local context such as code inside a user-defined procedure or function
  • Regional variables: Local variables made visible in the code of user-defined functions being called
  • System variables: Set of variables with system-related information and configuration settings you can change