Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi String = PAnsiChar??! (https://www.delphipraxis.net/27307-string-%3D-pansichar.html)

Tommy1988 28. Sep 2007 15:20

Re: String = PAnsiChar??!
 
Ahhh..
also so:
Delphi-Quellcode:
      Application.MessageBox('Spalten IP und Zeit ' +
      'erfolgreich in Datenbank ' +
      PChar(sEdit5.Text) + ' erstellt', 'Caption',
      MB_IconInformation + MB_OK)
Der Fehler besteht aber weiterhin :thumb:

s-off 28. Sep 2007 15:23

Re: String = PAnsiChar??!
 
Ja klar, noch immer; der ganze Text muss ja auch PChar sein, nicht nur der Inhalt des Edits ;)
Delphi-Quellcode:
   Application.MessageBox(
      PChar('Spalten IP und Zeit ' +
      'erfolgreich in Datenbank ' +
      sEdit5.Text + ' erstellt'), 'Caption',
      MB_IconInformation + MB_OK)
Nebenbei: benutze mal Format() - das macht alles übersichtlicher. Also zum Beispiel so:

Delphi-Quellcode:
Procedure TForm1.Button1Click(Sender: TObject);
Const
   sCAPTION: String = 'Info';
Var
   sText: String;
Begin
   sText := Format('Spalten IP und Zeit erfolgreich in Datenbankk %s erstellt', [sEdit5.Text]);
   Application.MessageBox(PChar(sText), PChar(sCAPTION), MB_IconInformation + MB_OK)
End;


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:53 Uhr.
Seite 2 von 2     12   

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz