Type: Integer
Availability: Read or write at run time for tables
The sheet property contains the index of the current sheet for the Table control. This sheet value is used in the access of the table control properties. Changing the sheet property does not affect the sheet that is displayed. Using the topSheet property can change the sheet that is displayed. Sheet access is 1-relative.
The following example shows the use of the sheet property in a method that updates a table.
vars
count, entry, row, sheet : Integer;
companiesPerSheet : Integer;
company : Company;
begin
// work out number of rows per sheet
count := app.myMarket.allCompanies.size div 3;
if (count * 3) < app.myMarket.allCompanies.size then
companiesPerSheet := count + 1;
else
companiesPerSheet := count;
endif;
entry := 1;
count := 0;
tblPrices.sheet := 1;
if reason = Price_Change and changedCompany <> null then
findCompanyInTable(changedCompany, companiesPerSheet, sheet, row);
return;
endif;
foreach company in app.myMarket.allCompanies do
sharedLock(company);
tblPrices.row := tblPrices.row + 1;
tblPrices.column := 1;
tblPrices.text := company.shortName;
// set column on item Object to company
tblPrices.itemObject := company;
tblPrices.column := 2;
tblPrices.text := company.name;
tblPrices.column := 3;
tblPrices.accessMode := Table.AccessMode_Column;
tblPrices.alignment := Table.Alignment_Right;
tblPrices.text := company.currentPrice.currencyFormat;
tblPrices.column := 4;
tblPrices.accessMode := Table.AccessMode_Column;
tblPrices.alignment := Table.Alignment_Right;
tblPrices.text := company.availableShares.String;
entry := entry + 1;
if count = 0 then
tblPrices.sheetCaption := company.shortName;
endif;
count := count + 1;
if count >= companiesPerSheet then
count := 0;
tblPrices.rows := tblPrices.row;
tblPrices.sheetCaption := tblPrices.sheetCaption &
" - " & company.shortName;
if tblPrices.sheet < 3 then
tblPrices.sheet := tblPrices.sheet + 1;
endif;
endif;
unlock(company);
endforeach;
if count <> 0 then
tblPrices.rows := tblPrices.row;
endif;
end;