Using LOOKDOWN with multiple search ?


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Dec 2010
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by scalerobotics View Post
    Seems kind of futile, searching for characters in a known constant that is already pre-programmed into the chip. Shouldn't you already know where they are?

    Too bad:

    You are making an assumption that the list of constants is known.
    I only used the example of "mississippi" as I was unable (by definition) to give the contents of an unknown $tring as an example. It seems that LOOKDOWN, although useful for conversion to decimal, is unsuitable for scanning a string (list) of uncertain contents, where duplication may occur - as would happen with field separators. (Thanks, Bruce).
    I don't see any futility.

    Why do you say "Too bad" ?
    Last edited by electrosys; - 10th January 2011 at 15:17.

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by electrosys View Post
    You are making an assumption that the list of constants is known.
    Sorry electrosys, I said "too bad" because with
    Other methods of searching a string are likewise not being sought.
    you seem pretty reluctant to use anything other than lookdown. I assume you are looking up constants .... well, because that is what lookdown does. From the manual "LOOKDOWN Search,[Constant{, Constant...}],Var

    The reason you were asked where this list comes from, was to see what you were using it for, to see if you really wanted to use Lookdown, or if there were other alternatives that might work better for you.

    If you have PBP ver 2.60 arrayread is very nice. Here are a couple examples of how it can be used to parse strings.

    http://www.picbasic.co.uk/forum/show...5028#post85028

    http://www.picbasic.co.uk/forum/show...8422#post88422
    http://www.scalerobotics.com

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