8.4.8 InSet Procedure

The InSet procedure provides a way to check whether or not a value lies within a specified set.

Note that I would rather call this routine ``In_Set'', but the F90 standard does not allow underscores in defined operator names (i.e. ``.In_Set.'' is not allowed).

Calling syntax:

Logical = X .InSet. (/Elem1, Elem2, .../) |
, |

Logical = X .InSet. Set |
or |

Logical = InSet(X, Set) |

Input variables:

X |
Input integer, real or character scalar variable. | ||

Set |
A vector containing the elements of the set to be checked. | ||

(/Elem1, Elem2, .../) |
A means of expressing a set without declaring a vector. |

Output variable:

InSet |
Logical which is true if X is an element of the set. |

The InSet code listing contains additional documentation.

Michael L. Hall