Window Functions in DIAL

The window functions in DIAL operate on the bottom window of a cBase, Model, or Marker.

Window Example

The following script demonstrates Window function usage. Comments are included in the script.

diveline.connect("localhost", "dial_user");

diveline.set_project("myProject");

marker.open(mymodel,"/models/salesperson.mrk");

 

// Counts the rows in a window

console.writeln("This windows contains \t" +window.row_count(mymodel) +"\t rows.");

 

// Tests if BAKER is in the bottom window

if (window.select_row(mymodel, "Baker")) {

console.writeln("Baker's Revenue Total is:\t" +Total[mymodel.Revenue]);

} else console.writeln("I did NOT find Baker in the window");

 

// Displays the Dimension Value and Revenue for row 5 of the bottom window

window.select_row_index(mymodel, 5);

console.writeln(Dimension[mymodel.Salesperson] +"s Revenue is\t" +Total[mymodel.Revenue]);

 

// Displays the type of the bottom window

console.writeln("The bottom window is of type\t" +window.type(mymodel));

 

// Disconnects

diveline.disconnect();