requireOneAttribute() (tick_24Validator Engine Only)

int requireOneAttribute(int flags, int returntype, string att1[, string att2...]);

flags

1 - display a default error message if none of the listed attributes are used

2 - instead of "requires one or more" in the default error message, use "requires one" (New v17.0102)

16 - after $flags specify a category string or category number (based on getMessageCategory() ) to use if a message is generated (New v17.00)

attx - an attribute

This function returns -1 if none of the listed attributes are used, else the function returns 1 or greater:

If returntype is RETURN_LISTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. For instance, 1 is returned if the first listed attribute is used (att1), 2 if the second (att2), and so on. If more than one attribute is used, then the return value indicates the first attribute used in the list.

If returntype is RETURN_ATTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. The return value is the index of the attribute. If more than one attribute is used, then the return value is the index of the attribute that appears first in the list. Returns -1 if none of the listed attributes are used.

If returntype is RETURN_FIRSTATTINDEX, the function returns 1 or greater if one or more of the listed attributes are used. The return value is the index of the attribute that appears first in the tag and is anywhere in the list, and not necessarily the index of the attribute that is in the tag and appears first in the list. Returns -1 if none of the listed attributes are used.

If returntype is RETURN_NOTUSED, then the return value is undefined. Use this if you do not use the return value of this function.

If the return value is -1, and flags&1 is 1, then a standard error message will be generated stating that the tag requires at least one of the listed attributes.