SPONSORS:






User Tag List

Results 1 to 4 of 4
  1. #1
    Junior Member
    Join Date
    Jul 2002
    Location
    Columbia, MO, USA
    Posts
    17
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Looping through a record?

    I have a record type in which is populated by each line of a text file. What I would like to do is keep looping through the record until the text file is finished. Each time through the loop I am comparing each field in the record to a variable. Is it possible to loop through a record type? If not, does anyone have a solution for what I am trying to do?
    Jill Vannausdle

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

    Re: Looping through a record?

    Actually, from that description, I'm not real sure what is that you want to do!

    Looping through a list of records is easy:


    For each rRecord in lrRecord
    ...

    Looping through each of the fields defined within a given record type is a little more interesting:

    list of string lsFields = FieldsOFRecord(record_type_goes_here)

    For each sField in lsFields
    ...


    Does that help?


    John


    ------------------

  3. #3
    Junior Member
    Join Date
    Aug 2002
    Location
    SF, CA, USA
    Posts
    2
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Looping through a record?

    Yes it is possible. You might want to use "FieldsOfRecord" function. What it does it returns all the field names as a List of String. So you can have something like:

    for each 'some_variable' in
    FieldsOfRecord('recoredtype')
    do ........

    I hope this helps

    ------------------

  4. #4
    Senior Member
    Join Date
    Aug 1999
    Location
    Cambridge, UK
    Posts
    470
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Looping through a record?

    Yes, I have written several functions which do exactly this; very useful when we are dealing with extracting data from a database table and comparing each field to a predicted value, for example.
    You need to use the reference operator thus:
    ------------------

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

vBulletin Optimisation provided by vB Optimise v2.6.0 Beta 4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.0.9 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Questions / Answers Form provided by vBAnswers (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominatevBulletin 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 12:21 AM.

Copyright BetaSoft Inc.