Re: boolean sequence

new topic     » goto parent     » topic index » view thread      » older message » newer message

Me wrote:

> Tone Skoda wrote:
>
>> can you also add support for char (8 bit) and short (16 bit). i don't
>> know how to handle signed or unsigned numbers for these two types?
>
> You are welcome.
>
> Do you want that those routines use 0 as base index like the bit
> routines (AFAIK this is standard for manipulating bits), or that they
> use 1 as base index like standard Eu sequences?

<snip>

> function put_byte()
>    -- It doesn't matter, whether or not the byte to put is signed or
>       unsigned.
> function get_byte_u()
>    -- return an *unsigned byte*
> function get_byte_s()
>    -- return a *signed byte*
>
> [The 3 functions above are very similar to poke(), peeku(), and peeks()]

peeku() and peeks() do not exist in Eu, of course. I was meaning peek4u()
and peek4s().

> function find_byte_forward_u()
>    -- find an *unsigned byte*
> function find_byte_forward_s()
>    -- find a *signed byte*
> function find_byte_reverse_u()
>    -- find an *unsigned byte*
> function find_byte_reverse_s()
>    -- find an *signed byte*

<snip>

In the meantime I realized, that it's not necessary to make two
different functions for find_byte_forward() and for find_byte_reverse(),
respectively.

So I think the following functions are straightforward:
---------------------------------------------------------------------
   function put_byte   (sequence_of_long s, integer number, byte val)
   function get_byte_u (sequence_of_long s, integer number)
   function get_byte_s (sequence_of_long s, integer number)
   function find_byte_forward (sequence_of_long s, byte val)
   function find_byte_reverse (sequence_of_long s, byte val)
---------------------------------------------------------------------

Do you want it 0-based or 1-based?

I'll post the byte functions first. When they are OK for you, I'll
easily make the respective functions concerning small integers.

Regards,
   Juergen

-- 
A: Because it considerably reduces the readability of the text.
Q: Why?
A: Top posting.
Q: What is annoying in e-mail and news?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu