Siebel VB Language Reference > VB Language Reference >

IsMissing Function


This standard VB function is used to determine whether an optional argument for a procedure has been supplied by the caller.

Syntax

IsMissing(argname)

Argument
Description

argname

An optional argument for a subprogram, function, Siebel VB statement, or Siebel VB function

Returns

-1 (TRUE) if an optional argument was not supplied by the user; 0 (FALSE) otherwise.

Usage

IsMissing is used in procedures that have optional arguments to find out whether the argument's value was supplied or not.

Example

This example prints a list of uppercase characters. The quantity printed is determined by the user. If the user wants to print every character, the Function myfunc is called without any argument. The function uses IsMissing to determine whether to print every uppercase character or just the quantity specified by the user.

Function myfunc(Optional arg1)
   If IsMissing(arg1) = -1 then
      arg1 = 26
   End If
   msgtext = "The letters are: " & Chr$(10)
   For x = 1 to arg1
      msgtext = msgtext & Chr$(x + 64) & Chr$(10)
   Next x
End Function

Sub Button_Click
   Dim arg1
   arg1 = 0
   If arg1 = 0 then
      myfunc()
   Else
      myfunc(arg1)
      End If
End Sub

See Also

Function...End Function Statement

Siebel VB Language Reference