/* REXX -- converted to REXX on 1994/06/03 */ ADDRESS "ISREDIT" /* TITLE: GML -- ENCLOSE 2ND OPERAND WITHIN GML TAGS */ /* USERS: SCRIPT USERS */ /* CONTRIBUTED: 1988/04/09 DAVID MCRITCHIE */ /* related clists: ungml -- to changes ";" to "&semi" etc. */ /* or reverses process */ /* */ /* EXAMPLE: ===> gml hp1 'not' word nx */ /* === ------- */ /* --GENERATES-- */ /* C ALL word nx 'not' ':hp1.not:ehp1.' */ /* ------- === === */ /* ampersands can be handled by quadrupling them */ /* since this is now REXX, I will do that for you. */ /* e.g. ===> gml hp1 AT&.T */ /* appears to generate */ /* c all AT&.T :hp1.AT&.T:ehp1. */ /* actually generates.. */ /* c all AT&&&&.T :hp1.AT&&&&.T:ehp1. */ /* */ "MACRO (GML,FROM,TOKENS)" IF from = "" then do ZEDSMSG = "INCORRECT" ZEDLMSG = "2 operands REQUIRED e.g. ==> gml hp1 STRING1" GGG = "generates ---> c all " call note "*ERROR**" ZEDLMSG call note "example ===> gml hp2 FORTRAN word" call note " or ===> gml hp2 'FORTRAN' word" call note GGG "word 'FORTRAN' ':hp2.FORTRAN:ehp2.'" call note " " call note "example ===> gml hp2 ""FORTRAN"" word" call note GGG "word ""FORTRAN"" "":hp2.FORTRAN:ehp2.""" Address "ISPEXEC" "SETMSG MSG(ISRZ000)" "LOCATE 0" Exit 4 END GML = translate(gml,"abcdefghijklmnopqrstuvwxyz", , "ABCDEFGHIJKLMNOPQRSTUVWXYZ") Q = left(FROM,1) IF Q = '"' | Q = "'" then do /* " ' so matches on this line*/ L = LENGTH(from) call note "length("from") =" L If right(from,1) = Q then FROM = SUBSTR(from,2,l-2) ELSE SET Q = "" END ELSE Q = "" xxx="Change all" TOKENS Q||FROM||Q Q||":"GML"."from":e"gml"."||Q call note "GML--" xxx i = pos('&',xxx) if i \= 0 then do newxxx="" /* ampersands will be quadrupled for transparency*/ do i=1 to length(xxx) if substr(xxx,i,1) = '&' then newxxx=newxxx||'&&&&' else newxxx = newxxx||substr(xxx,i,1) end call note "The actual command required/entered by macro will be..." call note " --" newxxx xxx=newxxx end xxx /* <--- this is where command is actually invoked */ call note time("n") "-- gml" GML TOKENS Q||FROM||Q return note: parse arg arg "LINE_BEFORE .ZFIRST = NOTELINE (arg)" return