3. CONTROL TRANSFER COMMAND

    1. GOTO and
    2. Computed GOTO

GOTO Command

The GOTO statement is used to branch around one or more statements.

[1] GOTO s

s is the statement number.

Computed GOTO Command

[1] GOTO ( s1, s2, ...........sn), v

where s1,s2, ........., sn are statement numbers and v is an integer expression. If the value of the integer expression is not one of the integer 1,2, ...........n, the statement is not executed, and execution continues with the next statement of the program. If this value is one of the integer 1,2, ...........n, say j, control is transferred to the statement whose number is nj.

4. DIMENSION STATEMENT

The name and the range of subscripts of an array may be declared in a DIMENSION statement of the form

DIMENSION list

Where list is a list of array declaration.

The following statements declare a one-dimensional array named NUM.

DIMENSION NUM (3)

DIMENSION NUM (1:3)

The following statements declare a two-dimensional array named NUM.

DIMENSION NUM (3,4)

DIMENSION NUM (1:3,1:4)

Two or more array names could be declared in single statement such as;

DIMENSION NUM (3,4), NUM2(3)

The information regarding the dimension of an array can also be given in the TYPE specification statement.

For example, an array NAME consisting of 10 characters string, each of which has length 25 can be declared by the following statement:

CHARACTER * 25 NAME (10)

OR

DIMENSION NAME(10)

CHARACTER * 25 NAME



Main Contents Page

© Universal Teacher Publications