![]() | ![]() | ![]() | ![]() | ![]() |
Switch /OutHeader:Spec |
This is a PPWIZARD command line switch. You can set up your own default switches in the "PPWIZARD_OPTIONS" environment variable or in project files.
For some output extensions or file types PPWIZARD automatically outputs a header at the start of the file. You can turn this off, on, or tweek the output using this switch.
The first and last characters of the "Spec" defines the delimiter being used to delimit the following values:
Note that if the last 3 values (start/middle/end) are empty or missing then the comment is turned off.
If the start value starts with '@' and there is no middle or end then this indicates that a file should be read to create a header. The included header is basically just like any other included file but I recommend that its only task be to take care of the header. If your header file included conditional generation of the header based on the extension of the output file then it could make sense to use a "*" rule. This allows you to have full control over the contents of the header.
Examples |
The following shows how header comments in files with the extension ".REX" can be turned off:
/OutHeader:~/REX/~
The following shows how header comments in files with the extension ".VBS" can be specified:
/OutHeader:~$VBS$'{x20}===============$'{x20}$'{x20}===============$~
The following shows how a file can be included to produce a custom header (it can perform any required commands):
/OutHeader:~/VBS/@OutHeader.H/~
The following is an example of what the "OutHeader.H" file could look like:
;--- What is the extension of the output file ------------------------------- #NextId #DefineRexx '' ;---- Get extension (if not unix then make upper case) ------------------- @@Extn = _filespec('EXTN', '<?OutputFile>'); #if ['<?OpSys>' <> 'UNIX'] @@Extn = translate(@@Extn); ;;Make upper case #endif ;---- Want a comment? --- @@Line = copies('+*', 30); select ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% when @@EXTN = "HTM" | @@EXTN = "HTML" then ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% do ;--- HTML --- @@WantCmt = 'Y' @@Start = '<!--<?NewLine>' || @@Line; @@End = @@Line || '<?NewLine>-->'; @@Line = '' end; ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% when @@EXTN = "VBS" then ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% do ;--- VB SCRIPT --- @@WantCmt = 'Y' @@Start = "'" || @@Line; @@End = @@Start; @@Line = "'" end; ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% when @@EXTN = "REX" | '<?ProcessingMode>' = 'REXX' then ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% do ;--- REXX --- @@WantCmt = 'Y' @@Start = '/* ' || @@Line; @@End = ' * ' || @@Line || '*/'; @@Line = ' *' end; ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% otherwise ;%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% @@WantCmt = 'N' end #DefineRexx ;--- Exit if we don't want to generate a output header for this EXTN --- #if [@@WantCmt = 'N'] #eof 1 #endif ;--- Generate the output comment --- <??@@Start> <??@@Line> Generator : PPWIZARD version <?Version> under <?OpSysSpecific> <??@@Line> : FREE tool for Windows, OS/2, DOS and UNIX by <?PpwizardAuthor> (<?PpwizardAuthorEmail>) <??@@Line> : <?PpwizardHomePage> <??@@Line> Time : <?CompileTime> <??@@Line> Input File : <?InputFile> <??@@Line> Output File : <?OutputFile> <??@@End>
![]() | ![]() | ![]() | ![]() | ![]() |