Results 1 to 10 of 10

Thread: IS.... function for this one?

  1. #1

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Question

    Isnull, Isempty, isnumeric, isdate, ismissing.. is there any function that i can get if a reference val is set? I have tried if object=nothing then but get's "invalid use of object".
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  2. #2
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    What do you mean by a reference Val Being set?


  3. #3

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Dim a as blablaclass
    Dim b as new blablaclass

    If isnotset(a) then msgbox "a Is not set"
    set a=b
    If not isnotset(a) then msgbox "a Is set"
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  4. #4
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    I still don't get what you mean by is set, do you mean if the variable contains a class or not

    Ie
    Code:
    Dim a as clsMyClass
    
    IsSet (a)
    returns false

    and
    Code:
    Dim a as New clsMyClass
    
    IsSet (a)
    returns true

  5. #5

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Unhappy

    I have a Temporar solution but I don't like it:
    Code:
    Function Isnotset(test) As Boolean
        On Error Resume Next
         temp = test
         If Err = 91 Then Isnotset = True
    End Function
    I don't know if it should work with all classes (what about those that have no default value)
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  6. #6
    Hyperactive Member
    Join Date
    Mar 2000
    Posts
    292
    Isnt there an "isObject" function that might help?
    "People who think they know everything are a great annoyance to those of us who do."

  7. #7

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Unhappy

    No, i've tried all Isblabla allready
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  8. #8
    Addicted Member pardede's Avatar
    Join Date
    Jan 2000
    Posts
    232
    Kedaman, you were on the right track in the first place, your problem is just the syntax (use the Is keyword instead of '='):
    you use:
    Code:
    if object=nothing
    you need:
    Code:
    If objYourObject Is Nothing
    that's all

  9. #9
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    Or
    [code]
    If CBool(ObjPtr(objMyObject))

    Returns true iff object is set

  10. #10

    Thread Starter
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221

    Smile

    Thanks both of you
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width