VS:SetWSCellFormulaN/ja

From Vectorworks Developer
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

Description

ハンドルで指定したワークシートの、指定したセルの式を設定します。

PROCEDURE SetWSCellFormulaN(
worksheet :HANDLE;
topRow :INTEGER;
leftColumn :INTEGER;
bottomRow :INTEGER;
rightColumn :INTEGER;
formula :DYNARRAY[] of CHAR);
def vs.SetWSCellFormulaN(worksheet, topRow, leftColumn, bottomRow, rightColumn, formula):
    return None

Parameters

worksheet HANDLE ワークシートのハンドル
topRow INTEGER 上の行
leftColumn INTEGER 左の列
bottomRow INTEGER 下の行
rightColumn INTEGER 右の列
formula DYNARRAY[] of CHAR

Example

PROCEDURE WStest;
   VAR
       autoRecalcState : BOOLEAN;
       worksheet : HANDLE;
       inString : DYNARRAY [] OF CHAR;
BEGIN
   inString := '';

   worksheet := CreateWS('MyWS', 5, 5);

   RectangleN(0, 0, 1, 0, 1, 1);

   {Save the current AutoRecalc state}
   autoRecalcState := GetWSAutoRecalcState(worksheet);

   {Turn off worksheet Auto Recalculation}
   SetWSAutoRecalcState(worksheet, false);

   { inserts a formula into a single cell }
   inString := '=3*2';
   SetWSCellFormulaN(worksheet, 1, 2, 1, 2, inString);

   { inserts a formula into a range of cells }
   inString := '<empty>';
   SetWSCellFormulaN(worksheet, 1, 3, 2, 4, inString);

   { creates a database subrow for the type 'RECT' }
   inString := '=DATABASE((T=RECT))';
   SetWSCellFormulaN(worksheet, 3, 0, 3, 0, inString);

   { inserts a formula into a database row cell }
   inString := '=T';
   SetWSCellFormulaN(worksheet, 3, 1, 3, 1, inString);

   {Restore AutoRecalc state}
   SetWSAutoRecalcState(worksheet, autoRecalcState);

   {Now recalculate the worksheet}
   RecalculateWS(worksheet);
END;
RUN(WStest);

Version

利用可能バージョン: Vectorworks 2012

See Also

関連関数:

VS:GetWSAutoRecalcState | VS:SetWSAutoRecalcState

関連関数:

[[VS:GetWSAutoRecalcState]]

| [[VS:SetWSAutoRecalcState]]