Autor Beitrag
opfer.der.genauigkeit
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 31.07.03 13:15 
Hi,

Ich würde gerne wissen wie ich zwei Integer zu einem Word mache.

Integer sind ja 8- Bit
Word ist 16- Bit
Ich möchte also in den unteren Bereit vom Word den ersten Integer und
den zweiten im oberen Bereich.

Bsp:
int1 := 10;
int2 := 20;

word := 1020;

Sowas in der Art ja. *g*
Hoffe es ist klar was ich meine.

_________________
Stellen Sie sich bitte Zirkusmusik vor.


Zuletzt bearbeitet von opfer.der.genauigkeit am Do 31.07.03 16:30, insgesamt 1-mal bearbeitet
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 31.07.03 13:40 
Titel: Re: Zwei Integer zu einem Word machen
opfer.der.genauigkeit hat folgendes geschrieben:
Hoffe es ist klar was ich meine.

Nicht so ganz.
Das Beispiel sieht eher nach einer dezimalen "verschiebung" aus.
Also binär geht' so:
ausblenden Delphi-Quelltext
1:
word := byte1 or (byte2 shl 8);					

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
opfer.der.genauigkeit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 31.07.03 14:07 
Danke klasse Antwort.
Hat mir weitergeholfen. :)

_________________
Stellen Sie sich bitte Zirkusmusik vor.
MSCH
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 1448
Erhaltene Danke: 3

W7 64
XE2, SQL, DevExpress, DevArt, Oracle, SQLServer
BeitragVerfasst: Do 31.07.03 14:24 
oje oje,
ein Word aus Integer zu machen geht definitv nicht, da ein Word aus 16 Bits besteht und integer aus 32 bit, es sei denn, du meinst 2 Bytes zu einem Word. Dann wäre genannte Routine richtig.

Übrigens gibts nen Makro:
ausblenden Quelltext
1:
MakeWord(lowByte,highByte)					


grez
msch
tommie-lie
ontopic starontopic starontopic starontopic starontopic starofftopic starofftopic starofftopic star
Beiträge: 4373

Ubuntu 7.10 "Gutsy Gibbon"

BeitragVerfasst: Do 31.07.03 15:47 
naja, er schrieb ein Integer mit 8 Bit, da ging ich von aus, daß er ein Byte meint :mrgreen:
Hab's ja auch selber geschrieben.

_________________
Your computer is designed to become slower and more unreliable over time, so you have to upgrade. But if you'd like some false hope, I can tell you how to defragment your disk. - Dilbert
opfer.der.genauigkeit Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 754
Erhaltene Danke: 1



BeitragVerfasst: Do 31.07.03 16:28 
Jo, meinte auch n Byte.
Bin wiedermal n Opfer der Genauigkeit geworden.
:wink:

_________________
Stellen Sie sich bitte Zirkusmusik vor.