123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|113|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Blitz Max -> Byte Array to Integer?

Tue, 02 Feb 2010, 07:27
Mog
I'm playing around with a small difference editor i'm tinkering with, and i dump everything into a byte array. I'm trying to work through 4-byte chunks and convert them into an integer to see what those 4 would look like if they were infact an int - anyone have any clue as to how to do this in blitzmax?

-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene
Tue, 02 Feb 2010, 07:48
Jayenkai
1,2,3,4 -> 32 = 1 shl 24 + 2 shl 16 + 3 shl 8 + 4
or ...
4 shl 24 + 3 shl 16 + 2 shl 8 + 1
depending on which around way you want it.

(assuming that's what you meant!?)


-=-=-
''Load, Next List!''
Tue, 02 Feb 2010, 08:06
Mog
Great stuff, J.

Always get my bitwise operators muddled up -- kept getting odd results ;/

-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene
Tue, 02 Feb 2010, 20:51
Mog
it's all good- already used J's shift-left routine to great avail - check it out:


Making a visual hex editor that shows if a file is modified- and what values changed.


-=-=-
I am Busy Mongoose - My Website

Dev PC: AMD 8150-FX, 16gb Ram, GeForce GTX 680 2gb

Current Project: Pyroxene
Tue, 02 Feb 2010, 21:47
Erebel55
That's awesome Mog Looks good so far.