ansistring::format
-
Hallo,
folgender Text ist aus der BCB5 Hilfe
TVarRec args[3] = {8,2,123.456};
Format("%*.*f", args, 2);ist identisch mit
Format("%8.2f", 123.456, 0);
das obere Beispiel funktioniert nur. Was ist an dem unteren falsch?
Ich will so den Text einer TEdit Komponente beschreiben.Vielen Dank.
-
die formatanweisung sieht wie folgt aus:
static AnsiString __fastcall Format(const AnsiString& format, const TVarRec *args, int size);
es wird also als zweites argument ein TVarRec erwartet!
Edit1->Text = Format("%8.2f", &TVarRec(123.456), 0);
-
Danke!