Converting FORMS 1.2 to 1.3

mcdonald at AEDC-VAX.AF.MIL mcdonald at AEDC-VAX.AF.MIL
Wed May 15 23:17:32 AEST 1991


The following is a short shell script for converting FORMS 1.2 programs to
FORMS 1.3 programs.  There are three files with this:

   CNV - The conversion script
   CONVERT.lower - listing of lowercase strings to replace
   CONVERT.upper - listing of UPPERCASE strings to replace

I was going to us ed to do the replacement, but ed would not continue if it
hit a string that was not in the file; so I used perl instead!

All you need to do is unarchive this by saving the contents below in a file,
and then sh filename.  To run it type CNV formsfile.c.

------------------------------ < CUT HERE > -----------------------------------
#! /bin/sh
# This is a shell archive.  Remove anything before this line, then unpack
# it by saving it into a file and typing "sh file".  To overwrite existing
# files, type "sh file -c".  You can also feed this as standard input via
# unshar, or by typing "sh <file", e.g..  If this archive is complete, you
# will see the following message at the end:
#               "End of shell archive."
# Contents:  CNV CONVERT.lower CONVERT.upper
# Wrapped by c60244 at ccfiris.aedc on Wed May 15 07:59:37 1991
PATH=/bin:/usr/bin:/usr/bsd ; export PATH
if test -f 'CNV' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'CNV'\"
else
echo shar: Extracting \"'CNV'\" \(300 characters\)
sed "s/^X//" >'CNV' <<'END_OF_FILE'
X#!/bin/sh
XFILE=$1
Xcp ${FILE} ${FILE}.orig
Xfor item in `cat CONVERT.lower`
Xdo
X    SEARCH=$item
X    REPLACE=fl_${item}
X    perl -pi -e "s/${SEARCH}/${REPLACE}/;" $FILE
Xdone
Xfor item in `cat CONVERT.upper`
Xdo
X    SEARCH=$item
X    REPLACE=FL_${item}
X    perl -pi -e "s/${SEARCH}/${REPLACE}/;" $FILE
Xdone
END_OF_FILE
if test 300 -ne `wc -c <'CNV'`; then
    echo shar: \"'CNV'\" unpacked with wrong size!
fi
chmod +x 'CNV'
# end of 'CNV'
fi
if test -f 'CONVERT.lower' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'CONVERT.lower'\"
else
echo shar: Extracting \"'CONVERT.lower'\" \(333 characters\)
sed "s/^X//" >'CONVERT.lower' <<'END_OF_FILE'
Xactivate_
Xadd_
Xaddto_
Xbgn_
Xblkqread
Xcheck_
Xclear_
Xcreate_
Xcurrent_
Xdeactivate_
Xdelete_
Xdeselect_
Xdisplay_
Xdo_
Xdraw_
Xdrw_
Xend_
Xfind_
Xfreeze_
Xget_
Xgetmcolor
Xhandle_
Xhide_
Xinsert_
Xisqueued
Xisselected_
Xload_
Xmake_
Xmapcolor
Xnew_
Xqdevice
Xqenter
Xqread
Xqreset
Xqtest
Xredraw_
Xremove_
Xreplace_
Xselect_
Xset_
Xshow_
Xtie
Xunfreeze_
Xunqdevice
Xunset_
END_OF_FILE
if test 333 -ne `wc -c <'CONVERT.lower'`; then
    echo shar: \"'CONVERT.lower'\" unpacked with wrong size!
fi
# end of 'CONVERT.lower'
fi
if test -f 'CONVERT.upper' -a "${1}" != "-c" ; then 
  echo shar: Will not clobber existing file \"'CONVERT.upper'\"
else
echo shar: Extracting \"'CONVERT.upper'\" \(537 characters\)
sed "s/^X//" >'CONVERT.upper' <<'END_OF_FILE'
XALIGN_
XALL_FREE
XALWAYS_
XBEGIN_
XBITMAP_
XBOLD_
XBORDER_
XBOT_
XBOUND_
XBOX_
XBROWSER_
XBUTTON_
XCALLBACKPTR
XCHOICE_
XCLOCK_
XCONTINUOUS_
XCOUNTER_
XDIAL_
XDOWN_
XDRAWPTR
XEND_
XENGRAVED_
XEVENTCALLBACKPTR
XFIND_
XFIXED_
XFLAT_
XFONT_
XFORM
XFRAME_
XHANDLEPTR
XHIDDEN_
XHOLD_
XHOR_
XINOUT_
XINPUT_
XITALIC_
XKEYBOARD
XLABEL_
XLARGE_
XLEAVE
XLEFT_
XLIGHTBUTTON_
XLINE_DIAL
XMENU_
XMOVE
XMULTI_
XNORMAL_
XNO_
XOBJECT
XPLACE_
XPOSITIONER_
XPUSH_
XRADIO_
XRELEASE
XRETURN_
XRIGHT_
XROUNDBUTTON_
XROUND_
XSELECT_
XSHADOW_
XSLEEPING_
XSLIDER_
XSMALL_
XSQUARE_
XSTEP
XTEXT_
XTOP_
XTOUCH_
XUP_
XVALSLIDER
XVERT_
END_OF_FILE
if test 537 -ne `wc -c <'CONVERT.upper'`; then
    echo shar: \"'CONVERT.upper'\" unpacked with wrong size!
fi
# end of 'CONVERT.upper'
fi
echo shar: End of shell archive.
exit 0
------------------------------ < CUT HERE > -----------------------------------

  vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  | Kenneth M. McDonald * OAO Corp * Arnold Engineering Development Center |
  |          MS 120 * Arnold AFS, TN 37389-9998 * (615) 454-3413           |
  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  INTERNET:
  mcdonald at aedc-vax.af.mil

  LOCAL:
  c60244 at ccfiris



More information about the Comp.sys.sgi mailing list