h48308
s 00001/00001/00083
d D 1.3 83/03/04 13:24:44 mjb 3 2
c 
e
s 00003/00002/00081
d D 1.2 83/02/18 00:36:47 mjb 2 1
c fixed numerous bugs with insertion and pie data in general
e
s 00083/00000/00000
d D 1.1 83/01/20 11:16:04 tes 1 0
c date and time created 83/01/20 11:16:04 by tes
e
u
tes
mjb
U
t
T
I 1
subroutine sqshpi
########################################################################
#                                                                      #
#          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 pie common area to eliminate blank values    #
#                                                                      #
#     Input Parameters:                                                #
#            none -                                                    #
#                                                                      #
#     Output Parameters:                                               #
#            none                                                      #
#                                                                      #
#     Routines Called:                                                 #
#            none                                                      #
#                                                                      #
########################################################################
integer i, ind1, ind2, k, j, m, n

include(`gphcom')

   i = 1 
   ind1 = 0
   ind2 = 8
D 3
   while (bpdata(i) != NUL) {  # Search for first null value
E 3
I 3
   while (bpdata(i) != NUL & ind1 < 16) {  # Search for first null value
E 3
      ind1 = ind1 + 1
      i = i + 5
      }

   if (ind1 < 8) {             # Only "squish" if first page not full
      i = 41
D 2
      while (bpdata(i) != NUL) {  # While second page of menu has valid
                                   # values move them to first page
E 2
I 2
      while (bpdata(i) != NUL & i <= 80) { 
      # While second page of menu has valid
      # values move them to first page
E 2
	 k = i
         m = ind1*5 + 1
	 n = m + 5
	 do j = m, n {
	    bpdata(j) = bpdata(k)
	    k = k + 1
	    }
 
	 k = ind2*19 + 1
         m = ind1*19 + 1
	 n = m + 18
	 do j = m, n {
	    bplabl(j) = bplabl(k)
	    k = k + 1
	    }
 
	 k = ind2*2 + 1
         m = ind1*2 + 1
	 bpexfg(m) = bpexfg(k)
 
         bpslcl(ind1+1) = bpslcl(ind2+1)
         bpslfl(ind1+1) = bpslfl(ind2+1)
 
	 i = i + 5
	 ind1 = ind1 + 1
	 ind2 = ind2 + 1
	 }
      }
   
   bpddef = ind1     # Set the number of defined values

   for (i = ind1; i <16; i = i+1) { # Blank out remaining slices
      n = i*5 + 1
      bpdata(n) = NUL
      n = i*19 + 1
      bplabl(n) = NUL
      n = i*2 + 1
      bpexfg(n) = BIGN
      bpslcl(i+1) = 1
      bpslfl(i+1) = 0
      }

return
end
E 1
