STR ArrayVar question


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,612


    Did you find this post helpful? Yes | No

    Default Re: STR ArrayVar question

    Hi,
    That "clumsy formating" makes perfect sense so yes, it would be the last example. And yes, with WAIT or WAITSTR it does wait for the specified qualifier(s) and THEN start "saving". I guess, since you know what the qualifiers are, you should be able to add those bytes back in "manually" when you do the checksum?

    It's all just numbers, as you know a byte can hold a value between 0 and 255. If myVAR holds the value 65 and you do HSEROUT[myVAR] to a terminal (or your serial LCD) you'll get "A" because 65 is the ASCII code for "A". But if you want the numeric value 65 to be displayed PBP needs to send two bytes, namely 54 and 53 which are the ASCII codes for "6" and "5" and this is what the DEC modifier does. There's no way for the STR modifier to know if/when you want it to send "6", "5" instead of 65.

    If your had your values in an array you could, instead of a for-next loop simply done something like:
    Code:
    HSEROUT [#myArray[0], #myArray[1], #myArray[2]]
    Don't know which are the most effective, time- or codewise but it's an alternative. Ah, you get it.

    /Henrik.

  2. #2
    Join Date
    May 2011
    Posts
    3


    Did you find this post helpful? Yes | No

    Default Re: STR ArrayVar question

    LOL - yes, I get it. I think from an "ease of use" I'll stick with the FOR/NEXT loop (less typing than all those array vars) .

    Thanks again for the help.

Members who have read this thread : 1

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