SET FILTER

4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next

version 6.0 (Modified)


SET FILTER ({*; }object; entryFilter)

ParameterTypeDescription
*If specified, Object is an Object Name (String)
If omitted, Object is a Field or a Variable
objectForm ObjectObject Name (if * is specified), or
Field or Variable (if * is omitted)
entryFilterStringNew data entry filter for the enterable area

Description

SET FILTER sets the entry filter for the objects specified by object to the filter you pass in entryFilter.

If you specify the optional * parameter, you indicate an object name (a string) in object. If you omit the optional * parameter, you indicate a field or a variable in object. In this case, you specify a field or variable reference (field or variable objects only) instead of a string. For more information about object names, see the section Object Properties.

SET FILTER can be used for input and dialog forms and can be applied to fields and enterable variables that accept an entry filter in Design environment.

Passing an empty string in entryFilter removes the current entry filter for the objects.

Note: This command cannot be used with fields located in a subform's list form.

Note: In entryFilter, to use entry filters you may have predefined using the Tool Box, prefix the name of the filter with a vertical bar (|).

Examples

1. The following example sets the entry filter for a postal code field. If the address is in the U.S., the filter is set to ZIP codes. Otherwise, it is set to allow any entry:

   If ([Companies]Country = "US")  ` Set the filter to a ZIP code format 
      SET FILTER ([Companies]ZIP Code; "&9#####") 
   Else  ` Set the filter to accept alpha and numeric and uppercase the alpha 
      SET FILTER ([Companies]ZIP Code; "~@") 
   End if

2. The following example allows only the letters "a," "b," "c," or "g" to be entered in two places in the field Field:

   SET FILTER([Table]Field ;"&"+Char(Double quote)+ "a;b;c;g"+Char(Double quote)+"##")

Note: This example sets the entry filter to &"a;b;c;g"##.

See Also

SET FORMAT.


4D - Documentation   Français   English   German   4th Dimension 2004, Command Theme List   4th Dimension 2004, Command Alphabetical List   4th Dimension 2004, Constant Theme List   Back   Previous   Next