String Functions

<< Click to Display Table of Contents >>

Navigation:  Problem Descriptor Reference > The Elements of a Descriptor > Built-in Functions >

String Functions

Previous pageReturn to chapter overviewNext page

FlexPDE provides support for dynamically constructing text strings.

$number        (i.e. <dollar> number)

This function returns a text string representing the integer value of number. number may be a literal value, a name or a parenthesized expression.  If number has integral value, the string will have integer format.  Otherwise, the string will be formatted as a real number with a default length of 6 characters.

 

$[width]number        

This form acts as the form above, except that the string size will be width.

 

These functions may be used in conjunction with the concatenation operator "+" to build boundary or region names or plot labels.  For example

 

REPEAT i=1 to 4

  START   "LOOP"+$i  (x,y)

  { path_info ... }

ENDREPEAT

 

This is equivalent to

 

START "LOOP1" (x,y) <path_info> ...

START "LOOP2" (x,y) <path_info> ...

START "LOOP3" (x,y) <path_info> ...

START "LOOP4" (x,y) <path_info> ...

 

Example:

See "Samples | Usage | Misc | Repeat.pde"