Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Apr 13th, 2006, 2:51 PM   #1
jbeckh2
Newbie
 
Join Date: Apr 2006
Posts: 2
Rep Power: 0 jbeckh2 is on a distinguished road
Wierd Behavior when passing Nothing

I won't paste the actual code, but I'll duplicate the circumstances

Class UI
  Sub CallingSub()
    dim strOne as String = Nothing
    dim strTwo as String = Nothing
   
    if txtOne.Text <> "" then
      strOne = txtOne.Text
    end if

    if txtTwo.Text <> "" then
      strTwo = txtTwo.Text
    end if

    dim objBusiness as Business
    objBusiness.CallMe(strOne, strTwo)
  End Sub
End Class

Class Business
  Sub CallMe(ByVal strOne as String, ByVal strTwo as String)
     ....
  End Sub
End Class

strOne in UI is Nothing when I pass it (this has been verified in debugging).
I put a watch on strOne in Business. As soon as Business.CallMe is called, strOne in Business.CallMe is equal to "-32768" as a string. If I pass strTwo as Nothing, it remains Nothing.

What is going on here?
jbeckh2 is offline   Reply With Quote
Old Apr 17th, 2006, 10:28 AM   #2
jbeckh2
Newbie
 
Join Date: Apr 2006
Posts: 2
Rep Power: 0 jbeckh2 is on a distinguished road
nm

It was a typo
jbeckh2 is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 1:57 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC