IsVirtual
To check if the matrix object is a virtual matrix.
BOOL IsVirtual(DataRange* pRange = NULL)
returns true if the matrix object is a virtual matrix, else false.
EX1
1. Copy the following data and paste into an empty Worksheet.
2. Select the whole Worksheet and run the following command to create a virtual matrix named "vm1".
w2vm format:=xacross rowpos:=selrow1 colpos:=wkscol1 vmname:=vm1;
3. Run the following sample function.
int MatrixObject_IsVirtual_ex1() { MatrixObject matObj; matObj.Attach("vm1"); // attach to virtual matrix by name // matObj should be virtual matrix DataRange dr; if( matObj && matObj.IsVirtual(&dr) ) { out_str("matObj is Virtual Matrix."); // convert range to tree and output Tree tr; dr.GetTree(tr, false); out_tree(tr); } MatrixPage matPage; matPage.Create("Origin"); MatrixLayer ml = matPage.Layers(0); MatrixObject matObj2 = ml.MatrixObjects(0); // matObj2 should not be virtual matrix if( matObj2 && !matObj2.IsVirtual() ) { out_str("matObj2 is NOT Virtual Matrix."); } return 1; }
origin.h