aboutsummaryrefslogtreecommitdiff
path: root/sys/gio/nspp/sysint/ncgchr.x
blob: 5cf40b2286bd3c23b81623e1e3be955dc3f6d2ee (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Copyright(c) 1986 Association of Universities for Research in Astronomy Inc.

# NCGCHR -- Get a single character (byte) from a packed array.  Return
# a blank if the index is out of bounds.

procedure ncgchr (ichars, len_ichars, index, char_value)

int	ichars[ARB]		# packed character array
int	len_ichars		# length of the array
int	index			# index of char to be extracted
int	char_value		# return value

char	ch

begin
	if (index < 1 || index > len_ichars)
	    char_value = ' '
	else {
	    call chrupk (ichars, index, ch, 1, 1)
	    char_value = ch
	}
end