The information in this article applies to:
- Microsoft Visual FoxPro for Windows, version 3.0
SUMMARY
This article gives you two methods you can use in Visual FoxPro to display
logical fields with values other than true (T) or false (F) in a grid. For
example, you might want to display values such as yes (Y) or no (N).
NOTE: In FoxPro version 2.x, this display was created using a BROWSE
picture clause. For more information, please see the following article in
the Microsoft Knowledge Base:
ARTICLE-ID: Q99908
TITLE : Making Logicals Show "Y" or "N" in a Browse or Screen
MORE INFORMATION
Preparations for Both Methods
Use the following steps to set up Column1 of the grid to display the
existing logical field for reference.
- Create a form, and use the VFP\Samples\Data\Products table as the
data environment.
- Drag the table onto the form to create a grid.
- Set the grid layout ColumnCount property to 2.
- Set the Column1 ControlSource property to products.discontinu.
Use one of the following two methods to display the logical field with a
different value.
Method One
- Set the Column2 ColumnSparse property to false (.F.).
- Set the Column2 ControlSource property to products.discontinu.
- Set the Column2 Text1 InputMask property to Y.
- Run the Form. Column1 shows the actual table values, and Column2 shows
the equivalent Y or N.
Notes:
- The InputMask setting of Y is not documented in the Help menu or the
Language Reference.
- Without the ColumnSparse property set to false, the Y or N is visible
only if the pointer is in that particular field.
- If the Column2 Read-only property is false, it may be edited, and Y or N
can be used instead of T or F.
Method Two
- Set the Column2 ControlSource property to:
IIF(products.discontinu, "Yes", "No ") && The space after No is an
&& attempt to give the
&& strings the same length.
- Run the Form. Column1 shows the actual table values, and Column2 shows
the equivalent Yes or No value.
Notes:
|