Autor Beitrag
Whisper
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 16

WIN XP
Delphi
BeitragVerfasst: Mi 28.09.05 09:42 
Huhu....

Habe eine Frage bzgl. des Parsens von Datentypen!
Wie parse ich einen Integer-Wert in einen Boolean-Typen?
Und wie funzt es bei dem Parsen von String in Integer?

:?


Moderiert von user profile iconraziel: Topic aus Sonstiges verschoben am Mi 28.09.2005 um 13:57
Horst_H
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1654
Erhaltene Danke: 244

WIN10,PuppyLinux
FreePascal,Lazarus
BeitragVerfasst: Mi 28.09.05 10:12 
Hallo,

einmal
mit typecast und speziellen proceduren.(InttoStr..etc)
Siehe mal hier Kapitel 3 ist so ziemlich alles aufgelistet.

Gruss Horst
Grishnak
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 221

Windows XP Home
Delphi 7 PE, Delphi 2005 PE
BeitragVerfasst: Mi 28.09.05 10:13 
Wenn du mit "parsen" eine Typ-Umwandlung (oder angelsächsich einen Type-Cast) meinst, dann so:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
var
  s: string;
  i: integer;
  b: boolean;

[...]
  
  b:=boolean(i); // integer -> boolean
  i:=StrToInt(s); // string -> integer


Für solchen "Problemchen" gibt es übrigens die Hilfe-Funktion in Delphi ([F1]!) :wink:

Moderiert von user profile iconraziel: Neue Frage von user profile iconWhisper hierhin abgetrennt.

_________________
Mach' etwas idiotensicher und irgendjemand erfindet einen besseren Idioten!