PPWIZARD Manual
[Bottom][Contents][Search][Prev]: #Warning[Next]: Standard Definitions

#Unknown Commands

Normally ppwizard dies if you specify an invalid command. PPWIZARD allows you to extend the range of available commands if you wish.

One good reason why you might wish to do this is to create your own set of commands to integrate better with ppwizard, you don't wish to rely on a user specifying macros etc or you just feel the syntax is cleaner.

The first time ppwizard finds an unknown command it will look for a macro with the name UNKNOWN_HASH_COMMANDS. This macro should contain the rexx code to be executed.

The following rexx variables are significant:

Example

;--- Define Handler for new #commands ---------------------------------------
#DefineRexx 'UNKNOWN_HASH_COMMANDS'
            select
               /*++++++++++++++++++++++++++++++++++++++++++++++*/
               when HashCmd = HashPrefix || 'SET' then
               /*++++++++++++++++++++++++++++++++++++++++++++++*/
                    CmdGenerates = HashParms || '<' || '?NewLine>' || HashParms;
               /*++++++++++++++++++++++++++++++++++++++++++++++*/
               when HashCmd = HashPrefix || 'EXECPPW' then
               /*++++++++++++++++++++++++++++++++++++++++++++++*/
                    CmdGenerates = HashParms || d2c(10) || HashParms;
               /*++++++++++++++++++++++++++++++++++++++++++++++*/
               otherwise
               /*++++++++++++++++++++++++++++++++++++++++++++++*/
                    Error('Unknown command of "' || HashCmd || '"');
            end;
#DefineRexx


;--- Create macro to test use of unknown commands in a macro ----------------
#define XXXX            \
        (START)        -\
        #SET 222222_   -\
        #SET 333333_   -\
        (END)


;--- Do some tests (in and out of macro) ------------------------------------
1111111
<$XXXX>
4444444
#SET 555555_
#SET 666666_


;--- Test generation of ppwizard commands -----------------------------------
#ExecPpw #define A B

;--- Next line does and should fail (unknown command) -----------------------
#XXX .....


[Top][Contents][Search][Prev]: #Warning[Next]: Standard Definitions

PPWIZARD Manual
My whole website and this manual itself was developed using PPWIZARD (free preprocessor written by Dennis Bareis)
Tuesday January 02 2001 at 7:37am