Results 1 to 7 of 7

Thread: struct-at runtime

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2009
    Location
    Colombia
    Posts
    2,509

    Default struct-at runtime

    hi all

    Is there any way to create a structure (struct..End_struct) at runtime?

    I want to read a json and create a runtime structure to handle it. Am I asking too much?

    other suggestions?

    Edgar

  2. #2
    Join Date
    Nov 2008
    Location
    Round Rock, TX
    Posts
    8,850

    Default Re: struct-at runtime

    Hi Edgar,

    you can pass variables to Structure_Start and Structure_End as variables and the same with the code that creates columns and indexes.

  3. #3
    Join Date
    Feb 2009
    Location
    Brazil
    Posts
    5,447

    Default Re: struct-at runtime

    Hi dennis

    I guess he is talking about struct types, not about restructuring a table.
    Samuel Pizarro

  4. #4
    Join Date
    Mar 2009
    Location
    Beech Hill - a village near Reading in the UK
    Posts
    2,812

    Default Re: struct-at runtime

    Edgar

    Before we had structs (which are not dynamic at run-time, so you can't do what you are looking for) I used to use Array objects (in conjunction with Enum_Lists, but they are static as well) to do that sort of thing.

    You might write something which added items to such a thing based on the received JSON, but in truth, the best way to do this would be by using the cJsonObjects, which are designed for the purpose.

    Mike

  5. #5
    Join Date
    Nov 2008
    Location
    Round Rock, TX
    Posts
    8,850

    Default Re: struct-at runtime

    Ah yes, I see.

  6. #6
    Join Date
    Feb 2009
    Location
    Stuart, FL
    Posts
    5,322

    Default Re: struct-at runtime

    that would be an anonymous type and should really be supported in the language

    you can simply deserialize for example json into an anon object and then access any members of it during runtime
    Michael Salzlechner
    StarZen Technologies, Inc
    http.://www.starzen.com

    IT Director at Balloons Everywhere

    Development Blog
    http://www.salzlechner.com/dev

    DataFlex Package Manager (aka Nuget for DataFlex)
    http://windowsdeveloper.com/dfPackage

  7. #7
    Join Date
    Feb 2009
    Location
    Colombia
    Posts
    2,509

    Default Re: struct-at runtime

    Hi all

    Thank you all for your opinions

    Edgar

Posting Permissions

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