Any (data type)

Description

Used with the Declare statement to indicate that type checking is not to be performed with a given argument.

Comments

Given the following declaration:

  Declare Sub Foo Lib "FOO.DLL" (a As Any)

The following calls are valid:

  Foo 10
  Foo "Hello, world."

Example

The following example calls the FindWindow to determine if Program Manager is running.

This example uses the Any keyword to pass a NULL pointer, which is accepted by the FindWindow function.

Declare Function FindWindow16 Lib "user" Alias "FindWindow" (ByVal Class _

 As Any,ByVal Title As Any) As Integer

Declare Function FindWindow32 Lib "user32" Alias "FindWindowA" (ByVal Class _
  As Any,ByVal Title As Any) As Long

Sub Main()
  Dim hWnd As Variant

  If Basic.Os = ebWin16 Then
    hWnd = FindWindow16("PROGMAN",0&)
  ElseIf Basic.Os = ebWin32 Then
    hWnd = FindWindow32("PROGMAN",0&)
  Else
    hWnd = 0
  End If

  If hWnd <> 0 Then
    MsgBox "Program manager is running, window handle is " & hWnd
  End If
End Sub

See Also

Declare (statement).

More information

A