[vb] Hoe zien of een object geladen is ?

Pagina: 1
Acties:

  • XTerm
  • Registratie: Juli 2001
  • Laatst online: 10-06-2025
Ja, hoe kan je dit checken bijvoorbeeld

Print "Hello"
Load D(1)
Print "loaded D->1"
Print FUNCTIE(D(1))
Unload D(1)
Print FUNCTIE(D(1))

IsNull geeft bij beiden false, isobject bij beiden true.

Verwijderd

code:
1
2
3
4
5
6
7
Public Function IsInitalized(ByRef Obj As Object) As Boolean
Dim strTmp As String
On Error Resume Next
    strTmp = Obj.Name
    IsInitalized = (Err.Number <> 340)
On Error GoTo 0
End Function

  • Basszje
  • Registratie: Augustus 2000
  • Nu online

Basszje

Reisvaap!]

Probeer het eens met isempty ()

Beware of listening to the imposter; you are undone if you once forget that the fruits of the earth belong to us all, and the earth itself to nobody.


  • XTerm
  • Registratie: Juli 2001
  • Laatst online: 10-06-2025
De isEmpty werkt niet, maar die functie wel.
Bij deze bedankt

  • johnwoo
  • Registratie: Oktober 1999
  • Laatst online: 17-09 16:48

johnwoo

3S-GTE

De 'officiele/juiste' manier: :P
code:
1
2
3
4
5
If Object Is Nothing Then
  Debug.Print "Object is niet geladen"
Else
  Debug.Print "Object is geladen"
End If

4200Wp ZO + 840Wp ZW + 1680Wp NW | 14xIQ7+ + 1xDS3-L | MTVenusE | HWP1


Verwijderd

Op woensdag 17 oktober 2001 20:52 schreef johnwoo het volgende:
De 'officiele/juiste' manier: :P
Testen voor je post, want dat werkt niet. :Y)
Pagina: 1