Поиск |
Язык:
Русский
English
Преобразовывает число в строку.
Объявление
procedure Str(X [: W >String );
Режим
Windows, Real, Protected
Замечания
Преобразовывает числовое значение X в строковое представление этого числа, которое можно выводить операторами типа Write и OutText .
См. также
Пример
Язык:
Русский
English
Convert a numerical or enumeration value to a string.
Declaration
Source position: system.fpd line 61
var X : TNumericType ;
Description
Str returns a string which represents the value of X. X can be any numerical or enumerated type. The actual declaration of Str is not according to pascal syntax, and should be
Where the optional NumPlaces and Decimals specifiers control the formatting of the string: NumPlaces gives the total width of the string, and Decimals the number of decimals after the decimal separator char.
Str can also be used to convert an enumerated type value to a string representation of the declared enumeration value. That means that the following will work:
This will write OnE on the screen, which is consistent with the following — equivalent — program:
For scoped enumerated types, only the value is written, which means the following program will have the same output:
Str (процедура)
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
Преобразовывает число в строку.
Объявление:
Procedure Str(X [: Width [: Decimals ]]; Var S : String);
Режим:
Windows, Real, Protected
Замечания:
Преобразовывает числовое значение X в
строковое представление этого числа, которое
можно выводить операторами типа Write и
OutText.