You are here: Tips and Tricks > Storing Data

Storing Data

Three facilities are provided for managing data such that it can be saved during one method invocation and retrieved during another:

  1. DecoderScript variables are really just a special case of fields that allow you to store pieces of data of up to 64 bits in size. The unique value of such variables is that they can be referred to in DecoderScript statements and passed to methods. Their scope is limited to the decoding of one particular protocol layer.
  2. Standard C++ module-level variables allow you to store arbitrary data between calls to methods that reside in the same DLL. The scope of such variables is at least the decoding of one instance of a layer. We mention this because it is something a programmer might think of doing. We consider the safety of this to be questionable, and do not recommend its use. The problem is that there is no guarantee about the order in which methods will be called. It may vary from release to release, or on how the user manipulates the Frame Display, or several other factors.
  3. If you need to store any data that must persist beyond these boundaries then you must use a Decoder Data Object. Decoder Data Objects endure for an entire analysis session.