; ;========================================================================== ; ; FILE: uf_tostr.pro ; ; USAGE: result = UF_tostr(UFarray, nwords) ; ARGUMENTS: UFarray Array of UFwords ; nwords Number of UF words to convert ; ; ABSTRACT: Convert a series of UF words (16 bits) to an ASCII string ; ; AUTHOR: I. Jeff Caylor ; Science Systems and Applications, Inc. ; 5900 Princess Garden Parkway, Suite 300 ; Lanham, MD 20706 ; ; at: NASA Goddard Space Flight Center ; Code 912 ; Greenbelt, MD 20771 ; Voice: (301) 286-3767 ; Fax: (301) 286-1762 ; Email: jeff.caylor@gsfc.nasa.gov ; ; CREATED: 17 March 1995 ; ; MODIFIED: ; ;========================================================================== ; ; ; Convert the first N elements of a UF array of shorts to a string ; ; Return: String array containing 2*n ASCII characters ; FUNCTION UF_tostr, sarr, n ; Make a "string" of the correct length b = bytarr(n*2) ; Convert upper and lower bytes to character FOR i=0, n-1 DO $ b(i*2 : (i*2)+1) = [byte(sarr(i), 0), byte(sarr(i), 1)]; s = string(b) RETURN, s END