!PAMSET: set user selection of GROUPSEP and KEYFLAG
include  "inc:util.imp"
begin 
integer  i,j,k
integer  char1,char2,sym
predicate  ok(integer  char)
  false  if  char < ' '
  false  if  'a' <= char!32 <= 'z'
  false  if  '0' <= char <= '9'
  false  if  char = '!' or  char = ','
  true 
end 
  prompt("GroupSeparator then Keyflag:")
  cycle 
    cycle 
      readsymbol(sym);  char1 = sym
      if  char1 >= ' ' start 
        readsymbol(sym);  char2 = sym
        if  char2 >= ' ' start 
          readsymbol(sym)
          exit  if  sym = nl
        finish 
      finish 
      printstring(" Definition must be precisely two symbols then RETURN")
      newline
    repeat 
    if  ok(char1) start 
      if  ok(char2) start 
        if  char2 # ' ' start 
          exit  if  char2 # char1
          printstring(" Choices must be different")
        else 
          printstring(" Keyword flag cannot be space")
        finish 
      else 
        printstring(" ".tostring(char2)." is not a valid choice")
      finish 
    else 
      printstring(" ".tostring(char1)." is not a valid choice")
    finish 
    newline
    readsymbol(sym) while  sym # nl
  repeat 
  pam_groupsep = char1
  pam_keyflag = char2
endofprogram