>  Docs Center  >  Libraries  >  JHU/APL/S1R  >  TYP2NUM
Libraries

TYP2NUM

TYP2NUM

Name


      TYP2NUM

Purpose


      Convert datatype description to corresponding numeric zero.

Category


Calling Sequence


      num = typ2num(txt)

Inputs


      txt = datatype description in a text string. in

Keyword Parameters


Keywords


        /BYTES Instead of numeric item return total bytes in item.
        BITS=nbits nbits is the total number of bits in given item.
        FTYPE=ftyp Returned upper case full type name.
        ERROR=err Error flag: 0=ok, else error.
        /QUIET Do not print error message.

Outputs


      num = numeric item (0) of specified typ. out

Common Blocks


Notes


      Note: Uses the IDL EXECUTE function.
        Datatypes are: CHR, BYT, INT, LON, FLT, DBL, COMPLEX,
        DCOMPLEX, UINT, ULON, LON64, ULON64 (CHR is 1 byte).
        Any array dimensions follow the data type in parantheses.
        Examples: "UINT","FLT","BYT(3,4)","LON(100)".
        May also use ARR before dimensions: bytarr(2,3), LONARR(7).
        Roughly the inverse of datatype. Data type STR
        is also allowed. Data type DMS means
        'Degrees Minutes Seconds' and is considered a string
        which must be handled as a special case in the user code:
        For example: if typ eq 'DMS' then out=dms2d(in).
        Data types may be abbreviated:
          CH, B, I, L, F, D, C, DC, UI, UL, L64, UL64, S, DM.

Modification History


      R. Sterner, 2002 Oct 10
      R. Sterner, 2003 Aug 26 --- Allowed abbreviations, added STR,
      also fixed (u)long60 -> (u)lon64.
      R. Sterner, 2005 Mar 03 --- Allowed arr or ARR in datatype.
      R. Sterner, 2005 Mar 03 --- Added /BYTES.
      R. Sterner, 2006 Mar 21 --- Added new type DMS and FTYPE=ftyp.
      R. Sterner, 2006 May 07 --- Fixed to work for FLT=7.2 type inputs.
      R. Sterner, 2006 May 07 --- Revised array/scalar testing.
      R. Sterner, 2007 Sep 12 --- Slightly improved help text.
      R. Sterner, 2011 May 27 --- Added portable data descriptions: I8, I16, I32, ...
  Copyright (C) 2002, Johns Hopkins University/Applied Physics Laboratory
  This software may be used, copied, or redistributed as long as it is not
  sold and this copyright notice is reproduced on each copy made. This
  routine is provided as is without any express or implied warranties
  whatsoever. Other limitations apply as described in the file disclaimer.txt.



© 2024 NV5 Geospatial Solutions, Inc. |  Legal
   Contact Us