VS:GetWSCellStringN

From Vectorworks Developer
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

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

Description

Returns the displayed string value of a cell in the referenced worksheet.

PROCEDURE GetWSCellStringN(
worksheet :HANDLE;
row :INTEGER;
column :INTEGER;
VAR cellString :DYNARRAY[] of CHAR);
def vs.GetWSCellStringN(worksheet, row, column):
    return cellString

Parameters

worksheet HANDLE Handle to worksheet.
row INTEGER Row of cell to be queried.
column INTEGER Column of cell to be queried.
cellString DYNARRAY[] of CHAR The string value contained in the worksheet cell.

Remarks

Gets the specified worksheet cell's displayed string.

If the cell contains a string, the displayed string IS that string.
If the cell contains a number, the displayed string is that number PLUS any formatting applied to that number.
Use IsWSCellString and/or MP_IsWSCellNumber to determine what type of value the cell actually contains.
Use GetWSCellValue to retrieve actual numerical value without formatting from a cell that contains a number.

Example

PROCEDURE WStest;
    VAR
       worksheet : HANDLE;
       inString, outString : DYNARRAY [] OF CHAR;
BEGIN
   worksheet := CreateWS('MyWS', 5, 5);
   inString := '';
   outString := '';

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

   { gets string from cell }
   GetWSCellStringN(worksheet, 1, 2, outString);

   AlrtDialog(outString); { the cell formula }
END;
RUN(WStest);

Version

Availability: from Vectorworks 2012