From m204wiki
Jump to navigation Jump to search

The $FlsChk function, combined with the $FlsAcc function, allows a request to check for field-level security access violations before they occur. $FlsChk is designed for use with the IF statement and can determine whether a given set of field-level security accesses is valid for a specified field or for all fields in a file or group. The function returns a 1 if the specified set of accesses is valid.


The format of the $FlsChk function is:

$Flschk (fieldname, access [, filename])

  • fieldname is a character string representing the name of the field whose access is to be checked.

    If the field name is omitted or null, every field in the file or group is checked; the function returns a 1 only if the access is allowed for every field in the file or group. This use of $FlsChk can be costly system overhead since all field descriptions must be examined.

  • access is the desired access or set of accesses; the argument can include:
    • S (SELECT)
    • R (READ)
    • U (UPDATE)
    • A (ADD)

    If the access argument contains an invalid character (not S, R, U, or A), a warning message is issued and 0 is returned. If a set of accesses is specified, such as SR, a 1 is returned only if all accesses in the set are allowed for the indicated field or fields.

  • filename is optional and can be used to control the file or group context of the function. The format for the filename argument is identical to the $FlsAcc name argument.

    For single file context, the field level security access rights are well defined. In group context, this function returns a 1 if the indicated access would compile without error.

    If you want to access the current file of a For loop, use $Curfile as the third argument.

    If this argument is omitted or null, the context used for the check is the context of the statement containing the function.