|
-
March 21st, 2006, 01:38 AM
#1
help with initial
the code like
Code:
Private Sub Form_Load()
Dim num As Integer
num = 3
End Sub
when I use watch to view the value of num, it show the value is 0, why?
-
March 21st, 2006, 02:05 AM
#2
Re: help with initial
after num = 3 it will contain 3
-
March 21st, 2006, 02:09 AM
#3
Re: help with initial
Normally it is, but when I use quick watch to view, it show the value is 0. this is why I wondering
-
March 21st, 2006, 02:10 AM
#4
Re: help with initial
Code:
Private Sub Form_Load()
Dim num As Integer
num = 3
End Sub
basicaly you've defined num and a local variable to be used only with in the sub Form_Load. Any reference to it from any other sub will return null..
To use num is a number of subs rather use
Code:
private num As Integer
Private Sub Form_Load()
num = 3
End Sub
hope this helps..
Gremmy..
Articles VB6 : Break the 2G limit - Animation 1, 2 VB.NET : 2005/8 : Moving Images , Animation 1 , 2 , 3 , User Controls
WPF Articles : 3D Animation 1 , 2 , 3
Code snips: VB6 Hex Edit, IP Chat, Copy Prot., Crop, Zoom : .NET IP Chat (V4), Adv. ContextMenus, click Hotspot, Scroll Controls
Find me in ASP.NET., VB6., VB.NET , Writing Articles, My Genealogy, Forum
All VS.NET: posts refer to VS.NET 2008 (Pro) unless otherwise stated.
-
March 21st, 2006, 02:25 AM
#5
Re: help with initial
I find the fault now, it is my fault, i put the codes which relationed to num wrongly in one function. Thank you.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|