ReplacementTextMethod

Applies to:Fast Math Parser
Class:uCalc.Item
Returns the replacement part of a syntax construct defined with DefineSyntax
Syntax
ReplacementText()
Remarks
This allows you to inspect the part to the right of "::=" in a syntax construct defined with DefineSyntax.
Example 1: Inspecting the parts of a syntax construct

uc.DefineSyntax("This {etc} ::= That")
' Note that the SkipExpansion arg is set to true for this Syntax construct
Console.WriteLine(uc.GetItemOf("This", 0, true).Text()) ' Returns "ChangeMulti ~~ Syntax: This {etc} ::= That"
Console.WriteLine(uc.GetItemOf("This", 0, true).ReplacementText()) ' Returns "That"

          

uc.DefineSyntax("This {etc} ::= That");
// Note that the SkipExpansion arg is set to true for this Syntax construct
Console.WriteLine(uc.GetItemOf("This", 0, true).Text()); // Returns "ChangeMulti ~~ Syntax: This {etc} ::= That";
Console.WriteLine(uc.GetItemOf("This", 0, true).ReplacementText()); // Returns "That";

          

      uc.DefineSyntax('This {etc} ::= That');
      // Note that the SkipExpansion arg is set to true for this Syntax construct
      WriteLn(uc.GetItemOf('This', 0, true).Text()); // Returns 'ChangeMulti ~~ Syntax: This {etc} ::= That';
      WriteLn(uc.GetItemOf('This', 0, true).ReplacementText()); // Returns 'That';

          

uc.DefineSyntax("This {etc} ::= That");
// Note that the SkipExpansion arg is set to true for this Syntax construct
cout << uc.GetItemOf("This", 0, true).Text() << endl; // Returns "ChangeMulti ~~ Syntax: This {etc} ::= That";
cout << uc.GetItemOf("This", 0, true).ReplacementText() << endl; // Returns "That";

          

uc.DefineSyntax("This {etc} ::= That");
// Note that the SkipExpansion arg is set to true for this Syntax construct
Console::WriteLine(uc.GetItemOf("This", 0, true).Text()); // Returns "ChangeMulti ~~ Syntax: This {etc} ::= That";
Console::WriteLine(uc.GetItemOf("This", 0, true).ReplacementText()); // Returns "That";

          
DLL import code
<DllImport(uCalcDLL, CharSet:=CharSet.Ansi, CallingConvention:=CallingConvention.Cdecl, EntryPoint:="ReplacementText")> _

Private Function ReplacementText__(ByVal ItemHandle As IntPtr) As IntPtr
End Function
            
[DllImport(uCalcDLL, CharSet=CharSet.Ansi, CallingConvention=CallingConvention.Cdecl, EntryPoint="ReplacementText")]

protected static extern  IntPtr ReplacementText_(IntPtr ItemHandle);
            
{DLLImport}function ReplacementText__(ItemHandle: System.Pointer):  PAnsiChar; cdecl; external uCalcDLL name 'ReplacementText';

            
typedef const char * (* __ReplacementText)(void *ItemHandle); 

            
[DllImport(uCalcLib, CharSet=CharSet::Ansi, CallingConvention=CallingConvention::Cdecl, EntryPoint = "ReplacementText")]

static STR_RETURN ReplacementText_(void *  ItemHandle);
            
See also
Prev | Next