1. return a 2-byte binary representation of a string sequence

Hello all,

Dumb question as my brain is not functioning

How do I return a 2-byte binary representation of a string sequence?

Euman

new topic     » topic index » view message » categorize

2. 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?
> 
> Euman

new topic     » goto parent     » topic index » view message » categorize

3. Re: return a 2-byte binary representation of a string sequence

----- 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

new topic     » goto parent     » topic index » view message » categorize

4. Re: return a 2-byte binary representation of a string sequence

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

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu