ToString

ToString formats and return a string valid for printing. This can cast a TVariable from a none string type, including a structure or array and return an acsii string ready for printing.

TVariable ToString(
   unsigned int format = 0,
   TVariable &parameters = TVariable()
);

TVariable ToString(
   const TVariable &format
   TVariable &parameters = TVariable()
);

Parameters

formatFormat can vary from Parameters to standard c language printf style strings.

Return Values

These methods will return the modified TVariable, or a temporary const TVariable created on the stack.

Remarks

Example Use
  • C++
#include "TScript.h"

int wmain(int argc, wchar_t* argv[])
{
   TVariable var("123"), params;
   params[u"RootLabel"] = "value";
   var = var.Integer() + 10;
   MessageBox((wchar_t*)var.ToString(TVariable::XML,params).WString());
      //should show "<value>133</value>"
   return NO_ERROR;
}

Also See

Casting Operators, Assignment Operators
Listen All
Comments (0)
Characters left: 2500
 
Ekky Software Homepage T-Accounts Online ObjectDatabase++ TScript Ekky Software Homepage T-Accounts Onlinee ObjectDatabase++ TScript