SPONSORS:






User Tag List

Results 1 to 3 of 3
  1. #1
    Member
    Join Date
    Jun 2000
    Posts
    50
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Recursive FieldsOfRecord

    I'm trying to get all of the field names for a record types that contains other records.
    For example:

    type TESTRECORD is record
    string first
    string second
    string third

    type MAINRECORD is record
    string name
    TESTRECORD one
    TESTRECORD two

    MAINRECORD Test

    Say I would like to get all of the field names for a MAINRECORD variable, including the ones owned by the TESTRECORD.

    LIST OF STRING allfields = FieldsOfRecord(MAINRECORD)
    string onefield
    for each onefield in allfields
    // if (TypeOf(onefield) == "DATATYPE")

    This will fail because FieldsOfRecord returns strings instead of types. Any solutions ?

  2. #2
    Junior Member
    Join Date
    Oct 1999
    Location
    Germany
    Posts
    24
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recursive FieldsOfRecord

    I think you should use the '@' operator like this:

  3. #3
    Member
    Join Date
    Jun 2000
    Posts
    50
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: Recursive FieldsOfRecord

    Yup. The @ operator was the solution. Thanks again Bjoern !

    Here's the code I wrote to go through the contents of a custom datatype (2 levels only) until reaching a STRING datatype. If this STRING variable == "empty", change it to "". Just in case anyone else ever wants to do this.

    Works wonderfully. :-)

    [This message has been edited by nirg (edited 07-19-2000).]

    [This message has been edited by nirg (edited 07-19-2000).]

 

 

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 09:01 AM.

Copyright BetaSoft Inc.