Shop OBEX P1 Docs P2 Docs Learn Events
packing a long with an array of numbers and letters? — Parallax Forums

packing a long with an array of numbers and letters?

grasshoppergrasshopper Posts: 438
edited 2008-04-16 21:36 in Propeller 1
How can i make a "long" using and array of numbers and letters
for example
var

long strings[noparse][[/noparse]6]
long all_together
long part_together


Main

string[noparse][[/noparse] 0 ] := "C"
string[noparse][[/noparse] 1 ] := "O"
string[noparse][[/noparse] 2 ] := "O"
string[noparse][[/noparse] 3 ] := "L"
string[noparse][[/noparse] 4 ] := "3"
string[noparse][[/noparse] 5 ] := "4"





Now i wish to make it so that [noparse][[/noparse]all_together is COOL34] and [noparse][[/noparse]part_together could be COL4] I don't want to add them or AND them etc. Can i bit shift??

look forward to any help

Comments

  • davrandavran Posts: 12
    edited 2008-04-16 21:03
    the question is what is the value of LOOP34 you now it is an array so no value no assignment.

    doesnt the string designer fit your need?
    such as :


    variable :=string($01,$C,8,$0a,11,$0b,1," Atikus elektronik ")

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "Give a lie twenty-four hours start, and it will take a hundred years to overtake it.
    " (C.F. Dixon-Johnson, British author of the 1916 book, "The Armenians," appalled over the deceitful practices of his book's subject.)

    www.tallarmeniantale.com/
  • Mike GreenMike Green Posts: 23,101
    edited 2008-04-16 21:36
    You can say "all_together.byte[noparse][[/noparse] i ]" where "i" is a value from 0 to 3. If you put "part_together" after "all_together", then you can use subscripts from 4 to 7 to refer to the bytes of "part_together".
Sign In or Register to comment.