#verbatim

Recall that #fix directives do not extend into include files.  So one problem with the passwd example just given is:  What about apparent macros and comment sequences (//, /*, */) within the #include file?  Also, what about lines that appear to be PIKT preprocessor directives (e.g., '#if vienna') but in fact are not?

The solution for these sorts of problems is the #verbatim directive.  #verbatim is like #include but with auto-indentation, no comment stripping or macro expansion, and suppression of other preprocessor directives.  In other words, the line

#verbatim "/etc/passwd"
is like
#include "/etc/passwd"
where /etc/passwd is interpreted to be
[#fix]                   [implied]
[#indent]                [implied]
root:0:...               [actual passwd file "as is"; PIKT-like
...                       preprocessor directives and macros within
                          are ignored]
[#unindent]              [implied]
[#unfix]                 [implied]
So, this is actually the safest and preferred way to include a file like /etc/passwd "as is":
passwd
#verbatim "/etc/passwd"

Refer to the Samples section for more examples.

prev page 1st page next page
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2018-01-02.   This site is PIKT® powered.
Copyright © 1998-2018 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
View sample
log scan
Pikt script