var
text : string;
begin
// Just 1 data item
ShowMessage(Format('%s', ['Hello']));
// A mix of literal text and a data item
ShowMessage(Format('String = %s', ['Hello']));
ShowMessage('');
// Examples of each of the data types
ShowMessage(Format('Decimal = %d', [-123]));
ShowMessage(Format('Exponent = %e', [12345.678]));
ShowMessage(Format('Fixed = %f', [12345.678]));
ShowMessage(Format('General = %g', [12345.678]));
ShowMessage(Format('Number = %n', [12345.678]));
ShowMessage(Format('Money = %m', [12345.678]));
ShowMessage(Format('Pointer = %p', [addr(text)]));
ShowMessage(Format('String = %s', ['Hello']));
ShowMessage(Format('Unsigned decimal = %u', [123]));
ShowMessage(Format('Hexadecimal = %x', [140]));
end;
Hello
String = Hello
Decimal = -123
Exponent = 1.23456780000000E+004
Fixed = 12345.68
General = 12345.678
Number = 12,345,68
Money = ?12,345.68
Pointer = 0069FC90
String = Hello
Unsigned decimal = 123
Hexadecimal = 8C
沒有留言:
張貼留言