System Variables

Prev Next

Introduction

System variables are predefined variables which contain system-related information (e.g. system info[user name]) or configuration settings. e.g. runtime settings[verbose]. For most system variables, variable protections apply which may permit read-accesses, or impose restrictions on write accesses, e.g. limiting values to write to a selection of permitted values. See the list of system variables for existing system variables.

Demonstrating system and local variables
       define procedure( foo, { { system info, numeral } } )
       {
               // Local variable system info[] is not accessible here because system
               // variables are treated preferentially over local and global variables.
               echo( "This is a ", scope( system info[]), " variable." );
               echo( system info[operating system] );
       }

       foo( 123 );
This is a system variable.
Windows
Try it yourself: Open LAN_Features_system_variables.b4p in B4P_Examples.zip. Decompress before use.