Home Page   We Generate Your Software.
Products Services Company Technology Demo Contact Site Map Search
The Somusar/SoProTech[tm] Booklet Series
Volume VI

"somusar/Tefigel: Reference Guide"

Printer friendly

1. Introduction
2. File Sections
3. Commands and Instructions
4. Markers
6. Special Characters
7. Variables
7.1 Purpose
7.2 Usage
7.3 Description
8. Arithmetic Computation
9. Boolean Computation
10. Control Flow
11. Subroutines and Functions
12. Built-in Functions
13. Input and Output
14. Packages and Libraries
15. Tag File Processing
16. CSV File Processing
17. Filters
18. Links and Traps
19. Name Spaces
20. Miscellaneous
21. Further Reading

Chapter 7 - Variables

7.1 - Purpose        top

Define placeholders for character strings that can also be used as traditional program variables.

7.2 - Usage        top

Set a variable in the global name space:

   globset <variable>=<value>
   globset <associative-variable>=<value>
Set a new variable in the current name space, or change value to a previously set variable:
   set <variable>=<value>
   set <associative-variable>=<value>
Unset a variable:
   unset <variable>
   unset <associative-variable>
Access contents of a variable within an input line (both text and command line):
   text text text text text text text text
   text text text <variable> text text text
   text text text text text text text text

7.3 - Description        top

A <variable> is defined as an identifier represented by a sequence of letters, digits and underscore ('_'). The first character of the identifier must be either a letter or an underscore. Tefigel is case-sensitive with respect to variable identifiers.

A <value> can be any string and requires no delimiters: every character after the assignment operator = up to the end of the logical command line is considered part of the <value> to be stored in the <variable>, including blanks and tabs, which are treated exactly as all other characters. A <value> may contain other variables as well as in-line function calls, so that <variable> is assigned the string of characters resulting from replacing the other variables with their contents, and the in-line function calls with their return values.

An <associative-variable> is defined as the concatenation of two or more identifiers by means of the current dash special character. The identifiers may refer to previously set variables - in which case their current value is used to construct the corresponding part of the identifier of the <associative-variable> - or not refer to any variable - in which case they will literally be used to construct the corresponding part of the identifier of the <associative-variable>.

Depending on its current value, a variable may be used for arithmetic or boolean computation, as explained later in this guide.

[Previous chapter]    [Next chapter]    [Back to top]

http:// www.somusar.com  / doc  / booklets  / tefigel_ref  - Powered by SoProMach
Copyright © 2003-2012 Somusar - Trademarks - Legal - Privacy - Webmaster