SCAN

From Lianjapedia
Revision as of 03:43, 20 June 2010 by Barrymavin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Purpose

Scans over records in a table and executes a command block for each selected record.

Syntax

SCAN [<scope>] [FOR <condition>] [WHILE <condition>]

[EXIT]

[LOOP]

ENDSCAN


See Also

CONTINUE, DO WHILE, IF, LOCATE


Description

The SCAN ... ENDSCAN command executes a command block repeatedly FOR a specified selection of records WHILE an optionally specified condition is true, or until an EXIT is encountered. The optional LOOP keyword forces control to the beginning of the SCAN.

The SCAN...ENDSCAN command can be used to reduce the programming involved in a LOCATE ... DO WHILE ... CONTINUE construct.

Example

use customers
seek "HMT"
scan rest while code = "HMT"
    echo "name=" + name + "address=" + address
endscan

Products

Recital Database Server, Recital Mirage Server, Recital Terminal Developer