Variables, Arrays, and Hashtables
This chapter explores variables, along with a detailed look at arrays and Hashtables, as these have their own complexities.
A variable in a programming language allows you to assign a label to a piece of information or data. A variable can be used and reused in the console, script, or function, or in any other piece of code.
In this chapter, we're going to cover the following topics:
- Naming and creating variables
- Variable commands
- Variable providers
- Scopes and variables
- Types and type conversion
- Typed numeric values
- Objects assigned to variables
- Arrays
- Hashtables
- Lists, dictionaries, queues, and stacks
A variable may be of any .NET type or object instance. The variable may contain a string such as Hello World
, an integer such as 42
, a decimal such as 3.141
, an array, a Hashtable, a ScriptBlock
, and so on. Everything a variable might refer to is considered to be...