
Fragment
Fragment takes in a single variable and returns an array that has split it into its components.
TVariable Fragment( unsigned int format = 0 ); TVariable Fragment( const BYTE *format ); TVariable Fragment( const char16_t *format ); TVariable Fragment( const TVariable &format );
Parameters
| format | format can be from Parameters. |
Return Values
These methods will return the a temporary array which should be saved before use.
Remarks
- Fragment will be extended in the future to include more operations.
Example Use
- C++
#include "TScript.h"
int wmain(int argc, wchar_t* argv[])
{
TVariable var("This,is,a,comma,separated,string");
MessageBox((wchar_t*)var.Fragment(",").WString());
//returns u"{"This","is","a","comma","separated","string"}";
MessageBox((wchar_t*)var.SetUTCTime()
.Fragment(TVariable::TIME_ZONE_LOCAL).WString());
//returns u"{"year"=>2012,"month"=>1,"day"=>28,"dayOfWeek"=>6,
// "hour"=>9,"minute"=>0,"second"=>1,"milliseconds"=>970}"
return NO_ERROR;
}Since
TScript Version 1.3.0
Also See
ToStringListen All
Comments (0)

