Article ID: 130531
Article Last Modified on 7/1/2004
CREATE FORM test
LOCAL i, lcWindName, llRetVal
* Initialize the variables. llRetval returns a .F. from the INIT() if
* the form is already visible. Returning a .F. from any INIT() causes
* the object to not be created.
* i contains the number of instances of the form.
* lcWindName contains the name of the form you're looking at.
llRetVal = .T.
i = 0
lcWindName = WCHILD("",0) && The "" must be a NULL or empty string
* Loop through all open forms, and see if we have any that have the same
* name as the one you want to open. (It exists in INIT() but is not yet
* available.)
DO WHILE !EMPTY(lcWindName)
IF lcWindName = UPPER(this.name)
i = i + 1
IF i > 1
llRetVal = .F.
EXIT
ENDIF
ENDIF
lcWindName = WCHILD("",1) && The "" must be a NULL or empty string
ENDDO
RETURN llRetVal
Additional query words: VFoxWin
Keywords: kbhowto kbcode KB130531