Shop OBEX P1 Docs P2 Docs Learn Events
Bytemove question — Parallax Forums

Bytemove question

Don MDon M Posts: 1,652
edited 2014-04-23 20:52 in Propeller 1
Lets say I have a byte buffer named Work_Buffer that has 80 bytes in it.

If I want to move just a portion (9 bytes) of the buffer starting at byte 64 into another buffer named Buffer2 is this a valid command?
  bytemove(@Buffer2, @Work_Buffer[64], 9) 

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2014-04-23 18:57
    Yes.

    I'm not sure why, but I tend to use "@Work_Buffer + 64" rather than "@Work_Buffer[64]" but I'm almost positive your way will also work (and might even be more correct).
  • Don MDon M Posts: 1,652
    edited 2014-04-23 19:05
    Duane- Thanks. I got it to work.
  • ElectrodudeElectrodude Posts: 1,658
    edited 2014-04-23 20:52
    @Work_Buffer[64] is the same as @Work_Buffer + 64*(1/2/4 for byte/word/long). If it's an array of some type but you want to treat it as an array of different size elements, you can use @Work_Buffer.byte[64] or @Work_Buffer.word[64] or @Work_Buffer.long[64] to treat it as a byte or word or long array, respectively. If it's a byte array and you want to treat it as such, what Duane Degn said will work fine.

    electrodude
Sign In or Register to comment.