aboutsummaryrefslogtreecommitdiff
path: root/pkg/tbtables/tbfnll.x
blob: 14abbf9899698bcd044832c1c4b180e15d77c55b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
include <tbset.h>
include "tbtables.h"

# tbfnll -- set elements to undefined in a FITS table
#
# Phil Hodge,  6-Jul-1995  Subroutine created

procedure tbfnll (tp, firstrow, lastrow)

pointer tp		# i: pointer to table descriptor
int	firstrow	# i: first row to be set to INDEF
int	lastrow		# i: last row to be set to INDEF
#--
pointer cp		# pointer to column descriptor
int	row1, row2	# firstrow, lastrow truncated to 1, nrows
int	row, col	# loop indexes for row and column numbers
int	nelem		# number of elements for a column
int	status		# zero is OK
pointer tbcnum()
int	tbcigi()
errchk	tbferr

begin
	status = 0

	row1 = max (1, firstrow)
	row2 = min (TB_NROWS(tp), lastrow)

	do row = row1, row2 {

	    do col = 1, TB_NCOLS(tp) {

		cp = tbcnum (tp, col)

		nelem = tbcigi (cp, TBL_COL_LENDATA)

		call fspclu (TB_FILE(tp), col, row, 1, nelem, status)
		if (status != 0)
		    call tbferr (status)
	    }
	}
end