realbasic-nug
[Top] [All Lists]

Re: Copying identity of an opened window

To: REALbasic NUG <realbasic-nug at lists dot realsoftware dot com>
Subject: Re: Copying identity of an opened window
From: George Clark <gaclark at sprynet dot com>
Date: Sun, 01 Aug 2004 00:25:39 -0400
Delivered-to: realbasic-nug at lists dot realsoftware dot com
On 8/1/04 00:07, Andrew Keller wrote:

> This code is supposed to find the frontmost instance of a window called
> frmCopy, but I get a Type Mismatch Error on line 6.
> 
> 
>  Dim w As frmCopy
>  Dim i,j As Integer
>  j=WindowCount-1
>  For i=0 to j
>    If Window(i) IsA frmCopy Then
>      w=Window(i)  // Type Mismatch Error, RB didn't highlight anything
>      Exit
>    End If
>  Next

When RB is compiling, it sees Window(i) as just a generic window, so it
chokes. Try coercing it to a frmCopy:

    w = frmCopy(Window(i))



George

-- 
George Clark - gaclark at sprynet dot com


_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://www.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>