AtChangeType=["]ChangeType["] |
This #option command lets you alter the way #AsIs and #AutoTag commands will perform replacements. The default method (by default) is a simple case sensitive replacement of text.
Note that this command actually changes the way the #AutoTag stores the change and will only affect the replacement of those changes defined after this option was used.
This command allows new alternative search and replace mechanisms to be slotted in without affecting any existing ones (clashing syntax etc). This method was chosen so that PPWIZARD could remain as fast as possible (it is written in rexx and so keeping performance reasonable sometimes takes compromises).
The "ChangeType" parameter can be one of the following:
If you have some fantastic free PURE REXX search and replace code then I can include it as a new PPWIZARD extension if you send me the code!
Example 1 |
#AutoTag "AAAA" "XXXX" ;;Change upper case "AAAA" only (assuming default mode) ;--- Use ReplaceStringCI() --------------- #option PUSH AtChangeType=CaseInsensitive #AutoTag "BBBB" "YyYy" ;;Change "bbbb" in any case #AutoTag "CCCC" "({*})" ;;If "cccc" in any case is found then surround it by brackets ;--- Use CompareReplaceFixed() ----------- #option AtChangeType="FIXED" #AutoTag '@=,1=^HTML^@=,5=+x+' 'REM CS->@$1,*;' ;;Case sensitive compare for "HTML" then "x" #AutoTag '!i@=,1=^HTML^!S@=,-1=+x+' 'REM CI->@$1,*;' ;;Case insensitive comapre for "HTML" + sensitive compare for "x" #AutoTag '!L!i@=,1=^HTML^!S@=,5=+x+' 'REM CI+spaces->@$1,*;' ;;Same as above but ignoring whitespace (leading) #option POP ;;Restore mode (PUSH/POP useful where original mode unknown etc)