h42229
s 00000/00000/00086
d D 1.4 83/03/03 22:33:43 mjb 4 3
c 
e
s 00018/00019/00068
d D 1.3 83/02/09 21:25:20 mjb 3 2
c 
e
s 00015/00028/00072
d D 1.2 83/01/26 16:10:49 mjb 2 1
c fixed for new data menu with no labels (downsized) etc.
e
s 00100/00000/00000
d D 1.1 83/01/20 11:15:50 tes 1 0
c date and time created 83/01/20 11:15:50 by tes
e
u
tes
mjb
U
t
T
I 1
subroutine sqshgr
########################################################################
#                                                                      #
#          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: Rearrange graph common area to eliminate blank values  #
#                                                                      #
#     Input Parameters:                                                #
#            none -                                                    #
#                                                                      #
#     Output Parameters:                                               #
#            none                                                      #
#                                                                      #
#     Routines Called:                                                 #
#            none                                                      #
#                                                                      #
########################################################################
D 2
integer i, j, maxdef, labdef
E 2
I 2
integer i
E 2

include(`gphcom')

D 2
   call squish (bgdta1, 5, ntpray(1))  # squish curve one etc.
   call squish (bgdta2, 5, ntpray(2)) 
   call squish (bgdta3, 5, ntpray(3)) 
   call squish (bgdta4, 5, ntpray(4)) 
   call squish (bgdta5, 5, ntpray(5)) 
E 2
I 2
   call squish (bgdta1, bgddef(1))  # squish curve one etc.
   call squish (bgdta2, bgddef(2)) 
   call squish (bgdta3, bgddef(3)) 
   call squish (bgdta4, bgddef(4)) 
   call squish (bgdta5, bgddef(5)) 
E 2

D 2
   call squish (bglabl, 4, labdef)
   
   do i = 1,5 { bgddef(i) = ntpray(i) }

E 2
   # Determine a default cluster factor for bar charts
   if (bgclus < 0 & bctype != BAR) {
       bgclus = 1
       }
   else if (bgclus < 0 & bctype == BAR) {   
      bgclus = 0
      do i = 1, 5 {
         if (bgddef(i) > 0) bgclus = bgclus + 1
         }
      }

D 2
   maxdef = max0 (ntpray(1), ntpray(2), ntpray(3), ntpray(4), ntpray(5))

   if (labdef > maxdef) {
      j = maxdef*4 + 1
      for (i=maxdef+1;i<=labdef; i=i+1) {
         bglabl(j) = NUL   # blank out remaining labels
         j = j + 4
         }
      }
E 2
   return
end
D 2
subroutine squish(indata, length, kdata)
SHORTINT indata(1)
integer length, kdata, start
E 2
I 2
subroutine squish(indata, kdata)
SHORTINT indata(1), kdata
integer start
E 2

integer kdptr1, kdptr2, ind, i, k, j, n

   i = 1 
   ind = 0
   while (indata(i) != NUL) {  # Search for first null value
      ind = ind + 1
D 2
      i = i + length
E 2
I 2
      i = i + 5
E 2
      }

   kdata = ind
D 3
   if (ind > 0 ) {
D 2
      kdptr1 = (ind)*length + 1  # initialize data pointers
      kdptr2 = kdptr1 + length
E 2
I 2
      kdptr1 = (ind)*5 + 1  # initialize data pointers
      kdptr2 = kdptr1 + 5
E 3
E 2

D 3
      start = ind+1
      do i = start, 74 {
E 3
I 3
   kdptr1 = (ind)*5 + 1  # initialize data pointers
   kdptr2 = kdptr1 + 5

   start = ind+1
   do i = start, 74 {
E 3
   
D 3
         if (indata(kdptr2) != NUL) { # Swap with null value
E 3
I 3
      if (indata(kdptr2) != NUL) { # Swap with null value
E 3
                                       
D 3
             k = kdptr2
D 2
             n = kdptr1 + length
E 2
I 2
             n = kdptr1 + 5
E 2
             do j = kdptr1, n {
                indata(j) = indata(k)    # Copy into null area
	        k = k + 1
	        }
E 3
I 3
         k = kdptr2
         n = kdptr1 + 5
         do j = kdptr1, n {
            indata(j) = indata(k)    # Copy into null area
	    k = k + 1
	    }
E 3
   
D 3
             indata(kdptr2) = NUL        # Blank out data from moved area
E 3
I 3
         indata(kdptr2) = NUL        # Blank out data from moved area
E 3
   
D 2
             kdptr1 = kdptr1 + length
E 2
I 2
D 3
             kdptr1 = kdptr1 + 5
E 2
             kdata = kdata + 1       # Set the number of data points defined
             }
   
D 2
         kdptr2 = kdptr2 + length  
E 2
I 2
         kdptr2 = kdptr2 + 5  
E 3
I 3
         kdptr1 = kdptr1 + 5
         kdata = kdata + 1       # Set the number of data points defined
E 3
E 2
         }
I 3
   
      kdptr2 = kdptr2 + 5  
E 3
      }
D 3
return
E 3
I 3
   return
E 3
end
E 1
