Home > Community > Forums > Custom IC SKILL > Saving a structure to a file and reading it back ?

Email

* Required Fields

Recipients email * (separate multiple addresses with commas)

Your name *

Your email *

Message *

Contact Us

* Required Fields
First Name *

Last Name *

Email *

Company / Institution *

Comments: *

 Saving a structure to a file and reading it back ? 

Last post Fri, Sep 15 2006 12:13 PM by archive. 1 replies.
Started by archive 15 Sep 2006 12:13 PM. Topic has 1 replies and 1263 views
Page 1 of 1 (2 items)
Sort Posts:
  • Fri, Sep 15 2006 12:13 PM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    Saving a structure to a file and reading it back ? Reply

    How do I save a user defined structure (by using defStruct) to a file and how do I retrieve it back ? Can I just use outfile( ... ) and fprintf ? Thanks, Michele


    Originally posted in cdnusers.org by micheleq
    • Post Points: 0
  • Mon, Sep 18 2006 1:18 AM

    • archive
    • Top 75 Contributor
    • Joined on Fri, Jul 4 2008
    • Posts 88
    • Points 4,930
    RE: Saving a structure to a file and reading it back ? Reply

    Not directly. It's easy enough to write something that would do this though - for example, the following writes out a SKILL statement to recreate the structure (note, it doesn't assign the result to a variable, so you'd need to adapt it to your needs).

    procedure(ABwriteStruct(file struct)
    fprintf(file "make_%s%L\n" type(struct)
    foreach(mapcan arg struct->?
    list(concat(? arg) get(struct arg))
    )
    )
    )

    Regards,

    Andrew.


    Originally posted in cdnusers.org by adbeckett
    • Post Points: 0
Page 1 of 1 (2 items)
Sort Posts:
Started by archive at 15 Sep 2006 12:13 PM. Topic has 1 replies.