CVarRef cellValue = getCellValue(); // assumes getCellValue() returns a variant value Cell* cellPtr = cellValue.asCell(); if (cellPtr) { // manipulate cell object using cellPtr } else { // handle error case }
CVarRef variantValue = getVariantValue(); Cell* cellPtr = variantValue.asCell();In this example, we again get a variant value using a function called getVariantValue(). We then create a CVarRef object called variantValue referencing the variant value. We then call the asCell() function of variantValue to get a pointer to the Cell object represented by the variant value. If the variant value is not a cell, asCell() returns NULL, and cellPtr will be NULL. Package library: It is not possible to determine the package library from this code example alone. More context is needed.