how can I test a bit in a arrow


Closed Thread
Results 1 to 5 of 5
  1. #1
    Join Date
    Mar 2011
    Posts
    13

    Question how can I test a bit in a arrow

    hello,

    I would test a bit in a buffer of arrow
    I have a buffer of 8 bytes

    for exemple:
    buffer var byte[8]

    buffer[0] = %11110000
    buffer[1] = %10011010
    ...

    if buffer[1].2 == 1 then ... 'test bit 2 of buffer[1]

    (the value is just an exemple)
    but "buffer[1].2" don't work and return an error
    ERROR Line 93: This style array syntax not supported, (test.pbp)
    how can I test a bit in a arrow?
    Last edited by kik1kou; - 12th March 2011 at 10:33.

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,604


    Did you find this post helpful? Yes | No

    Default Re: how can I test a bit in a arrow

    Hi,
    Bit 2 of the second byte in the array would be bit 10 in the array, correct?

    So, IF Buffer.0(10) == 1 THEN

    For more in depth information please see this thread.

    /Henrik.

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: how can I test a bit in a arrow

    Quote Originally Posted by kik1kou View Post
    ...
    if buffer[1].2 == 1 then ... 'test bit 2 of buffer[1]

    (the value is just an exemple)
    but "buffer[1].2" don't work and return an error
    ERROR Line 93: This style array syntax not supported, (test.pbp)
    how can I test a bit in a arrow?
    Another idea to test bits of an array variable, use a temp variable
    Code:
    TempVar = Buffer[1]
    If TempVar.2 == 1 then.....
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Mar 2011
    Posts
    13


    Did you find this post helpful? Yes | No

    Default Re: how can I test a bit in a arrow

    Quote Originally Posted by mister_e View Post
    Another idea to test bits of an array variable, use a temp variable
    Code:
    TempVar = Buffer[1]
    If TempVar.2 == 1 then.....
    yes I do the same, but I thinked have more simple code for do it

    sorry for the english 'arrow => array' ;-)

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default Re: how can I test a bit in a arrow

    That would be great if there was a direct way to do it like you wrote, but I don't know any way to do it AS-IS.
    sorry for the english 'arrow => array' ;-)
    sssshhh, that will be our secret Don't worry... i'm not English either.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts