#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"


prev page 1st page next page
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | DevNotes | Licensing | Authors | Pikt-Users | Pikt-Workers | Links | SiteIndex | ContactUs
Page best viewed at 1024x768.   Page last updated 2006-09-10.   This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.   Copyright © 1998-2006 Robert Osterlund.  All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title