CalculateStringExpression

Function CalculateStringExpression(expression: String) : String
Returns the result of the expression as a String.

This function parses an expression such as "My name is [name]" where name would be a VirtualVariable, and returns the result.

For more information on expression formatting, see Parser Logic and Maths.

You can also use ParserConstants

Example:

Program
  Uses
basilisk, pure2d

Begin
  InitBasilisk(TRUE)
  OpenScreen(640,480,32,FALSE,COB_SHOWCLOSE+COB_SHOWBORDER)

   VirtualString("name","Bob")
   Text(10,10,(CalculateStringExpression("Hello, [name]!")))
   
   // Bit of a pointless example as we could just do
   // "Hello, "+VirtualString("name") + "!"
   // However, you get the idea - it can come in handy in real-time scripting
   
   // This is all done automatically by ReadSettings anyway

   
  
  While Not ExitRequested
   Flip
   Pause
(2)
  Wend
     
End