CVDOCPOS Function
The CVDOCPOS function returns information about the cursor position in the document. This information can be used to write events or add new menu choices in the freeze area that need the cursor's position to function.
Syntax
CVDOCPOS("prop", <"type">)
The prop argument defines the Property Name to retrieve.
The argument can also specify one of the following default properties to return information about the CaseView object:
#CN |
Cell Number |
#CT |
Cursor position within a table returned as a table cell number. Outside of a table, this parameter returns "" The number is calculated as if a cell existed in the paragraphs of that table square even when no cell is present. |
#TN |
Table Name |
#TR |
Table Row Number |
#TC |
Table Col Number |
If nothing meets the criteria, a blank string is returned.
The type argument is an optional argument to narrow the scope of objects to search for the given property. Use it to clear ambiguities. For example, if the cursor is in a table and the table, table column and table row each have a "Delete" property then the function cannot tell which property's value to use. The type allows for commands such as "use the Table Row property" or "use the Section property".
Types that can be used in the calculation are:
P |
Paragraph |
T |
Table |
TR |
Row |
TC |
Column |
S |
Section |
D |
Document Settings |
The CVDOCPOS() function works only in the following areas.
-
In the Freeze Pane: Tool tips, image calculations, left or right-click menus and popup selection calculations;
-
Throughout the document: Left or right-click menus
It is always recalculated last, thus, not becoming part of the recalculation order.
Important: The CVDOCPOS() property should never be used for hide or skip calculations.
Note
- If there are multiple objects that have a specific property, the criteria in which the property value is returned is undefined. Meaning that one value could be returned one time and another could be returned in another. Also in future versions, CaseView may not scan through the document in the same order, meaning the results may be different.
-
Try not to get into situations where the order matters. If order does matter, string multiple CVDOCPOS functions together asking for the value in the order that is needed.
Example 1
If an edit table function was used but it was necessary to ensure it did not run when the cursor was not in a table row, enter a disable condition.
Disable if: CVDOCPOS("#TR") = ""
Entering this as a disable function means that when the cursor is not in a table row (the table row location of the cursor's position is null), then the function will not run.
Example 2
If a delete row toolbar has been created but there are Heading Rows and SubTotal/Total rows that if deleted will create errors in other areas of the CaseView document, then the function has to be disabled on those special rows.
Go to Home | Table | Properties | Row | Custom Properties and add a Table Row custom property "Delete" to have a value of "No". It is then possible to disable the delete row function when either the cursor is not in a table OR the cursor is on a row that has the property "Delete" equal to "No". This is the syntax to enter in the Disable if field:
CVDocPos("#TN") = ""|CVDocPos("Delete", "TR") = "No"