Does anyone know how to......


Closed Thread
Results 1 to 6 of 6
  1. #1

    Default Does anyone know how to......

    I have a string, call it INPUT, and it is 16 chars long. how to I check the FIRST or LAST char? What I would like to do is something like:

    if (input<<1) <> "*" then goto FAILURE

    But that obviousley isn't how to do it.

    HELP!!!!!!!!!!

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    Move the string into an array then you can check any of the array elements.
    Code:
    SERIN2 PORTB.5,24972,[WAIT("A"),STR NUMS\16]
    IF NUMS[0] = ??? then ...
    Dave
    Always wear safety glasses while programming.

  3. #3


    Did you find this post helpful? Yes | No

    Talking That was too easy.....

    But it worked. That was staring me in the face. Cheers Dave, and thanks

  4. #4
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    I've been away from PBP for a couple of years, and a lot of 'STR' stuff is new to me. I always see STR arrays being loaded from the serial port. Here's my dumb question...

    Is there a way to quickly load a STR array manually, i.e.

    ARRY var BYTE[10]

    ARRY = "Testing"

    or something similar, or must we do it like:

    ARRY[0] = "T"
    ARRY[1] = "e"
    etc.
    etc.

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Do a search for copystring, one of those 2 threads is right...well, the first few posts of it anyways should give you a few ideas.

  6. #6
    Join Date
    Dec 2008
    Location
    Los Angeles, CA
    Posts
    156


    Did you find this post helpful? Yes | No

    Default

    That's very cool! Thanks.
    Last edited by circuitpro; - 10th December 2008 at 06:26.

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