Autor Beitrag
Moritz M.
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Fr 11.10.02 22:31 
Hi!

Ich habe z.B. 2 Strings:
ausblenden Quelltext
1:
2:
a:='5';
b:='6';

Aber wenn Ich (ergebniss ist ein integer)
ausblenden Quelltext
1:
ergebniss:=integer(a)+integer(b);					

rechne, kommt was ganz komisches raus.

Wie muss ich das dann machen?

cu

Onz

(12.10.02 10:37 Tino) Code-Tags hinzugefügt.
Wiesenbiber
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Fr 11.10.02 22:37 
Titel: Mögliche Lösung
Hi,

kannst es ja mal so Probieren:

ausblenden Quelltext
1:
2:
3:
4:
Bsp.:
a := '5';
b := '7';
ergebnis := StrToInt(a) + StrToInt(b);

_________________
Gruß
Chris
Moritz M. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Fr 11.10.02 22:59 
Titel: Hi!
Hi!

Danke!

cu

Onz
Wiesenbiber
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 18



BeitragVerfasst: Fr 11.10.02 23:03 
Titel: Kein Problem
Hi,

scheint ja wohl geholfen zu haben! 8)

cu

_________________
Gruß
Chris
SMI
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 106

Win95-2003 / Debian / Suse
D1/D3/D6/D7
BeitragVerfasst: Sa 12.10.02 03:20 
Mit dem Cast integer(string) müsstest du die Speicheradresse des Strings erhalten, wenn ich mich nicht täusche. Daher kommt das komische Ergebnis, du addiert die Speicher Addressen und nicht deren Inhalt.

SMI

_________________
Wenn es im Jahre 1879 schon Computer gegeben hätte, würden diese vorausgesagt haben, daß man infolge der Zunahme von Pferdewagen im Jahre 1979 im Pferdemist ersticken würde.
(John C. Edwards, brit. Zukunftsforscher)
Moritz M. Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 1672



BeitragVerfasst: Sa 12.10.02 09:58 
Titel: Hi
Hi

Das kann gut sein..
Da kam nämlich sowas wie 53750234872 raus.

cu

Thanks

Onz