Meta Project

The Unofficial Meta Documentation

WHILE

Summary

WHILE Loop construct that repeats the loop as long as the condition is valid at the beginning of the loop.

Category

CONTROLS

Usage

WHILE condition block

Arguments

condition - condition to be met

block - Block with the instructions to process within the loop

Refinements

This method has no refinements

Description

WHILE Loop construct that repeats the loop as long as the condition is valid at the beginning of the loop.

Example Code

Sentence: "Hello you good folks that are supporters of the Meta language"
text-left: sentence
while text-left [
    text-left: find sentence " " ; space
    forward: (count sentence ) - (count text-left)
    word: copy cut sentence forward
    write/line word
    sentence: skip sentence forward + 1
]

Related

FOR-EACH  
FOREVER  
REPEAT  
FOR  
UNTIL  

Back to the Meta Methods Reference index