Shop OBEX P1 Docs P2 Docs Learn Events
Arr to string — Parallax Forums

Arr to string

SweLoganSweLogan Posts: 11
edited 2006-04-08 17:23 in BASIC Stamp
SERIN 16,Baud,[noparse][[/noparse]STR tagstring\4]

how do i use the tagstring in a select case then?

i get errors like (Expected a constant, variable, unary operator, or '(')

Comments

  • Tracy AllenTracy Allen Posts: 6,658
    edited 2006-04-08 17:23
    You can't use strings as such in a SELECT-CASE. It has to be a numerical variable. You can use single characters such as
    SELECT mychar
    CASE "A"
    or pairs of characters, such as
    SELECT mychars
    CASE "A" * 256 + "B" ' for string AB, converted to Word variable
    but for a four character string I think you would have to do it in two steps, which would be easiest if you can organize your tagstring into meaningful two letter subcatagories.
    mycharsA = tagstring(0) * 256 + tagstring(1)
    mycharsB = tagstring(2)*256 + tagstring(3)

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Tracy Allen
    www.emesystems.com
Sign In or Register to comment.