h49261
s 00002/00001/00066
d D 1.2 83/01/28 14:40:07 mjb 2 1
c fixed error checking for no stops
e
s 00067/00000/00000
d D 1.1 83/01/20 11:14:35 tes 1 0
c date and time created 83/01/20 11:14:35 by tes
e
u
tes
mjb
U
t
T
I 1
subroutine qptdta (item, string)
########################################################################
#                                                                      #
#          THIS MATERIAL IS CONFIDENTIAL AND IS FURNISHED UNDER        #
#          A WRITTEN LICENSE AGREEMENT.  IT MAY NOT BE USED,           #
#          COPIED OR DISCLOSED TO OTHERS EXCEPT IN ACCORDANCE          #
#          WITH THE TERMS OF THAT AGREEMENT.                           #
#                                                                      #
#          COPYRIGHT (C) 1982 GRAPHIC SOFTWARE SYSTEMS INC.            #
#          ALL RIGHTS RESERVED.                                        #
#                                                                      #
#     Function: Put data to memory associated with a data item         #
#                                                                      #
#     Input Parameters:                                                #
#            item - (integer) data item to fetch from memory           #
#            string - (byte) null terminated data string               #
#                                                                      #
#     Output Parameters:                                               #
#            none                                                      #
#                                                                      #
#     Routines Called:                                                 #
#            none                                                      #
#                                                                      #
########################################################################
integer item
SHORTINT string(1)

SHORTINT type
integer iptr, kount, i, j, k
include(`mnucom')

iptr = 1                             # initialize pointers
kount = 1

while (kount < item) {
   iptr = iptr + dtabfr(iptr)        # pointr to next data field equals
   kount = kount + 1                 # iptr + cmdlen (dtabfr(iptr)
   }    

kount = dtabfr(iptr + 3)             # determine length of data field
type = dtabfr(iptr + 4)              # field type, 1=A, 2=I, 3=D, 5=T

iptr = iptr + 5                      # initialize to point at beginning of 
                                     # data field

k = iptr + kount - 1
D 2
if (k > FIELDxDATAxSIZE) stop 400 # Beyond data buffer size
E 2
I 2
# Beyond data buffer size
ifdef(`UNIX',`if (k > FIELDxDATAxSIZE) stop 400')
E 2

if (type == 1) {
   do i = 1,kount {                     # field
      if (string(i) == NUL) break       # at end of string
      dtabfr(iptr) = string(i)          # put the data string
      iptr = iptr + 1
      }
   }
else {
   j = 1
   while (string(j) == BLANK) j = j+1
   do i = j,kount {                     # field
      if (string(i) == NUL) break       # at end of string
      dtabfr(iptr) = string(i)          # put the data string
      iptr = iptr + 1
      }
   }

return
end
E 1
