Table of contents
CSPICE_DASLLA returns last DAS logical addresses of character, double
precision and integer type that are currently in use in a specified DAS
file.
Given:
handle the file handle of a DAS file whose active logical address
ranges are desired.
help, handle
LONG = Scalar
the call:
cspice_daslla, handle, lastc, lastd, lasti
returns:
lastc,
lastd,
lasti respectively, the last 1-based logical addresses of character,
double precision, and integer type in use in the specified DAS
file.
help, lastc
LONG = Scalar
help, lastd
LONG = Scalar
help, lasti
LONG = Scalar
None.
Any numerical results shown for this example may differ between
platforms as the results depend on the SPICE kernels used as input
and the machine specific arithmetic implementation.
1) Create a DAS file containing 10 integers, 5 double precision
numbers, and 4 characters, then use cspice_daslla to find the logical
address ranges in use.
Example code begins here.
PRO daslla_ex1
;;
;; Local parameters.
;;
FNAME = 'daslla_ex1.das'
;;
;; Open a new DAS file. Use the file name as the internal
;; file name, and reserve no records for comments.
;;
type = 'TEST'
ifname = 'TEST.DAS/NAIF/NJB/11-NOV-1992-20:12:20'
cspice_dasonw, FNAME, type, ifname, 0L, handle
for i=1L, 10L do begin
cspice_dasadi, handle, [i]
endfor
for i=1L, 5L do begin
cspice_dasadd, handle, [DOUBLE( i )]
endfor
;;
;; Add character data to the file. DAS character data are
;; treated as a character array, not as a string. The
;; following call adds only the first 4 characters to the
;; DAS file.
;;
cspice_dasadc, handle, 4L, 0, 3, BYTE( 'SPUDWXY' )
;;
;; Now check the logical address ranges.
;;
cspice_daslla, handle, lastc, lastd, lasti
print, 'Last character address in use: ', lastc
print, 'Last d.p. address in use : ', lastd
print, 'Last integer address in use : ', lasti
;;
;; Close the DAS file.
;;
cspice_dascls, handle
END
When this program was executed on a Mac/Intel/IDL8.x/64-bit
platform, the output was:
Last character address in use: 4
Last d.p. address in use : 5
Last integer address in use : 10
Note that after run completion, a new DAS file exists in the
output directory.
This routine is a utility that allows a calling program to
find the range of logical addresses currently in use in any
DAS file.
1) If the input file handle is invalid, an error is signaled by
a routine in the call tree of this routine.
2) If the input argument `handle' is undefined, an error is
signaled by the IDL error handling system.
3) If the input argument `handle' is not of the expected type, or
it does not have the expected dimensions and size, an error is
signaled by the Icy interface.
4) If any of the output arguments, `lastc', `lastd' or `lasti',
is not a named variable, an error is signaled by the Icy
interface.
None.
None.
DAS.REQ
ICY.REQ
None.
J. Diaz del Rio (ODC Space)
-Icy Version 1.0.0, 29-JUN-2021 (JDR)
return last logical addresses in DAS file
return logical address range of DAS file
|