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

DATATYPE

DATATYPE

Name


      DATATYPE

Purpose


      Datatype of variable as a string (3 char or spelled out).

Category


Calling Sequence


      typ = datatype(var, [flag])

Inputs


      var = variable to examine. in
      flag = output format flag (def=0). in

Keyword Parameters


Keywords


        NUMERIC=num returns a code indicating numeric type:
          0=non-numeric, 1=integer, 2=float, 3=complex.
        INTEGER_BITS=bits returns number of bits if numeric:
          0=Not Integer, 8=Byte, 16=Int, 32=Long, 64=Long 64.
          Also for floating and complex. For a single element.
        NUMBYTES=numbtyes Returned total number of bytes in var.
        /DESCRIPTOR returns a descriptor for the given variable.
          If the variable is a scalar the value is returned as
          a string. If it is an array a description is return
          just like the HELP command gives. Ex:
          datatype(fltarr(2,3,5),/desc) gives
            FLTARR(2,3,5) (flag always defaults to 3 for /DESC).

Outputs


      typ = datatype string or number. out
          flag=0 flag=1 flag=2 flag=3 flag=4
          UND Undefined 0 UND UND
          BYT Byte 1 BYT B
          INT Integer 2 INT I
          LON Long 3 LON L
          FLO Float 4 FLT F
          DOU Double 5 DBL D
          COM Complex 6 COMPLEX C
          STR String 7 STR S
          STC Structure 8 STC STC
          DCO DComplex 9 DCOMPLEX DC
          PTR Pointer 10 PTR PTR
          OBJ Object 11 OBJ OBJ
          UIN U_Integer 12 UINT UI
          ULO U_Long 13 ULON UL
          LLO Long_64 14 LON64 L64
          ULL U_Long_64 15 ULON64 UL64

Common Blocks


Notes


      Notes: For a tag, val pair:
        print, tag+' = '+datatype(val,/desc)
        will give a nice description of the item. Could loop
        through the tags and values of a structure this way.

Modification History


      Written by R. Sterner, 24 Oct, 1985.
      RES 29 June, 1988 --- added spelled out TYPE.
      R. Sterner, 13 Dec 1990 --- Added strings and structures.
      R. Sterner, 19 Jun, 1991 --- Added format 3.
      R. Sterner, 18 Mar, 1993 --- Added /DESCRIPTOR.
      R. Sterner, 1995 Jul 24 --- Added DCOMPLEX for data type 9.
      R. Sterner, 1999 Jun 4 --- Added types 10 on, also numeric and bits.
      R. Sterner, 2002 Oct 10 --- Now returns #bits for non-int numeric.
      R. Sterner, 2004 May 18 --- Handled object descriptor.
      R. Sterner, 2004 Sep 21 --- Made scalar /DESCRIPTOR type dependent.
      R. Sterner, 2005 Apr 27 --- Fixed for scalar pointer with /DESCRIPTOR.
      R. Sterner, 2008 Jan 03 --- Added flag=4 output.
      R. Sterner, 2010 May 03 --- Converted arrays from () to [].
      Johns Hopkins University Applied Physics Laboratory.
  Copyright (C) 1985, 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