Re: 4gl Libraries (rather long)
Posted in 1998
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Jobs, Consulting & Announcements
joshua@oklahoma.net escribi' en art'culo <3537c7bf.87198894@news.tulsa.oklahoma.net>... > I am in a one man shop, RISC 6000, Informix 4gl Rel 4.11. > I am having problem finding out how to maintain a library of 4gl or C > subroutines. It appears that my predacessor could not find out either. > There are several "common" routines that have been copied into numerous > programs rather than being placed into a library somewhere. I have the > following 4gl scripts or modules C4GL R4GL script and I4GL. I am able > to create object linkable files, but unable to get them to compile > into MAIN progs. My manuals are Ref Man 4.0. > I use the following script, which i call comx. You can have to edit it to list the modules and libraries you want after the c4gl, and the forms after form4gl. Here i use /usr/foo/prog/source/lib as the library path, and foo00.4gl, foo10.4gl, foo.per as modules and form, as an example. You can call comx without parameters, then you can select which program to compile (from the .o's created by i4gl), or call it with 1 parameter (the number of the program to compile), or with 2 parametres (the second one is the extension from you want to compile (.o is default), useful when you still don't have .o's. It is easy to adapt to r4gl. Hope that helps. Xavi comx : op=$1 if [ $# -gt 1 ]; then case $2 in o) : ;; 4gl) : ;; *) echo "Invalid extension . Must be '4gl' or 'o' " exit 1 ;; esac extensio=$2 else extensio=o fi stat=1 while true do case $op in "") clear echo " +--------------------------------------------+" echo " |\\033[7m .4gl ----> .4ge \\033[0m|" echo " |\\033[7m Compilation of modules/forms \\033[0m|" echo " |--------------------------------------------|" echo " | ( 1) - Program foo |" echo " | ( 0) - EXIT |" echo " +--------------------------------------------+" echo " Choose program to compile&link [ ]\\c" read op echo esac case $op in 0) exit 0;; 1) progr=foo c4gl ${progr}00.$extensio \\ ${progr}10.$extensio \\ /usr/foo/prog/source/lib/libgl.o \\ /usr/foo/prog/source/lib/liberr.o \\ /usr/foo/prog/source/lib/libprint.o \\ -o $progr.4ge result=$? stat=0;; *) break;; esac if [ $result -eq 0 ]; then echo $progr.4ge compiled - use $progr.sh to run it else echo "\\033[7m ERROR : unable to create $progr.4ge \\033[0m" fi if [ -f *.c ] ; then rm *.c fi if [ -f *.ec ] ; then rm *.ec fi result=0 case $op in 1) form4gl -q ${progr}.per result=`expr $result + $?` ;; esac if [ $result -eq 0 ]; then echo Forms for $progr compiled else echo "\\033[7m ERROR : Unable to compile forms for $progr \\033[0m" fi exit $stat echo "Press any key to resume \\c" read res done exit $stat