From MdsWiki
|
Ident Data Type MDSplus expressions can contain private and public variables (often called "Ken Variables" after the person that implemented most of TDI, Ken Klare). When an expression is compiled containing these variables, the reference to the variable is stored as an DTYPE_IDENT distinguishing the name from a node reference or a text string. When an expression containing variable references are evaluated, the current contents of the variable is substituted for this reference. Care should be taken to not store variable references as data in nodes or return them in TDI function unless they are guaranteed to be correctly defined when the expression is evaluated. The MAKE_structure built-in functions are provided to ensure that the variables are dereferenced. For example, if your TDI function looked something like: INCORRECT!
Public Fun MYFUN(IN _X, IN _Y) { return(BUILD_SIGNAL(_Y,*,_X)); } You would get unexpected results. In this case when you try to plot the signal returned, you would get the current contents of the private variables _X and _Y if they are defined at all and not necessarily the values passed into the function. To avoid this you would use the MAKE_SIGNAL function instead of the BUILD_SIGNAL function. The MAKE_SIGNAL function replaces any of its arguments that are Identifiers with the contents of that identifier. CORRECT!
Public Fun MYFUN(IN _X, IN _Y) { return(MAKE_SIGNAL(_Y,*,_X)); } The following table lists some of the functions used to create or access the ident datatype:
|