Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi String - TString (https://www.delphipraxis.net/16330-string-tstring.html)

Snooze 15. Feb 2004 14:36


String - TString
 
Hallo,

habe das Problem, dass ich nicht weiß, wie ich das beheben kann.

ich deklariere ne Variable als string

hier mal ein Code-Ausschnitt:

Delphi-Quellcode:
ii := form4.Table1['EintragsNr'];
 form4.Table1.First;
 i:=0;
 while i <> ii do
  iii:= form4.table1['Datum'];
  [color=red]DBComboBox1.items:= DBComboBox1.items + iii;[/color]
  i:=i+1;
da meldet er:

Incompatible types: 'String' and 'TString'

Danke für Hilfe

Stefan

Chewie 15. Feb 2004 14:43

Re: String - TString
 
iii wird wohl ein String sein, DBComboBox1.items ist vom Typ TStrings. Die kann man nicht so verknüpfen.
Wenn du der Stringliste den String iii hinzufügen willst, musst du die Methode Add von TStrings benutzen.

Snooze 15. Feb 2004 14:49

Re: String - TString
 
und wie mache ich das?

sorry, bin leider in diesem Gebiet ein Vollnewbie :oops:

Benedikt 15. Feb 2004 14:54

Re: String - TString
 
Wie Chewie sagte:
Nimm die Methode Add von TStrings, z.b:

Delphi-Quellcode:
DBComboBox1.items.Add('diesundjenes');

fkerber 15. Feb 2004 14:54

Re: String - TString
 
Hi!

Mit der Methode Add:

Delphi-Quellcode:
DBCombobox1.Items.Add(iii);
Ciao fkerber

:oops: Zu langsam ....

Snooze 15. Feb 2004 14:56

Re: String - TString
 
danke, aber dann kriege ich als neue Meldung:

Incompatible types: 'TString' and 'Integer'

fkerber 15. Feb 2004 14:57

Re: String - TString
 
Hi!

Dann ist iii wohl kein String.
Dann musst du vorher noch

Delphi-Quellcode:
iiii:=inttostr(iii);
machen und dann eben iiii adden.

Ciao fkerber

neolithos 15. Feb 2004 14:57

Re: String - TString
 
IntToStr(iii);

Benedikt 15. Feb 2004 14:58

Re: String - TString
 
Was für einen Typ hat iii denn?
Wenn es ein Integer ist, dann schreib halt

Delphi-Quellcode:
DBCombobox1.Items.Add(IntToStr(iii));

fkerber 15. Feb 2004 15:00

Re: String - TString
 
Hi!

Oder einfach:

Delphi-Quellcode:
DBCombobox1.Items.Add(inttostr(iii));
Ciao fkerber

:oops: gott bin ich langsam


Alle Zeitangaben in WEZ +1. Es ist jetzt 21:35 Uhr.
Seite 1 von 2  1 2      

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