Difference between revisions of "Splicing Commands"

 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
(new to 4.0)  Available as in build 4.0.0.32 or later.
+
[[Category: Typescript Commands‏‎]]
  
If an index is changed external to the Analytica User Interface -- such as if it is modified as an expression, if its index values are computed, or if it is updated from ADE, Table definitions using that index may need to be re-written.  This process is called ''splicing''.  Splicing does not always occur immediately -- Analytica is likely to wait until the table definition is required before initiating the splice operation. 
+
__TOC__
  
Normally, the fact that definitions are being spliced, and when they are being spliced, is transparent to you as a user of Analytica.  However, occassionally there are reasons you might want to force the splice to occur.  If you about to save a model, and you want to minimize load time and evaluation time for users or ADE applications that use the model, then you might want to force splicing to occur before saving, so this cost won't have to be paid by people using the model later.  A second concern is that there is a possibility that evaluation errors might occur when Analytica performs the splice (since some indexes and their predecessors might need to be recomputed, for example).  When you initiate the splice explicitly, you can control when the errors occur.
 
  
= SpliceIndex all =
+
If an index changes for a reason other than the user changing via the Analytica User Interface -- such as if it is computed from other variables that change, or it is updated via the API in [[ADE]] -- it may affect Edit Tables that use that index.  This process is called ''splicing''.  Usually Analytica  waits until the table definition is needed before performing the splice, rather than doing it immediately an index changes. 
 +
 
 +
Normally, the Analytica user won't notice, or need to know, when the splice happens.  Occasionally, you may want to force the splice:  One reason is when you want to save a model, and want to incur the splice effort before saving rather than on loading the model, which may add to load and evaluation time. Another is to check for possible errors caused by the splice immediately. By forcing the splice, you will see any such errors. The commands [[SpliceIndex]] and [[SpliceTable]] give you ways to do that from the Typescript or a Button Script.
 +
 
 +
== SpliceIndex ''all'' ==
  
 
Forces all unspliced indexes and tables to be updated.  This is equivalent to:
 
Forces all unspliced indexes and tables to be updated.  This is equivalent to:
SpliceTable all
+
<code>SpliceTable all</code>
 +
 
 +
== SpliceTable ''var''==
 +
Splices the table definition of «var» to reflect the current values of all its indexes. It splices all indexes of var, and all other tables that use those indexes.
  
= SpliceTable ident =
+
== SpliceIndex ''i''==
 +
Forces index «i» to be spliced.  It updates all child table definitions, although not necessarily each child table, since it might contain other unspliced indexes.
  
Splices the table definition of ''ident'' to reflect the current values of all its table indexesAll indexes of ident are spliced, and all child tables of those indexes are spliced.
+
==History==
 +
New to Analytica version 4.0; available as in build 4.0.0.32 or later.
  
= SpliceIndex ident =
+
In builds Analytica 4.4.1 and 4.4.2 (but not 4.3, and fixed in patch 4.4.3), there is a bug with <code>SpliceIndex All</code> which has an easy workaround.  With the bug, <code>SpliceIndex All</code> does not take effect immediately, but will take effect when another splice index occurs.  The work around is to execute <code>SpliceIndex All</code>, then immediately execute [[SpliceIndex]] [[Time]] (you can do it on any index).  After the second [[SpliceIndex]], the <code>All</code> will take effect.
  
Forces the index identified by ''indent'' to be spliced.  All child table definitions are updated, although each child table might not be fully updated, since each table might contain other unspliced indexes.
+
== See Also ==
 +
* [[Table Splicing]]
 +
* [[Splice a table when computed indexes change ]]

Latest revision as of 20:51, 16 May 2016



If an index changes for a reason other than the user changing via the Analytica User Interface -- such as if it is computed from other variables that change, or it is updated via the API in ADE -- it may affect Edit Tables that use that index. This process is called splicing. Usually Analytica waits until the table definition is needed before performing the splice, rather than doing it immediately an index changes.

Normally, the Analytica user won't notice, or need to know, when the splice happens. Occasionally, you may want to force the splice: One reason is when you want to save a model, and want to incur the splice effort before saving rather than on loading the model, which may add to load and evaluation time. Another is to check for possible errors caused by the splice immediately. By forcing the splice, you will see any such errors. The commands SpliceIndex and SpliceTable give you ways to do that from the Typescript or a Button Script.

SpliceIndex all

Forces all unspliced indexes and tables to be updated. This is equivalent to: SpliceTable all

SpliceTable var

Splices the table definition of «var» to reflect the current values of all its indexes. It splices all indexes of var, and all other tables that use those indexes.

SpliceIndex i

Forces index «i» to be spliced. It updates all child table definitions, although not necessarily each child table, since it might contain other unspliced indexes.

History

New to Analytica version 4.0; available as in build 4.0.0.32 or later.

In builds Analytica 4.4.1 and 4.4.2 (but not 4.3, and fixed in patch 4.4.3), there is a bug with SpliceIndex All which has an easy workaround. With the bug, SpliceIndex All does not take effect immediately, but will take effect when another splice index occurs. The work around is to execute SpliceIndex All, then immediately execute SpliceIndex Time (you can do it on any index). After the second SpliceIndex, the All will take effect.

See Also

Comments


You are not allowed to post comments.