Existence detection
Existence checking or existence detection is an important aspect of many computer programs. An existence check before reading a file can catch and/or prevent a fatal error, for instance. For that reasons, most programming language libraries contain File.Exists methods.
An existence check can sometimes involve a "brute force" approach of checking all records for a given identifier, as in this Microsoft Excel Visual Basic for Applications code for detecting whether a worksheet exists:
Function SheetExists(sheetName As String) As Boolean
Dim sheetCount As Integer
Dim t As Integer
SheetExists = False
sheetCount = ActiveWorkbook.Sheets.Count
For t = 1 To sheetCount
If Sheets(t).Name = sheetName Then
SheetExists = True
Exit Function
End If
Next t
End Function
Page existence detection is an important aspect of Mediawiki. Many templates depend on conditional statements involving page existence checking (e.g. the #ifexist: parserfunction),[1][2] and the ability of wikilinks to turn red or blue depending on page existence makes it more practical for red links to be allowed to remain in place for long periods without inconveniencing readers by prompting them to unwittingly click on dead links. The presence of these red links helps identify new pages that are needed.[3] There is as of yet no functionality to allow interwiki page existence detection, however.