struct in a struct



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 19/11/2003 at 16:42, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   8.206 
    Platform:      
    Language(s) :   C.O.F.F.E.E  ;

    ---------
    is it possble to have a struct variable in a struct?
    Iv'e just spent 2 hours porting some c++ header code into a coffee version, and i'm coming to the end of the porting and the last few structs have structs as variables (There are alot of structs). Because coffee can't directly read a data from a file into a struct (I'm making an importer plugin), I have had to do it byte by byte and add the data to my own structs. Iv'e managed to do it, but now I'm not sure what do to.... for the best (as in easy)
    Example problem:
    I would like to convert somethng like this into a coffee format (this is just an example i made up)
    struct Location
    {
     String Name;
     Long PhoneNumber;
    }
    struct Person
    {
      String Name;
     Location Area; 
    }
     
    As you can see the Person Struct has a variable of type Location. Because coffee variables are untyped, im not sure a way to do this.
    I *could* do this to get around the problem
    struct Person
    {
     var Name;
     var LocationName;
     var LocationPhone;
    }
    but the structures im dealing with have many members, and would require me to make large structures alot of times.
    I would just like know if there is an easier method to do this.
    Thanks



  • THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

    On 20/11/2003 at 02:35, xxxxxxxx wrote:

    It doesn't matter. I managed to do it by using class's instead of structures


Log in to reply