[ << ] | [ < ] | [ Up ] | [ > ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
4.2.2 Character expressions
Character expressions are defined as:
char-expression: "string" | Today | StrPrefix ( char-expression ) | StrRelative ( char-expression ) | StrCat ( char-expression , char-expression ) | Str ( char-expression , … ) | Sprintf ( char-expression , expression-list ) | Sprintf ( char-expression ) | Sprintf ( char-option ) | GetEnv ( char-expression ) | GetString ( char-expression , char-expression ) | StrReplace ( char-expression , char-expression , char-expression )
StrPrefix
and StrRelative
permit to take the
prefix (e.g. to remove the extension) or the relative path of a file
name. StrCat
and Str
permit to concatenate character
expressions (Str
adds a newline character after each string
except the last). Sprintf
is equivalent to the sprintf
C
function (where char-expression is a format string that can
contain floating point formatting characters: %e
, %g
,
etc.) The various char-options are listed in
Options. GetEnvThe
gets the value of an environment
variable from the operating system. GetString
allows to ask the
user for a value interactively. StrReplace
’s arguments are: input
string, old substring, new substring.(4)
Character expressions are mostly used to specify non-numeric options and input/output file names. See ‘t8.geo’, for an interesting usage of char-expressions in an animation script.
This document was generated on February 9, 2014 using texi2html 5.0.