Shop OBEX P1 Docs P2 Docs Learn Events
DAT Blocks — Parallax Forums

DAT Blocks

g3cwig3cwi Posts: 262
edited 2012-03-18 03:56 in Propeller 1
Hi

Are these global? I want to tidy some code up and the DAT block for one object could really do with being moved to another one.

Thanks

Richard

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2012-03-18 03:56
    Maybe not as global as you think ;o)

    DAT blocks are global within a single .SPIN file. So, if you have an object that includes a DAT section and you use this object in several other places, there will only be one copy of the DAT section.
    OBJ
      ob1: "DATcontainer"
      ob2: "DATcontainer"
      ob3: "SomethingElse"
    
    ...
    SomethingElse.spin:
    OBJ
      subobj1: "DATcontainer"
    ...
    
    There will only be one DAT for all, ob1, ob2 and subobj1 !

    But if you copy some DAT from file A to file B you will have two copies.
Sign In or Register to comment.