Text Macros

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
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 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
See how to
automatically
delete junk files