REBOL Document

Select - Function Summary


Finds a value in the series and returns the value or series after it.


select series value


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

value - The value argument. (must be: any-type)


/part - Limits the search to a given length or position.

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

/only - Treats a series value as a single value.

/case - Characters are case-sensitive.

/any - Enables the * and ? wildcards.

/with - Allows custom wildcards.

wild - Specifies alternates for * and ? (must be: string)

/skip - Treat the series as records of fixed size

size - The size argument. (must be: integer)


Similar to the FINDfunction, but returns the next value in the series rather than the position of the match. Returns NONE if search failed.

The /ONLY refinement is evaluated for a block argument and is ignored if the argument is a string.

    blk: [red 123 green 456 blue 789]
    print select blk 'red

    weather: [
        "Ukiah"      [clear 78 wind from NW at 5 MPH]
        "Santa Rosa" [overcast 65 wind from N at 10 MPH]
        "Eureka"     [rain 62 wind from N at 15 MPH]
    probe select weather "Eureka"
    [rain 62 wind from N at 15 MPH]


find - Finds a value in a series and returns the series at the start of it.
switch - Selects a choice and evaluates what follows it.

<Back | Index | Next>

Copyright 2004 REBOL Technologies