Re: 4GL Help Numbers: Yuchh!
Posted in 1997
In <E97B7u.H7D@nonexistent.com>, Jacob Salomon wrote:
<snip>
>Since I first experienced the 4GL HELP mechanism, with its help numbers
>hard-coded in the 4GL code, I have wished for help labels as strings. >With strings I can use some kind of acronym for what the help message
>means, which module or component of the application the help message is
>for. I entered a feature request for such a modification to the help
>mechanism AGES ago but that has vanished down the oubliette.
>
>FourGen used a 4-part composite key (OK, 3 parts identify the body of
>help text) and this sounds pretty good in principle. However, the
>application I want to add help to was not generated with FourGen so >this would be a mighty big wheel to reinvent.
>
<snip>
Jake,
If you are willing to use cpp, then you have a way. Define macros in a
*.h file and include it in your *.4gl and *.hlp, do cpp for these files
with cpp -P "file_name" > pp"file_name", then use use pp"file_name" for
c4gl / fglpc / mkmessage.
In the attached example, you can find m.h m.4gl m.hlp files. If you do :
cpp -P m.4gl > ppm.4gl
cpp -P m.hlp > ppm.hlp
mkmessage ppm.hlp m.msg
c4gl ppm.4gl -o m.4ge / fglpc ppm.4gl
you could see how it works.
--
Have a nice day
Felix K. Mathews
fmathews@systems.dhl.com
#-------------------------- Shell Archive Begins Here ------------------
# This is a shell archive. Remove anything before this line,
# then unpack it by saving it in a file and typing "sh file".
#
# Wrapped by Felix Mathews <fmathews@quasar> on Fri Apr 25 12:12:33 1997
#
# This archive contains:
# m.h m.4gl m.hlp
#
LANG=""; export LANG
PATH=/bin:/usr/bin:/usr/sbin:/usr/ccs/bin:$PATH; export PATH
echo x - m.h
cat >m.h <<'@EOF'
#define DESC_HLP 101
@EOF
chmod 664 m.h
echo x - m.4gl
cat >m.4gl <<'@EOF'
#include "m.h"
main
define desc char(255)
open form frm01 from "m"
options help key F2,
help file "ppm.msg"
display form frm01
input by name desc help DESC_HLP
on key (F10)
exit input
end input
display desc sleep 2
end main
@EOF
chmod 664 m.4gl
echo x - m.hlp
sed 's/^@//' >m.hlp <<'@EOF'
#include "m.h"
@.DESC_HLP
This is all you get in help
Okay.
@EOF
chmod 664 m.hlp
exit 0