Code block basics

Code block basics

Code blocks, inside and out

 

Code blocks, inside and out

 

The Clipper conversion process

The Clipper conversion process (.pdf)

Try these new 5.01 language constructs

Try these new 5.01 language constructs

Variable Terms

Argument :

Generally, a value or variable supplied in a function or procedure call, or an operand supplied to an operator. In function and procedure calls, arguments are often referred to as actual parameters.

See also : Parameter

Constant :

The representation of an actual value. For example, .T. is a logical constant, string is a character constant, 21 is a numeric constant. There are no date and memo constants.

Declaration :

A statement used by the compiler to define a variable, procedure, or function identifier. The scope of the declaration is determined by the position of the declaration statement in the source file.

See Also: Identifier, Scope

Dynamic Scoping :

A method of determining an item’s existence or visibility based on the state of a program during execution. Example: A Clipper public variable may or may not be visible within a particular function, depending on whether the variable has been created and whether a previously called function has obscured it by creating a private variable with the same name.

See Also: Lexical Scoping, Scope

Field Variable :

A variable that refers to data in a database field, as opposed to data in memory.

See Also: Local Variable, Memory Variable, Variable

Filewide Declaration :

A variable declaration statement that has the scope of the entire source file. Filewide declarations are specified before the first procedure or function declaration in a program file and the program file must be compiled with the /N option.

See Also: Scope, Storage Class

Identifier :

A name that identifies a function, procedure, variable, constant or other named entity in a source program. In Clipper language, identifiers must begin with an alphabetic character and may contain alphabetic characters, numeric characters, and the underscore character.

Initialize :

To assign a starting value to a variable. If initialization is specified as part of a declaration or variable creation statement, the value to be assigned is called an initializer.

See Also: Assignment

Lexical Scoping :

A method of determining an item’s existence, visibility, or applicability (i.e., the item’s scope) by it’s position within the text of a program.

See Also: Local Variable, Scope, Static Variable

Lexically Scoped Variable :

A variable that is only accessible in a particular section of a program, where that section is defined using simple textual rules. For example, a local variable is only accessible within the procedure that declares it.

See Also: Dynamic Scoping, Local Variable, Static Variable

Lifetime of a Variable :

The period of time during which a variable retains its assigned value. The lifetime of a variable depends on its storage class.

See Also: Scope, Visibility

Local Variable :

A variable that exists and retains its value only as long as the procedure in which it is declared is active (i.e., until the procedure returns control to a higher-level procedure). Local variables are lexically scoped; they are accessible by name only within the procedure where they are declared.

See Also: Dynamic Scoping, Lexical Scoping, Static Variable

Memory Variable :

In general, a variable that resides in memory, as opposed to a database field variable. Sometimes used specifically to refer to variables of the MEMVAR storage class (private and public variables), as opposed to static or local variables.

See Also: Field Variable, Private Variable, Public Variable, Variable

Parameter :

A identifier that receives a value or reference passed to a procedure or user-defined function. A parameter is sometimes referred to as a formal parameter.

See Also: Activation, Argument, Function, Procedure, Reference

Private Variable :

A variable of the MEMVAR storage class. Private variables are created dynamically at runtime using the PRIVATE statement, and accessible within the creating procedure and any lower-level procedures unless obscured by another private variable with the same name.

See Also: Activation, Dynamic Scoping, Function, Public Variable

Public Variable :

A variable of the MEMVAR storage class. Public variables are created dynamically at runtime using the PUBLIC statement, and are accessible from any procedure at any level unless obscured by a private variable with the same name.

See Also: Activation, Dynamic Scoping, Function, Private Variable

Reference :

A special value that refers indirectly to a variable or array. If one variable contains a reference to a second variable (achieved by passing the second variable by reference in a function or procedure call), operations on the first variable (including assignment) are passed through to the second variable. If a variable contains a reference to an array, the elements of the array can be accessed by applying a subscript to the variable.

See Also: Array Reference, Parameter

Static Variable :

A variable that exists and retains its value for the duration of execution. Static variables are lexically scoped; they are only accessible within the procedure that declares them, unless they are declared as filewide, in which case they are accessible to any procedure in the source file that contains the declaration.

See Also: Dynamic Scoping, Lexical Scoping, Local Variable

Storage Class :

Defines the two characteristics of variables: lifetime and visibility.

See Also: Lifetime, Scope, Visibility

Variable :

An area of memory that contains a stored value. Also, the source code identifier that names a variable.

See Also: Local Variable, Private Variable, Static Variable

Visibility :

The set of conditions under which a variable is accessible by name. A variable’s visibility depends on its storage class.

See Also: Dynamic Scoping, Lexical Scoping