Autor Beitrag
Cookie007
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: So 08.01.06 00:55 
Hallo leute

habe folgendes Problem:
versuche folgende befehle :

Listtw.Items.Insert (variable) ;

Der wert einer Variablen soll in eine Listbox aufgenommen werden.
suche verbesserungsvorschläge

THX
Cookie 007

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: So 08.01.06 00:58 
entweder du verwendest listbox.items.add(variable)
oder wenn du insert benötigst schau dir mal die parameter an, du wirst feststelln das er 2 braucht
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 08.01.06 00:59 
Von welchem Typ ist die Variable? Integer, Real, und ähnliche variablen kannst zu stringvariablen konvertieren und dort einfügen, string gehen sowieso. Aber der Rest funktioniert nicht wirklich, weil eine Listbox nur strings oder TObjects aufnimmt.
Ein Array (dynamisch) wäre da vllcht hilfreicher, wenn es sich auch um andere Variablen handelt.

_________________
Programmers never die, they just GOSUB without RETURN
Cookie007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: So 08.01.06 01:00 
ich brauch nicht umbedingd insert
add hab ich auch probiert
er sagt aber das integer und String inkompatiebel sind wenn mirb jemand dafür eine
lösung bieten könnte wäreb ich hochzufrieden

THX
Cookie 007

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Cookie007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: So 08.01.06 01:03 
die variable ist im integer Format
ich würde sie ja konvertieren
was ich brauche ist ein Befehl

vieleicht auch noch ne kleine anleitung mit
IntToStr
StrToInt
usw

THX
Cookie007

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: So 08.01.06 01:04 
gib mal in der suche crashlurs ein ;D
das müsst dir helfen
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: So 08.01.06 01:04 
Wie wärs mit StrToInt oder IntToStr.
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 08.01.06 01:05 
nein es geht darum, von welchem Typ die Variable ist. Ist sie Integer, String, oder was anderes?

So wie du das schilderst ist sie integer. Mit inttostr({...}) konvertiert man eine Integervariable in einen String und mit strtoint gehts zurück. Also:
ausblenden Delphi-Quelltext
1:
Listbox1.Items.Insert(inttostr(integervariable), 0);					


Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Cookie007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: So 08.01.06 01:10 
hab folgendes:

ausblenden Delphi-Quelltext
1:
Listtw.Items.Insert(InttoStr(tatwaffe), 0) ;					


so richtig tut sich da aber auch noch nichts Fehler:
Integer & String sind inkompatiebel

Moderiert von user profile iconChristian S.: Delphi-Tags hinzugefügt

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: So 08.01.06 01:13 
ich wiederhohl mich ungern...
user profile iconIronwulf hat folgendes geschrieben:

wenn du insert benötigst schau dir mal die parameter an, du wirst feststelln das er 2 braucht


benutz die hilfe
Cookie007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: So 08.01.06 01:21 
gebt mir doch einfach einen einfachen Befehl mit add, Insert, create usw.
ist mir egal hauptsache die Integer Variable bzw. der Wert wird in die Listbox
gesetzt der Vorschlag von "alias 5000" hat wegen dem einen statt 2 parametern nix
gebracht

THX
Cookie 007

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 08.01.06 01:24 
Wieso? Da sind doch 2 Parameter, oder hab ich die Reihenfolge vertauscht? Egal, du kannst auch folgendes machen:
ausblenden Delphi-Quelltext
1:
Listbox1.Items.Add(inttostr(tatwaffe));					

_________________
Programmers never die, they just GOSUB without RETURN
Christian S.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 20451
Erhaltene Danke: 2264

Win 10
C# (VS 2019)
BeitragVerfasst: So 08.01.06 01:26 
Hallo!

WEnn Du lernen möchtest, zu Programmieren, dann ist es sehr wichtig, dass Du lernst, Dir selber Wissen anzueignen. Du solltest daher auch den Umgang mit der Hilfe üben. Zu schauen, wie Add oder Insert funktionieren, sollte möglich sein.

Grüße
Christian

_________________
Zwei Worte werden Dir im Leben viele Türen öffnen - "ziehen" und "drücken".
Cookie007 Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 96

win2000 / Xp / Linux9.3
Delphi7
BeitragVerfasst: So 08.01.06 01:32 
ok.
Danke für eure Hilfe

Hatte heute Nacht einfach keine lust
mich Seitenweise durch Tutorials zu lesen

Danke
Cookie 007

_________________
Mein System : A64 2400 Clawhammer, 1534 MB Ram, 200GB Festplatte, GeForce 6600 (Gigabyte)
Warum so ein langes Gesicht auf jede Frage gibt es eine Antwort, du musst sie nur suchen.(suchfunktion)
alias5000
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2145

WinXP Prof SP2, Ubuntu 9.04
C/C++(Code::Blocks, VS.NET),A51(Keil),Object Pascal(D2005PE, Turbo Delphi Explorer) C# (VS 2008 Express)
BeitragVerfasst: So 08.01.06 01:34 
Nein, wie Christian das gesagt hat. Schau dir mal die Delphi Hilfe an, da sind sehr praktische Hilfestellungen drin, wenn man mit der Hilfe umgehen kann. Aber nun ist dir ja geholfen, gute Nacht.
Gruß alias5000

_________________
Programmers never die, they just GOSUB without RETURN
Ironwulf
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 733
Erhaltene Danke: 2



BeitragVerfasst: So 08.01.06 01:34 
oder 4 zeilen in der hilfe...