Path: utzoo!censor!geac!torsqnt!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!munnari.oz.au!cluster!ultima!fidogate From: garth_kidd@f813.n680.fido.oz (garth kidd) Newsgroups: comp.lang.c Subject: I want the ultimate robust float input routine Message-ID: <17472@ultima.cs.uts.oz> Date: 24 Feb 90 16:50:00 GMT Sender: fido@ultima.cs.uts.oz Organization: A Fidonet node, gated through ultima.cs.uts.oz Lines: 63 Original to: dmocsny > While I'm shamelessly begging, how about a nicely > implemented > method to provide context-sensitive on-line help? My > current > method is unspeakably hideous, but easy to implement. I had a help() routine that you called if the user asked for help. It was used in a lot of my routines, most importantly the routine listMgr() that handled scrolling lists of information... help() looked at the global variable (char **)curHelp for the information to display. So, for each major area of the program, I'd... /* outside the routine */ char **fooHelp = { "Line 1", "Line 2", "Line 3", NULL }; /* and inside */ curHelp=fooHelp; Worked a treat! The help() routine used listMgr() to display the help, so I had to do some workarounds... a static variable in help() called helpLevel, and this workaround in help(): if(helpLevel==2) return; helpLevel++; oldHelp=curHelp; curHelp=helpOnHelp; /* ... code to call listMgr, etc */ curHelp=oldHelp; helpLevel--; return; So, if I asked for help whilst somewhere, helpLevel would become 1, curHelp would be helpOnHelp, and listMgr() would be invoked. If help was asked for again from within listMgr (the user hit ?), helpLevel would become 2, and the help on help would be displayed via listMgr(). Any further attempts to get help on help on help would be ignored until the user dropped back... Hope this help()ed. :-) gk --- FD 1.99b * Origin: JC's UnderWater BBS - You want tech? You got it! (3:680/813)