Autor Beitrag
TimonWorld
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: Fr 18.03.05 21:33 
Hallo!

Wie heißt der Typ, damit man Hexdezimale-Werde verwenden kann?
Denn, hex gibt es nicht. Habe zwar IntToHex gefunden, aber bei nur einem Integer kann ich keine Werte zwischen A und F angeben!
Weiß jemand wie dies anwende? Bei Konstanten geht das glaub ich!

Gruß,
Timon.
raziel
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 2453

Arch Linux
JS (WebStorm), C#, C++/CLI, C++ (VS2013)
BeitragVerfasst: Fr 18.03.05 21:40 
Hi,

vorausgesetzt ich hab Dich richtig verstanden, dann so:
ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
procedure TForm1.Button1Click(Sender: TObject);
var i: Integer;
begin
  for i := $abc to $abe do
    showmessage(inttostr(i));
end;


Gruß,
raziel

_________________
JSXGraph
Karlson
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 2088



BeitragVerfasst: Fr 18.03.05 22:19 
Jop auch wenns nicht so aussieht, aber ein Hexwert ist vom Typ Integer (oder kann es zumindest sein).

Denn  if 23492 = $5BC4 Ist eine wahre Aussage.
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: Fr 18.03.05 22:24 
Hallo!

Also kann man Hexdezimale Zahlen in einem normalen Integer angeben?
Scheint zu funktionieren nur ich kann dem Integer keinen Default-Wert zuweisen, wenn ich in einem Procedure-Header angebe: procedure HexProcedure(Wert1: string; HexWert: Integer = $B6);.

Gruß,
Timon.


Zuletzt bearbeitet von TimonWorld am Fr 18.03.05 22:32, insgesamt 1-mal bearbeitet
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Fr 18.03.05 22:27 
Du verwendest das falsche Zeichen: Es ist $ (Dollar) und nicht § (Paragraph)
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: Fr 18.03.05 22:33 
user profile icondelfiphan hat folgendes geschrieben:
Du verwendest das falsche Zeichen: Es ist $ (Dollar) und nicht § (Paragraph)


Oh, da habe ich mich vertippt! Schon geändert, aber in Delphi hatte ich das Dollar-Zeichen. Also ich hab mich nur beim Beitrag schreiben vertippt!

Gruß,
Timon.
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Fr 18.03.05 22:36 
Wie lautet die Fehlermeldung? Der Syntax ist (bis auf das "§") korrekt.
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: Fr 18.03.05 22:45 
Delphi-Debugger hat folgendes geschrieben:
Fehler: datei.pas(18): ';' oder ')' erwartet, aber '=' gefunden.

ausblenden Quelltext
1:
function MeineFunktion(var Text: string; HexZahl: Integer = $07): Boolean;					

edit: Smilies deaktiviert, weil sonst Smiley im Debug Code erscheint *gg*
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Fr 18.03.05 22:49 
Und ohne $ geht's? Welche Delphiversion hast du?
TimonWorld Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 397



BeitragVerfasst: Fr 18.03.05 22:53 
Siehe Signatur!
Ich nutze aber hauptsächlich D3Prof!

Gruß,
Timon.