FindFirstEmpty
Find first column of last empty range in a worksheet or the first empty MatrixObject in a MatrixLayer
int FindFirstEmpty( int nC1 = 0, BOOL bContiguous = true )
Column or MatrixObject index in the layer or -1 if no empty range or matrixobject found
EX1
//Find first empty range in a worksheet or the first empty MatrixObject in a MatrixLayer void Datasheet_FindFirstEmpty_Ex1() { Page pg = Project.Pages(); foreach(Layer ly in pg.Layers) { Datasheet dats = ly; if(!dats) { out_str("Active Window is not a Workbook or Matrix Book"); return; } int nn = dats.FindFirstEmpty(); if(nn == 0) printf("Sheet %s is empty.\n", dats.GetName()); else if(nn < 0) printf("Sheet %s is Not empty, there is no contigueous col/mat from the end.\n", dats.GetName()); else printf("Col/Mat %d(0-offset) begins a contigueous empty block in sheet %s.\n", nn, dats.GetName()); } }
origin.h