REBOL Document

Next - Function Summary


Summary:

Returns the series at its next position.

Usage:

next series

Arguments:

series - The series argument. (must be: series port)

Description:

If the series is at its tail, it will remain at its tail. NEXT will not go past the tail, nor will it wrap to the head.


    print next "ABCDE"
    BCDE


    print next next "ABCDE"
    CDE


    print next [1 2 3 4]
    2 3 4


    str: "REBOL"
    loop length? str [
        print str
        str: next str
    ]
    REBOL
    EBOL
    BOL
    OL
    L


    blk: [red green blue]
    loop length? blk [
        probe blk
        blk: next blk
    ]
    [red green blue]
    [green blue]
    [blue]

Related:

back - Returns the series at its previous position.
first - Returns the first value of a series.
head - Returns the series at its head.
head? - Returns TRUE if a series is at its head.
tail - Returns the series at the position after the last value.
tail? - Returns TRUE if a series is at its tail.


<Back | Index | Next>

Copyright 2004 REBOL Technologies