home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / 3b1 / 4179 < prev    next >
Encoding:
Text File  |  1993-01-06  |  1.4 KB  |  62 lines

  1. Newsgroups: comp.sys.3b1
  2. Path: sparky!uunet!psinntp!monymsys!sonyd1.broadcast.sony.com!hico2!kak
  3. From: kak@hico2.westmark.com (Kris A. Kugel)
  4. Subject: shform question: Self-modifing menus?
  5. Message-ID: <C0D7Lt.16K@hico2.westmark.com>
  6. Keywords: shform menu form 3b1 unixpc 7300
  7. Reply-To: query@hico2.westmark.com
  8. Organization: High Country Software
  9. Date: Tue, 5 Jan 1993 05:08:15 GMT
  10. Lines: 50
  11.  
  12.  
  13. This is a question for people who've messed around with shform.
  14.  
  15. I'd like to be able to modify a sub-menu while I'm running
  16. a form in shform.  If I can get a menu to use a menu defined
  17. in another file for one of its submenus, I think I can swing
  18. it reasonably easily, as shown below.
  19. I figure a separate menu can be kept pretty simple,
  20. and thus easy to modify automaticly.
  21. But editing form1.form on the fly would be pretty messy.
  22.  
  23. Anybody out there who's fooled around with shform
  24. know if there is some way to do this, or if 
  25. there's an easy way of mantaining a modifable sub-menu?
  26.  
  27. Kris A. Kugel    908-842-2707
  28. hico2!query    query@hico2.westmark.com
  29.  
  30. status='rerun'
  31.  
  32. while [ status == 'rerun' ]
  33. do
  34.     status='exit'
  35.     RET=`shform -u form1.form`
  36.     ...
  37.     eval set $RET
  38.  
  39.     case $1 in
  40.         Creat)
  41.  
  42.         RET=`shform -u form2`
  43.         if [ "$?" != "0" ]
  44.         then
  45.             message $ERROR1
  46.             exit
  47.         fi
  48. #
  49. # now, let's say you want to add any uniq new entries.
  50. #
  51.         if fgrep "Name=$2" menu2
  52.         then
  53.             ;
  54.         else
  55.             # (use the returned information to update menu2)
  56.             echo "Name=$2" >> menu2
  57.         fi
  58.         status='rerun'
  59.         ;;
  60.     ...
  61. done
  62.