MakeChangesInTable

Revision as of 06:39, 21 October 2008 by Lchrisman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

New to Analytica 4.2

Command MakeChangesInTable

MakeChangesInTable is a typescript command that can change individual cells within variable defined as a Table, IntraTable, DetermTable or ProbTable. It has been introduced into the Analytica 4.2 release for internal purposes -- specifically for the purpose of recording small changes to very large edit tables in the auto-recovery change log. Prior to this command's introduction, when a single cell was changed in a large edit table, the entire new table definition has to be written to the auto-recovery change-log. For large edit tables (like an edit table with 1M cells), the created a sizeable delay. With Analytica 4.2, by using MakeChangesInTable, Analytica is able to write only the cells that actually changed to the change log.

Although it is not intended for other uses beyond this, it could be used from a button script or from the typescript window to change individual cells in an edit table. It can also be used to change the table type (e.g., converting a DetermTable to a Table, etc.

Simple Examples

Before describing the full syntax, which is fairly complex, a few simple examples will be shown first.

MakeChangesInTable X Table(I) 2(4.7) → Changes X[@I=2] to 4.7
MakeChangesInTable X Table(I) 8(1+2,'a') &arr; Changes X[@I=8] to 1+2, and X[@I=9] to 'a'

In the second example, notice that 1+2 is the cell contents plugged into the edit table. It is an expression, but MakeChangesInTable just places it in the cell, it does not evaluate it when doing so.

MakeChangesInTable X Table(I) 4('a'),7('b') → Sets X[@I=4] to 'a' and X[@I=7] to 'b'
MakeChangesInTable Y Table(I,J) 9(11('c')) &rarr Sets Y[@I=9,@J=11] to 'c'
MakeChangesInTable Y Table(I,J) 9(11('c','d')),7(4('e'), 6('f'))
→ Sets Y[@I=9,@J=11] to 'c', Y[@I=9,@J=12] to 'd', Y[@I=7,@J=4] to 'e' and Y[@I=7,@J=6] to 'f'

Syntax

MakeChangesInTable «ident» «tableType»(«indexList») «changes»

where

  • «ident» : The variable defined as a table
  • «tableType» : One of Table, IntraTable, DetermTable or ProbTable
  • «indexList» : Comma-separate list of the table indexes. It must contain all table indexes (but the order does not have to match the order in the original definition). The order they are listed here determines the order of representation in «changes».

«changes» : Specifies the coordinates of changed values and the new values.

Comments


You are not allowed to post comments.