Skip to main content

This is documentation for Caché & Ensemble.

For information on converting to InterSystems IRISOpens in a new window, see the InterSystems IRIS Migration Guide and Migrating to InterSystems IRIS, both available on the WRC Distributions pageOpens in a new window (login required).

CLEARDATA

Clears all data stored by the DATA statement.

Synopsis

CLEARDATA

Arguments

None.

Description

The CLEARDATA statement flushes (clears) all remaining data stored in the input stack by the DATA statement. Following CLEARDATA, the INPUT statement issues a user prompt, rather than automatically receiving data stored by the DATA statement.

Examples

The following example illustrates the use of the CLEARDATA statement:

DATA "New York","Chicago","","Annapolis"
FOR x=1 TO 4
  INPUT cityname
  IF cityname=""
   THEN CLEARDATA
   PROMPT "Missing name: "
   INPUT cityname
  ELSE
   PRINT cityname
NEXT
Copy code to clipboard

See Also

FeedbackOpens in a new window