![]() |
Byte nach String
Hallo,
wie kann ich einen Byte Wert in einen String umwandeln? Thanx Salomon |
IntToStr ???
|
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 |
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 |
Richtig. Alle Integer-Typen unabhänngig von der Ausdehnung. Und mit FloatToString alle Fließkommatypen.
|
Danke euch, habe ich mal wieder was dazu gelernt :-)
|
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 :) |
Re: also auch Cardinal ?
Zitat:
|
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 |
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. |
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