Delphi-PRAXiS
Seite 1 von 2  1 2      

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi Byte nach String (https://www.delphipraxis.net/1094-byte-nach-string.html)

Salomon 17. Okt 2002 12:43


Byte nach String
 
Hallo,
wie kann ich einen Byte Wert in einen String umwandeln?

Thanx
Salomon

Luckie 17. Okt 2002 12:51

IntToStr ???

Salomon 17. Okt 2002 13:02

Dachte das geht nur mit Integer und habe daher nach sowas wie Bytetostr gesucht. Gut zu wissen, das inttostr auch mit Byte Typen zusammen arbeitet.

Was kann man noch mit inttostr umwandeln? Alle Integer Typen aus der Hilfe, also auch Word, Int64 etc?

Mfg
Salomon

Luckie 17. Okt 2002 13:14

Byte ist doch auch nur ein Ganzzahl Typ.

Code:
Typ   Bereich                     Format
Integer   -2147483648..2147483647   32 Bit mit Vorzeichen
Cardinal   0..4294967295            32 Bit ohne Vorzeichen


Zu den fundamentalen Integer-Typen gehören Shortint, Smallint, Longint, Int64, Byte, Word und Longword.

Typ   Bereich                     Format
Shortint   -128..127                     8 Bit, mit Vorzeichen
Smallint   -32768..32767            16 Bit, mit Vorzeichen
Longint   -2147483648..2147483647   32 Bit, mit Vorzeichen
Int64   -263..263 -1            64 Bit, mit Vorzeichen
Byte   0..255                     8 Bit, ohne Vorzeichen
Word   0..65535                     16 Bit, ohne Vorzeichen
Longword   0..4294967295            32 Bit, ohne Vorzeichen

Chewie 17. Okt 2002 13:15

Richtig. Alle Integer-Typen unabhänngig von der Ausdehnung. Und mit FloatToString alle Fließkommatypen.

Salomon 17. Okt 2002 13:30

Danke euch, habe ich mal wieder was dazu gelernt :-)

neffe 12. Mär 2003 16:21

also auch Cardinal ?
 
nochmal zum mitschreiben ...

also kann ich auch Cardinal mit 'IntToStr' in einen String umwandeln ?

übrigens .. prima Einrichtung hier ... werd mal öfters kommen :)

Chewie 12. Mär 2003 16:26

Re: also auch Cardinal ?
 
Zitat:

Zitat von neffe
nochmal zum mitschreiben ...

also kann ich auch Cardinal mit 'IntToStr' in einen String umwandeln ?

Ja, denn Cardinal ist auch einer der Integer-Typen.

City Light 11. Mai 2003 10:26

Hallo

Also bei mir geht das glaube ich nicht!

Ich habe zwei Formen in Form1 geht es wunder bar aber nicht in Form2 :?: wieso

Delphi-Quellcode:
StatusBar1.Panels[1].Text := IntToStr(getFileSize(f + 'Themen\' +
        ComboBox1.Items[ComboBox1.ItemIndex] + '\' +
        (ListBox1.Items[ListBox1.ItemIndex] + '.THM')) + ' Byte ';

[Fehler] Unit3.pas(137): Inkompatible Typen: 'Cardinal' und 'String'
[Fehler] Unit3.pas(137): Inkompatible Typen: 'String' und 'Cardinal'
[Fataler Fehler] SAM.dpr(15): Verwendete Unit 'Unit3.pas' kann nicht compiliert werden

jbg 11. Mai 2003 11:53

Seit wann verlangt GetFileSize einen String? Da wird ein Handle (=Cardinal) auf eine Datei verlangt. Das ist der Fehler.


Alle Zeitangaben in WEZ +1. Es ist jetzt 01:30 Uhr.
Seite 1 von 2  1 2      

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