PPWIZARD is a free preprocessor for HTML, REXX, Visual Basic or any text files.
[Bottom][Contents][Search][Prev]: {$!Keywords} - Die If Keyword Parameters used[Next]: {<?x24>??} - Expand All Parameters As Rexx Code
\ -> Macros -> Special Parameters -> {$?} - Expand All Unused Parameters

{$?} - Expand All Unused Parameters

The subject of macros is reasonably complex (but well worth learning) please ensure you have at least read the macro introduction before reading this section.

This special action allows you to expand all unused parameters, this can be useful for passing parameters though your macro and onto another macro or into a html tag.

For an example it allows you to create a ppwizard macro that may generate a html tag and process any parameters you wish while "passing on" any parameters to the HTML tag.

The output will be preceeded by a space if it is non-empty (there were unused parameters).

This is a very simplistic example macro which generates a html "IMG" tag:

#define  IMG   <IMG SRC="graphics/{$FILE}" ALT="{$ALT='{$FILE}'}"{$?}>

<$IMG File="some.gif" ALT=~Some Alt Text~ Height=^10^ Width=^10^>

Notice the "{$?}" tag above, it will expand all parameters used on a reference except "FILE" and "ALT". You can also use "{$?ResetUsed}" if you want to process all parameters (used or not).

If there are specific parameters that you don't want included (as yet unused) then you should preceed this command with the parameter using '$$IGNORE'. If there were no parameters then nothing is expanded else a space preceeds the resultant parameter.

To allow you to use it any number of times, this parameter does not mark all the parameters as used. It does however disable any {$!} validation for the macro.

3 Modes & Using $$ Special Commands

Behavior varies based on whether (and which) "$$" Commands are used:

  1. No $$ Commands
    If you look at the example above again you should see that the height & width parameters were quoted with "^" on the macro and "{$?}" had no parameters.

    The reason the image tag was generated "OK" was because each parameter is re-quoted with virtually any rareish character and it used double and single quotes in preference.

    If any single parameter contained both single and double quotes then it may have been quoted with let's say "~" and this would not work as html. As an example:

    #define  IMG   <IMG SRC="graphics/{$FILE}" ALT="{$ALT='{$FILE}'}"{$?}>
    
    <$IMG File="some.gif" InvalidOnImg=@Fictional img parm (with both quotes: '")@>
    

    As no error will have been generated, you will have to hope someone noticies it somehow during testing.

  2. $$ Commands were passed
    By default if "$$" commands are passed then these are applied against each parameter's value (individually unlike most of similar "$$" commands).

    In the above example the html tag generated wasn't correctly quoted, to generate an error message you could do this (as "$$PASSDSQ" will fail):

    #define  IMG   <IMG SRC="graphics/{$FILE}" ALT="{$ALT='{$FILE}'}"{$? $$PASSDSQ}>
    
    <$IMG File="some.gif" InvalidOnImg=@Fictional img parm (with both quotes: '")@>
    

    Now since the tag containing both quotes can't be correctly quoted you will now to informed when the quoting fails.

  3. $$ Commands begin with "$$1"
    As mentioned above "$$" commands are processed over each parameter's value, to restore "normal" operation and process the whole string you can use "$$1" to indicate that you want it to process once (over the complete string).

    This could be useful if you want to store the unused parameters in a rexx variable as shown here:

    #DefineRexx '@@Rexx4FileFindInListedDirs'
       ;--- Get parameters specific to this command -----------------------------
       {$DIRS        $$RxVar:@@Dirs}
       {$Abort=^^    $$RxVar:@@Abort}        ;;Will abort by default
    
       ;--- Get parameters that are shared --------------------------------------
       {$File               $$RxVar:@@File}
       {$Property           $$RxVar:@@Property}
       {$Depth=^Ignored^    $$RxVar:@@DepthIgnored}   ;;We hardcode this value
       {$Path=^Ignored^     $$RxVar:@@PathIgnored}    ;;Use values from "Dirs"
       {$Default=^Ignored^  $$RxVar:@@DefaultIgnored} ;;We hardcode this value
    
       ;--- Get all other parameters, these will be passed to "FindFile" --------
       @@AllOthers = '{$? $$1 $$SQX2}'
    
           ...
    
       ;--- Use the other parameters (@@AllOthers) ------------------------------
       @@FF = @@FF || '<' || '$FileFind '
       @@FF = @@FF || '       File=~' || @@File || '~ '
       @@FF = @@FF || '   Property=~' || @@Property || '.' || @@i || '~ '  ;;WSCRIPT.EXE.1 etc
       @@FF = @@FF || '       Path=~[' || @@Dir  || ']~ '
       @@FF = @@FF || '       Depth="0" Default="" '
       @@FF = @@FF || @@AllOthers
       @@FF = @@FF || '><?NewLine>'
    #DefineRexx
    


email me  any feedback, additional information or corrections.
See this page online (look for updates)

[Top][Contents][Search][Prev]: {$!Keywords} - Die If Keyword Parameters used[Next]: {$??} - Expand All Parameters As Rexx Code


PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Saturday May 28 2022 at 2:55pm