Results 1 to 6 of 6

Thread: RESOLVED .Empty string, Null string, How to evaluate

  1. #1

    Thread Starter
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478

    RESOLVED .Empty string, Null string, How to evaluate

    Placed my question in ActiveX board.
    But no one is looking over there.

    My question

    Thanks for helping me out.
    Last edited by swatty; Aug 9th, 2002 at 04:01 AM.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  2. #2
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Why do you want to use String * 3? Why not simply use a string type?

    Also Len(Trim(Me.Journal)) = 0 should tell you if the property contains something or not. IsNull() is ridiculous here as it is used for checking if a database field contains a null value.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  3. #3

    Thread Starter
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478

    In the land ....

    It is containing 3  which are placed there by vb when initializing my object.

    I am using * 3 because my length in db is set to 3 .
    That way no matter how long the string is which is given to the property I only get the first 3 chars, what is good for me.
    Doesn't want to get a type mismatch when storing them values.
    That is why.
    IsNull() is ridiculous
    could be , I am trying to get a correct evaluation .
    Last edited by swatty; Aug 9th, 2002 at 03:33 AM.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  4. #4

    Thread Starter
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478

    Little less conversation, little more action

    Found it.


    Thanks to whom helped me.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

  5. #5
    Randalf the Red honeybee's Avatar
    Join Date
    Jun 2000
    Location
    off others' brains
    Posts
    4,345

    Well ...

    Originally posted by swatty
    It is containing 3  which are placed there by vb when initializing my object.

    I am using * 3 because my length in db is set to 3 .
    That way no matter how long the string is which is given to the property I only get the first 3 chars, what is good for me.
    Doesn't want to get a type mismatch when storing them values.
    That is why.
    could be , I am trying to get a correct evaluation .
    If you want to take out only the first three characters, you can use something like Left(mJournal,3). Using a fixed length string could be a bad idea. Also if you have implemented your application design correctly, your database simply won't have any values that exceed three characters, so your precaution here is unnecessary.

    Another option is that after you declare the string mJournal as String * 3, you assign an empty string to it yourself, like

    mJournal = ""

    If you had declared it simply as a string, you probably wouldn't need it.

    Anyways, since your problem has been resolved, I think I can only wish you best luck.

    .
    I am not a complete idiot. Some parts are still missing.
    Check out the rtf-help tutorial
    General VB Faq Thread
    Change is the only constant thing. I have not changed my signature in a long while and now it has started to stink!
    Get more power for your floppy disks. ; View honeybee's Elite Club:
    Use meaningfull thread titles. And add "[Resolved]" in the thread title when you have got a satisfactory response.
    And if that response was mine, please think about giving me a rep. I like to collect them!

  6. #6

    Thread Starter
    Frenzied Member swatty's Avatar
    Join Date
    Aug 2002
    Location
    somewhere on earth
    Posts
    1,478
    My database hasn't got wrong values.
    Because i make my application appropriate.

    When i distribute my dll which contains the classes i've made , I must be sure the ones using them do not give me more than i need. No one must have the opportunity to let my dll crash the program using it.

    Anyway i resolved it and if someone is interested i'll show how i've done it.
    Code:
    If Question = Incomplete Then
       AnswerNextOne
    Else
       ReplyIfKnown
    End If
    cu Swatty

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