PIKT

Samples: Text Macros

PIKT Logo
Home FAQ News Intro Samples Tutorial Reference Software Authors Licensing SiteSearch


The macros in the sample text_macros.cfg configuration file below are for specifying common text elements, also as quasi string functions.

///////////////////////////////////////////////////////////////////////////////

// text macros

///////////////////////////////////////////////////////////////////////////////

strip(S, C)     // strip all instances of string C (usually just a single
                // char) from string S, returning the stripped string
                $substitute((S), (C), "")

///////////////////////////////////////////////////////////////////////////////

chop(S)         // like Perl's chop, chop the last char off of string S
                set (S) = $chop((S))

///////////////////////////////////////////////////////////////////////////////

chomp(S, C)     // sort of like Perl's chomp, chop the last char off of
                // string S if it's a (C)
                if $right((S),1) eq (C)
                        set (S) = $chop((S))
                fi

///////////////////////////////////////////////////////////////////////////////

border          $repeat($char(47), 79)

///////////////////////////////////////////////////////////////////////////////

newline         $newline()
// nl           =newline        // defined in macros/doc_pikt_macros.cfg
                                // but not universally

///////////////////////////////////////////////////////////////////////////////

[For more examples, see Samples.]

Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software | Authors | Licensing | SiteSearch
Links | SiteIndex | Pikt-Users | Pikt-Workers | Contribute | ContactUs | Top of Page
Page best viewed at 1024x768.   Page last updated 2005-06-22.
This site is PIKT® powered.
PIKT® is a registered trademark of the University of Chicago.
Copyright © 1998-2005 Robert Osterlund.  All rights reserved.

Computer Books at Amazon.com

Essential CVS
Essential CVS

Linux Cookbook
Linux Cookbook

Linux Server Hacks
Linux Server Hacks

SUSE Linux 9 Bible
SUSE Linux 9 Bible

Running Linux
Running Linux