Autor Beitrag
uall@ogc
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mi 09.03.05 11:19 
gibt es sowas in delphi oder muss ich des so machen? hab es jedenfalls noch net gefunden, einfache antwort mit ja/nein reicht mir

ausblenden Delphi-Quelltext
1:
2:
3:
        if b^ < 128 then
          readit(pointer(integer(b)+b^+1)) else
          readit(pointer(integer(b)-(255-b^)));



Moderiert von user profile iconGausi: Topic aus Algorithmen, Optimierung und Assembler verschoben am Mi 09.03.2005 um 14:16

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
jasocul
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 6395
Erhaltene Danke: 149

Windows 7 + Windows 10
Sydney Prof + CE
BeitragVerfasst: Mi 09.03.05 11:22 
Byte mit Vorzeichen? Meinst du ShortInt?
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mi 09.03.05 11:23 
Suchst du vielleicht Shortint..?

Edit: mist.. zu langsam! ;)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!


Zuletzt bearbeitet von Motzi am Mi 09.03.05 11:23, insgesamt 1-mal bearbeitet
uall@ogc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mi 09.03.05 11:23 
wenn nen shortint von -128..127 geht

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mi 09.03.05 11:24 
user profile iconuall@ogc hat folgendes geschrieben:
wenn nen shortint von -128..127 geht

Die Delphi-OH ist auch _dein_ Freund.. :roll: ;)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
wdbee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 628
Erhaltene Danke: 1



BeitragVerfasst: Mi 09.03.05 11:24 
Byte ist 8-Bit ohne Vorzeichen, Char 8-Bit mit Vorzeichen

// Edit: Nur als Alternative zu ShortInt, z.B. im Windows-API gebräuchlich


Zuletzt bearbeitet von wdbee am Mi 09.03.05 11:41, insgesamt 1-mal bearbeitet
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mi 09.03.05 11:26 
user profile iconwdbee hat folgendes geschrieben:
Byte ist 8-Bit ohne Vorzeichen, Char 8-Bit mit Vorzeichen

Ich glaub da bist du bei der falschen Programmiersprache gelandet..! ;) In Delphi heißt der signed 8-Bit Typ nämlich Shortint..

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
uall@ogc Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 1826
Erhaltene Danke: 11

Win 2000 & VMware
Delphi 3 Prof, Delphi 7 Prof
BeitragVerfasst: Mi 09.03.05 11:27 
jo funzt
aber warum ist delphi so sche**** und verbietet mir des:


c: pbyte;
e: pshortint;


e := c;

es sind ja 2 pointer nu muss ich extra noch nen

e := pointer(c); machen oO

_________________
wer andern eine grube gräbt hat ein grubengrabgerät
- oder einfach zu viel zeit
Motzi
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2931

XP Prof, Vista Business
D6, D2k5-D2k7 je Prof
BeitragVerfasst: Mi 09.03.05 11:30 
Tja.. der Delphi-Compiler ist nicht umsonst für seine strenge Typenprüfung berühmt.. ;)

_________________
gringo pussy cats - eef i see you i will pull your tail out by eets roots!
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mi 09.03.05 11:36 
Gibt weniger zu schreiben:
ausblenden Delphi-Quelltext
1:
c := @e^;					

:)
Sprint
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 849



BeitragVerfasst: Mi 09.03.05 11:40 
uall@ogc hat folgendes geschrieben:
aber warum ist delphi so sche**** und verbietet mir des

Im Gegensatz zu C++ denkt der Delphi Compiler halt mit.

_________________
Ciao, Sprint.
wdbee
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 628
Erhaltene Danke: 1



BeitragVerfasst: Mi 09.03.05 11:45 
Die armen C-Programmierer mussten sogar die Ungarische Notation erfinden, nur um nicht immer Fehler durch falsche Datentypen suchen zu müssen (iInteger, lLong, dDouble, pPointer, lpLongPointer lpsLongPointerToString und so weiter).
UC-Chewie
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 531

WinXP
D5 Ent
BeitragVerfasst: Mi 09.03.05 14:14 
Außerdem kann man auch beliebige eigene Zahlenbereiche in Datentypen kapseln:


ausblenden Delphi-Quelltext
1:
2:
type
  MyByte = -100..100;

_________________
Egal wie dumm man selbst ist, es gibt immer andere, die noch dümmer sind