DOCERR: How to Set Column Index Correctly for AddColumn MethodLast reviewed: December 6, 1995Article ID: Q135456 |
The information in this article applies to:
SUMMARYThe Visual FoxPro Language Reference and Help file both list the following inaccurate information under the topic for the AddColumn method:
The existing Columns are moved to the right and are incremented by 1.Although the columns do move to the right on the screen, the column index is not incremented. NOTE: The Visual FoxPro 3.0b for Windows documentation is correct.
MORE INFORMATIONThe column index is an internal array maintained by the grid object. Each column is assigned a subscript within the array. New columns are appended to the end of this array, and the array element number becomes the index for the column. The name of the column is determined by concatenating the word "Column" plus the index number converted to a string. If the AddColumn method is used to insert a column between columns 2 and 3 of a grid containing four columns, the name of the new column will be Column5. This can be confusing when it is necessary to refer to the columns later on because the column name does not reflect its position within the grid. If the Form.SaveAs method is used to save the form and the form is modified, the new column will appear at the end of all columns.
Step-by-Step ProcedureThe following method can be used to add a new column, set the order appropriately, and change the name of each column to reflect the new sequential order. If the Form.SaveAs method is used to save the form, the form will reappear with the columns in the desired order.
|
Additional reference words: 3.00 VFoxWin
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |