Here is a simple script that will do what you are asking
Names Default To Here( 1 );
// Create a sample data table
dt = New Table( "Untitled 4",
Add Rows( 3 ),
New Column( "Label",
Character,
"Nominal",
Set Values( {"#1", "#2", "Difference"} )
),
New Column( "A",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [5, 6, .] ),
Set Display Width( 43 )
),
New Column( "B",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [9, 7, .] )
),
New Column( "C",
Numeric,
"Continuous",
Format( "Best", 12 ),
Set Values( [12, 4, .] ),
Set Display Width( 43 )
)
);
// Here is the code to subtract the values
For( i = 2, i <= N Cols( dt ), i++,
Column( dt, i )[3] = Column( dt, i )[1] - Column( dt, i )[2]
);
Jim