DataBasic Reference > Statements and Intrinsic Functions > W > WHILE Statement

Comment on this topic

Documentation Comments

Use this form to comment on this topic. You can also provide any general observations about the Online Documentation, or request that additional information be added in a future release.

RealityV15.1Online Documentation (MoTW) Revision 7

WHILE Statement (DataBasic) (m618703+while_s.htm)

To

Reality

Version

Topic

Submitted by

Company

Location

Email address

Comment

 

 

WHILE Statement

Used in conjunction with a FOR or LOOP statement to exit the loop.

Syntax

WHILE limit-expr {DO}

Syntax Elements

limit-expr is an expression that evaluates to true or false (1 or 0). It can be similar to the test expression in the IF statement, or a READNEXT or READPREV statement.

Operation

Refer to the descriptions of the FOR and LOOP statements.

Examples

J=0
LOOP
PRINT J
J=J+1
WHILE J<4 DO REPEAT

Prints sequential values of J from 0 through 3 (loop executes 4 times).

LOOP WHILE READNEXT ID FROM SV SETTING ERROR DO
PRINT ID
REPEAT

Prints all the item-ids in the list SV. Any file error code is assigned to variable ERROR. The program terminates when the list is exhausted.

RealityV15.1 (MoTW) Revision 7Comment on this topic