PRB: Leading Equals Sign (=) Not Displayed If RowSource Value

Symptoms

If you enter operators (<>, <, >, and =) into a combo box RowSource property as values and the first element in the list is the equals sign (=), Visual FoxPro does not accept or allow the leading equals sign in the list of values.

Cause

Using an equals sign as the first character of an entry in a combo box RowSource property indicates to Visual FoxPro that the value that follows is going to be a numeric value returned by a function.

Resolution

Use one of the following solutions:


  • Change the order of the listed operators to begin with something other than the equals sign. -or-

  • Use the Expression Builder to enter your comma-separated list of operators. To access the Expression Builder, bring up the combo box properties sheet, and click the fx button. In the Expression Builder, enter the list of operators:
    =,<,>,<>
    Visual FoxPro will then place that string in the RowSource property field. However, do not attempt to verify this expression in the Expression Builder. Attempting to do so will result in a syntax error message.

Status

This behavior is by design.

More Information

One reason for listing the operators in a combo box is to give a user a list of valid operators for use in an SQL query builder to build a query like this:
   Select * from Customers where customer.city <> "WA"

Steps to Reproduce Behavior

  1. Create a form.
  2. Add a Combo Box to the form.
  3. In the properties sheet under the Data tab, set the RowSourceType to 1 - value.
  4. In the RowSource field, enter =,<,>,<>, and press ENTER. At this point, Visual FoxPro removes the leading equals sign, leaving ",<,>,<>" behind. When you run the form, the position originally occupied by the equals sign appears but there is no value displayed. When the same, original string is entered using the Expression Builder, the leading equals sign is displayed.
Lastnosti

ID članka: 130577 – Zadnji pregled: 19. jun. 2008 – Revizija: 1

Povratne informacije