next up previous contents
Next: Decode String into Up: String Scanning and Previous: Decode String into

Decode String into Real Set Member

This Subprogram will attempt to decode the specified text string into a Member of the specified Real (floating point) Set.

Short Name Calling Sequence

STATUS = UIDCRM(STRING,SETVAL,SETSIZ,VALUE[,INDEX])

Long Name Calling Sequence

STATUS = UI_DECODE_REAL_MEMBER(...)

Input Arguments

STRING (Character) Text String SETVAL (Real Array) Array of Real Set Members SETSIZ (Integer) Size of Set Array VALUE (Real) Default Member Value

Output Arguments

VALUE (Real) Decoded Member Value INDEX (Integer) Member Index (Optional)

Function Value

UI__SUCCESS ) Success UISUCC )

UI__EMPTY_SET ) Empty Set UIEMST )

UI__NOT_MEMBER ) Decoded Value is not UINTME ) a Member of the Set

UI__ILLEGAL_SYNTAX ) Illegal Syntax UIILSY ) (not Real) Note:

  1. The SETVAL Array should be setup to contain the allowed Real Values, being SETSIZ entries long. An illegal SETSIZ (zero or negative) will cause the UI__EMPTY_SET Function Value to be returned.
  2. The VALUE Argument will not be modified if STRING does not correspond to a Real value that is present in the Set. Function Value UI__NOT_MEMBER will be returned in this case.
  3. The INDEX Argument is optional and may be omitted. If present, it will be returned as the index into the Set (in the range 1-SETSIZ) corresponding to the Set Member which was matched. If more than one Set Member has the same value, INDEX will be set to the index of the first one encountered.
  4. In order to cope with possible rounding errors, a match is made if the decoded value is within the range of 99% to 101% of a Set Member.
  5. The UI__ILLEGAL_SYNTAX Function Value will be returned if the text string does not conform to the correct Real syntax. No modification will be made to the default value in this case.
  6. Any leading or trailing spaces or tabs within STRING will be ignored.
  7. All Errors are informational only, no Error Message will be issued.


next up previous contents
Next: Decode String into Up: String Scanning and Previous: Decode String into



Liz Buckle
Fri Jan 13 17:28:23 CST 1995