home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sys.3b1
- Path: sparky!uunet!psinntp!monymsys!sonyd1.broadcast.sony.com!hico2!kak
- From: kak@hico2.westmark.com (Kris A. Kugel)
- Subject: shform question: Self-modifing menus?
- Message-ID: <C0D7Lt.16K@hico2.westmark.com>
- Keywords: shform menu form 3b1 unixpc 7300
- Reply-To: query@hico2.westmark.com
- Organization: High Country Software
- Date: Tue, 5 Jan 1993 05:08:15 GMT
- Lines: 50
-
-
- This is a question for people who've messed around with shform.
-
- I'd like to be able to modify a sub-menu while I'm running
- a form in shform. If I can get a menu to use a menu defined
- in another file for one of its submenus, I think I can swing
- it reasonably easily, as shown below.
- I figure a separate menu can be kept pretty simple,
- and thus easy to modify automaticly.
- But editing form1.form on the fly would be pretty messy.
-
- Anybody out there who's fooled around with shform
- know if there is some way to do this, or if
- there's an easy way of mantaining a modifable sub-menu?
-
- Kris A. Kugel 908-842-2707
- hico2!query query@hico2.westmark.com
-
- status='rerun'
-
- while [ status == 'rerun' ]
- do
- status='exit'
- RET=`shform -u form1.form`
- ...
- eval set $RET
-
- case $1 in
- Creat)
-
- RET=`shform -u form2`
- if [ "$?" != "0" ]
- then
- message $ERROR1
- exit
- fi
- #
- # now, let's say you want to add any uniq new entries.
- #
- if fgrep "Name=$2" menu2
- then
- ;
- else
- # (use the returned information to update menu2)
- echo "Name=$2" >> menu2
- fi
- status='rerun'
- ;;
- ...
- done
-