Pages

Subscribe:

Friday, May 27, 2011

Conversion
CharToStr ()
DoubleToStr ()
NormalizeDouble ()
StrToDouble ()
StrToInteger ()
StrToTime ()
TimeToStr ()



array CharToStr (int char_code)

Returns a string with a symbol that the specified code
Parameters

char_code - ASCII character code.
Sample
string str;
str = "Worl" + CharToStr (44); / / 44 is the code of "D"
/ / Resulting string will be WORLD


array DoubleToStr (double value, int digits)

Returns text string with a numeric value converted to the specified precision format.
Parameters

value - numeric value.
digits - Precision format, number of digits Mon decimal point (0-8).
Sample
string value = DoubleToStr (1.28473418, 5);
/ / Value is 1.28473


double NormalizeDouble (double value, int digits)

Circle certain number of decimal decimal places.
Parameters

value - a decimal number.
digits - Precision format, number of digits Mon decimal point (0-8).
Sample
double var1 = 0,123456789;
Print (NormalizeDouble (var1, 5));
/ / Output: 0.12346


double StrToDouble (string value)

Converts a string representation of numbers to type double.
Parameters

value - string value containing a fixed number format.
Sample
double var = StrToDouble ("103,2812");


int StrToInteger (string value)

Converts a string representation of the number of type integer.
Parameters

value - string containing an integer.
Sample
int var1;
var1 = StrToInteger ("1024");


datetime StrToTime (string value)

Converts a string in the format "yyyy.mm.dd HH: MI" type DateTime.
Parameters

value - the value of the string on a date / time format such as "yyyy.mm.dd HH: MI".
Sample
datetime var1;
var1 = StrToTime ("2003/08/12 17:35");
var1 = StrToTime ("17:35"); / / returns the current date
var1 = StrToTime ("2003/08/12"); / / returns the midnight time "00:00"


array TimeToStr (datetime value, int mode = TIME_DATE | TIME_MINUTES)

Returns time as string in the format "yyyy.mm.dd HH: MI".
Parameters

value - positive number of seconds from 00:00 January 1, 1970.
government - Optional data output mode can be one or a combination of:
TIME_DATE result in form "yyyy.mm.dd",
TIME_MINUTES result in the form "HH: MI",
TIME_SECONDS result in the form "HH: MI: ss".
Sample
strign var1;
var1 = TimeToStr (CurTime (), TIME_DATE | TIME_SECONDS);

0 comments:

Post a Comment