wiki:Doc/panc/dml/functions

Version 4 (modified by /O=GRID-FR/C=FR/O=CNRS/OU=LAL/CN=Charles Loomis, 17 years ago) (diff)

--

Functions

Built-In Functions

base64_decode( arg:string ) : string

This function decodes the given string that must be Base64 (defined in RFC 2045) encoded.

"/test" = "[" + base64_decode("aGVsbG8gd29ybGQ=") + "]"; 
# will be the string "[hello world]" 

clone( arg:element ) : element

This function returns a clone (copy) of the given argument.

create( name:string, . . . ) : nlist

This function returns the named list which is the result of the execution of the structure template identified by the given name; the optional extra parameters must be pairs of key and value and will add or modify the result accordingly (a bit like with nlist).

# description of a CD mount entry (but the device is unknown) 
structure template mount_cdrom; 
"device" = undef; 
"path" = "/mnt/cdrom"; 
"type" = "iso9660"; 
"options" = list("noauto", "owner", "ro"); 
# our first mount entry is the CD coming from hdc 

debug( string message )

This function prints the given message on stdout when debugging is enabled with the DEBUG USER flag.

# print the value of x if it is positive 
if (x > 0) 
debug("x is positive: " + to_string(x));