h25884
s 00003/00003/00052
d D 1.2 83/02/07 11:24:35 mjb 2 1
c if deffed all stops in these routines
e
s 00055/00000/00000
d D 1.1 83/01/20 11:14:30 tes 1 0
c date and time created 83/01/20 11:14:30 by tes
e
u
tes
mjb
U
t
T
I 1
subroutine qnewid (buffer)
########################################################################
#                                                                      #
#          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: Define a menu id from given buffer                     #
#                                                                      #
#     Input Parameters:                                                #
#            buffer - (byte) buffer containing menu id                 #
#                                                                      #
#     Output Parameters:                                               #
#            None                                                      #
#                                                                      #
#     Routines Called:                                                 #
#            ktoi - convert character to integer                       #
#            pmnitm - put a menu item to memory                        #
#            pfditm - put a field item to memory                       #
#                                                                      #
########################################################################
SHORTINT buffer(1)

SHORTINT zero
integer i, value, iend

include(`mnucom')

data zero /0/

# an id has the form "{<integer>}"
#    so we start converting the integer in the second position of the string
call ktoi (buffer, 2, value, iend)
if (value > 0) {
   i = 1
   while (i <= lastid) {   # insure that the item has not been already defined
D 2
      if (value == mnuid(i)) {
E 2
I 2
      ifdef(`UNIX',`if (value == mnuid(i)) {
E 2
         stop 101   # item number already defined
D 2
         }
E 2
I 2
         }')
E 2
      i = i + 1
      }
D 2
   if (i > MAXMENUS) stop 102   # menu is full
E 2
I 2
   ifdef(`UNIX',`if (i > MAXMENUS) stop 102')   # menu is full
E 2
   lastid = i
   mnuid(i) = value
   call pmnitm (zero)
   call pfditm (zero)
   midptr(i) = mfrept
   fldptr(i) = ffrept
   }
return
end
E 1
