1. return a 2-byte binary representation of a string sequence
- Posted by "H.W Overman" <euman at bellsouth.net> Nov 08, 2003
- 722 views
Hello all, Dumb question as my brain is not functioning How do I return a 2-byte binary representation of a string sequence? Euman
2. Re: return a 2-byte binary representation of a string sequence
- Posted by "H.W Overman" <euman at bellsouth.net> Nov 08, 2003
- 681 views
Im close I think with this: pointer = poked string sequence result = remainder(floor(pointer/256),256) Maybe Im wrong Euman > Hello all, > > Dumb question as my brain is not functioning > > How do I return a 2-byte binary representation of a string sequence? > > Euman
3. Re: return a 2-byte binary representation of a string sequence
- Posted by Derek Parnell <ddparnell at bigpond.com> Nov 08, 2003
- 711 views
----- Original Message ----- From: "H.W Overman" <euman at bellsouth.net> To: <EUforum at topica.com> Subject: Re: return a 2-byte binary representation of a string sequence > > > Im close I think with this: > > pointer = poked string sequence > result = remainder(floor(pointer/256),256) > > Maybe Im wrong > > Euman > > > Hello all, > > > > Dumb question as my brain is not functioning > > > > How do I return a 2-byte binary representation of a string sequence? > > What the....??? And if the string is longer than two bytes? Well that was my first reaction, but from your 'example' it seems you are trying to get the lower 16-bits of a RAM address. Is that what you are trying for? If so just do this... result = and_bits(#FFFF, pointer) -- Derek
4. Re: return a 2-byte binary representation of a string sequence
- Posted by Pete Lomax <petelomax at blueyonder.co.uk> Nov 08, 2003
- 749 views
On Sat, 8 Nov 2003 15:08:00 -0500, "H.W Overman" <euman at bellsouth.net> wrote: > >Im close I think with this: > >pointer = poked string sequence >result = remainder(floor(pointer/256),256) > >Maybe Im wrong > I'm not getting a clear picture of what you want here, but this was lying around somewhere, if it is any help: function Peek2u(atom x) -- returns a 2 byte signed word from address x return peek(x+1)*#100 + peek(x) end function Pete Pete http://palacebuilders.pwp.blueyonder.co.uk/euphoria.html