Click or drag to resize

StrEvaluate Function

Allows text substitution in strings entered at runtime.

Namespace:  XSharp.Core
Assembly:  XSharp.Core (in XSharp.Core.dll) Version: 2.2a
Syntax
 FUNCTION StrEvaluate(
	cString AS STRING
) AS STRING
View Source

Parameters

cString
Type: String
A string containing one or more macro variables to expand.

Return Value

Type: String
The new string, after all macro substitutions have taken place.
Remarks
Examples
This example demonstrates StrEvaluate() on a string entered at runtime that contains a macro variable:
X#
MEMVAR cOne
LOCAL cTwo AS STRING
cOne := "world"
ACCEPT "Enter a macro string " TO cTwo
// If you type "Hello &cOne" (without quotes)
? cTwo                                                // Result: "Hello &cOne"
? StrEvaluate(cTwo)                        // Result: "Hello world"
See Also