For Unidata :

EDITG - Edit a globally cataloged program and also look in several other places




*<PROGRAM.TYPE>UTILITY</PROGRAM.TYPE><LANGUAGE.CONVERT>NO</LANGUAGE.CONVERT><ROLL.TO.DEAD.CODE>NO</ROLL.TO.DEAD.CODE>
$BASICTYPE 'U'
* EDITG
*<com>-----------------------------------------------------------------
* Written By : George Hammerle                    Date : 11/19/08
*
* Purpose : Edit the program pointed to by the global catalog and
*           also check the SBPROCESSes.
*
* Send In  : nothing
*
* Send Out : noting
*
* Usage : from TCL  ->   EDITG [filename]
*
* Modifications :
*
*  10/07/11  George Hammerle
*    - added looking in the SB+ processes.
*
*  10/12/11  George Hammerle
*    - added looking in VOCs and VOCLIB and SB+ menus.

*
*</com>----------------------------------------------------------------

PROMPT ""
THE.SENTENCE = TRIM(@SENTENCE)

PROGRAM.NAME  = FIELD(THE.SENTENCE," ",2,1)
IF TRIM(PROGRAM.NAME) = "" THEN
  RETURN
END


* Just a file open sub that uses a common to store opened files.
CALL *DC.OPEN.FILE.500( "CTLGTB", '', FV.CTLGTB, CTLGTB.SUCCESS )
IF CTLGTB.SUCCESS = 0 THEN
  RETURN
END

THIS.FILE = ''

READ R.CTLGTB FROM FV.CTLGTB,PROGRAM.NAME ELSE R.CTLGTB = ''
IF R.CTLGTB = '' THEN

        * This is where I look in the SB Processes, SB Menus, VOCLIBs, VOCS
        * Code omitted 

END ELSE
  PATH = R.CTLGTB<3>
  SWAP "/" WITH @VM IN PATH
  NUM.SLASHES = DCOUNT(PATH<1>,@VM)

  FILE.PROGRAM = PATH<1,NUM.SLASHES>

  SWAP " " WITH @VM IN FILE.PROGRAM

  THIS.FILE = FILE.PROGRAM<1,1>
  THIS.PROGRAM = FILE.PROGRAM<1,2>
  IF THIS.PROGRAM # PROGRAM.NAME THEN
    * I don't think this should ever happen but
    CRT "ERROR - THIS.PROGRAM # PROGRAM.NAME"
    RETURN
  END
END


PERFORM 'ED ':THIS.FILE:" ":PROGRAM.NAME



RETURN
*<com>------------------------------------------------------------------
*----------------------------- G O S U B S -----------------------------
*</com>-----------------------------------------------------------------

                                George Hammerle 
                                Programming Dude 
                                Hubert Company LLC. 
                                9555 Dry Fork Road 
                                Harrison, Ohio 45030 
                                513-367-8974 
                                zhammerle@hubertREMOVE_THIS.com 




This e-mail and any files transmitted with it are confidential and intended
solely for the use of the individual or company to whom they are addressed. If
you have received this e-mail in error, please notify the sender immediately and
delete this e-mail including all attachments from your system. Thank you
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to