top of page

50. Plural Form of a Word

Description

Places the proper plural ending on a word, -s -es or -ives.

Code

IF LAST( TextVar, 3 ) = "ife"
FIRST( TextVar, LENGTH( TextVar ) - 3 ) + "ives"
ELSE IF LAST( TextVar, 1 ) = "s"
OR LAST( TextVar, 1 ) = "z"
TextVar + "es"
ELSE
TextVar + "s"
END IF

Explanation

The computation examines the ending of a text variable, TextVar, and based on that ending, returns the value of the text variable with the appropriate plural suffix appended.

Note that this handles only the common plurals. It will not work with the myriad irreguar English plurals: mouse/mice, fish/fish, deer/deer, goose/geese, etc.

The computation does not alter the contents of TextVar.

bottom of page