SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 3 of 3
  1. #1
    Senior Member
    Join Date
    Sep 2003
    Location
    Mission, KS
    Posts
    148
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    ListFind fails with lists of records

    I have a simple record defined:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">type REPORTNAMEREC is record
    string sName
    boolean bMatch
    </pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">I declare a list of REPORTNAMEREC and add items to it. Later, I see if there's a string in the list...

    [CODE]
    iIndex = ListFind(myList,{"name",FALSE})
    {/CODE]

    Even though myList has a record that matches the "name" and boolean, ListFind returns zero. I tried using just the name string, and ignoring the boolean, but that doesn't work either.

    The help claims the second parameter can be ANYTYPE, and this looks to me like the correct syntax to specify a record with two items.

    Dana

  2. #2
    Senior Member
    Join Date
    Feb 2000
    Posts
    1,497
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ListFind fails with lists of records

    Casting your literal record to the expected record type:

    </font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">iIndex = ListFind(myList,[REPORTNAMEREC]{&quot;name&quot;,FALSE})</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">should work.


    John

  3. #3
    Senior Member
    Join Date
    Sep 2003
    Location
    Mission, KS
    Posts
    148
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: ListFind fails with lists of records

    Completely forgot about casting...thanx!

    Dana

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 11.54%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 08:02 PM.

Copyright BetaSoft Inc.