Core Function ResolveStr

From Sputnik Wiki
(Difference between revisions)
Jump to: navigation, search
(Created page with "<pre> ResolveStr( <expression> ) </pre> === Description === Treat a given string as if it was a Sputnik "string" and parse all stuff inside it such as $variables etc. === Para...")
 
Line 1: Line 1:
 
<pre>
 
<pre>
ResolveStr( <expression> )
+
ResolveStr( <expression>, <allowEscapes>, <allowVariables>, <allowCode> )
 
</pre>
 
</pre>
  
Line 12: Line 12:
  
 
The string to use.
 
The string to use.
 +
 +
==== allowEscapes ====
 +
 +
True to allow parsing of escapes such as \n etc.
 +
 +
False to disallow parsing of escapes.
 +
 +
Default: true
 +
 +
==== allowVariables ====
 +
 +
True to allow parsing of variables such as $cat @cow etc.
 +
 +
False to disallow parsing of variables.
 +
 +
Default: true
 +
 +
==== allowCode ====
 +
 +
True to allow parsing of stuff inside { } and/or \C \c as physical Sputnik code.
 +
 +
False to disallow parsing of variables.
 +
 +
Default: true
  
 
=== Return Value ===
 
=== Return Value ===

Revision as of 12:12, 4 September 2013

ResolveStr( <expression>, <allowEscapes>, <allowVariables>, <allowCode> )

Contents

Description

Treat a given string as if it was a Sputnik "string" and parse all stuff inside it such as $variables etc.

Parameters

expression

The string to use.

allowEscapes

True to allow parsing of escapes such as \n etc.

False to disallow parsing of escapes.

Default: true

allowVariables

True to allow parsing of variables such as $cat @cow etc.

False to disallow parsing of variables.

Default: true

allowCode

True to allow parsing of stuff inside { } and/or \C \c as physical Sputnik code.

False to disallow parsing of variables.

Default: true

Return Value

Success: Returns new string.

Failure: Returns empty string.

Remarks

None.

Example

println("Without Resolve: " . 'The value is $lol'   );
println("With Resolve: " . ResolveStr('The value is $lol')   );
Personal tools
Namespaces
Variants
Actions
Navigation
Toolbox