|
-
Nov 20th, 2000, 05:58 PM
#1
Thread Starter
Addicted Member
Hello,
I am having a problem.
Here is my code.
The problem is that it will not let me type in
' Private as integer m_numToAdd%
Private as integer m_Total%'
In the general declerations in my class
Here is the rest of the code.
Code:
Option Explicit
Public Property Get NumToAdd() As Integer
NumToAdd = m_numtoadd%
End Property
Public Property Let NumToAdd(ByVal vNewValue As Integer)
m_numtoadd% = inewvalue
AddNum
End Property
Public Property Get Total() As Integer
Total = m_total%
End Property
Public Property Let Total(ByVal vNewValue As Integer)
m_total% = inewvalue
End Property
Private Sub AddNum()
m_total% = m_numtoadd% + m_total%
End Sub
If anyone can tell me why I can not put the above in General Declerations and or know a link that explains writing class's would help alot.
Thanks in advance.

-
Nov 20th, 2000, 06:53 PM
#2
Hyperactive Member
VB Class Files
The problem is the "%"
Try
Private m_numToAdd as integer
-
Nov 20th, 2000, 07:00 PM
#3
Hyperactive Member
I noticed that you're setting =inewvalue instead of =vnewvalue which is what you were passing.
If you want to denote integer vs string vs whatever, use hungarian notation:
Private iInteger As Integer
Private sString As String
Private m_vVariant As Variant
Private m_lLong As Long
(etc. I'm sure you can look it up somewhere)
and lose the %.
-
Nov 20th, 2000, 07:01 PM
#4
Thread Starter
Addicted Member
Yeh that does work. Thanks.
I didnt think vb would have a fit about that 
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
|