PC Review


Reply
Thread Tools Rate Thread

complex numbers

 
 
Fcoatis
Guest
Posts: n/a
 
      1st Apr 2008
Getting stuck here.

In class called cNum I have this:

Option Explicit

Private m_rP As Double
Private m_iP As Double

Public Property Get rP() As Variant
rP = m_rP
End Property

Public Property Let rP(ByVal rPart As Variant)
rP = m_rPart
End Property

Public Property Get iP() As Variant
iP = m_iP
End Property

Public Property Let iP(ByVal iPart As Variant)
iP = m_iPart
End Property

In a module I have this:

Sub test()
Dim cNum1 As cNum
cNum1 = Set_cNum(11, 3)
End Sub

Function Set_cNum(rPart As Double, iPart As Double) As cNum
Set_cNum.rP = rPart
Set_cNum.iP = iPart
End Function


But I dont know where´s the flaw.
TIA

Fabio Coatis
 
Reply With Quote
 
 
 
 
Jim Rech
Guest
Posts: n/a
 
      1st Apr 2008
>>But I dont know where´s the flaw.

Besides some typos in the class module you never actually instantiated the
class.

Private m_rP As Double
Private m_iP As Double

Public Property Get rP() As Variant
rP = m_rP
End Property

Public Property Let rP(ByVal rPart As Variant)
m_rP = rPart
End Property

Public Property Get iP() As Variant
iP = m_iP
End Property

Public Property Let iP(ByVal iPart As Variant)
m_iP = iPart
End Property

Module:

Sub test()
Dim cNum1 As cNum
Set cNum1 = set_cnum(11, 3)
Debug.Print cNum1.rP
Debug.Print cNum1.iP
End Sub

Function set_cnum(rPart As Double, iPart As Double) As cNum
Dim x As New cNum
x.rP = rPart
x.iP = iPart
Set set_cnum = x
End Function


--
Jim
"Fcoatis" <(E-Mail Removed)> wrote in message
news:04be2713-a29f-4391-a836-(E-Mail Removed)...
Getting stuck here.

In class called cNum I have this:

Option Explicit

Private m_rP As Double
Private m_iP As Double

Public Property Get rP() As Variant
rP = m_rP
End Property

Public Property Let rP(ByVal rPart As Variant)
rP = m_rPart
End Property

Public Property Get iP() As Variant
iP = m_iP
End Property

Public Property Let iP(ByVal iPart As Variant)
iP = m_iPart
End Property

In a module I have this:

Sub test()
Dim cNum1 As cNum
cNum1 = Set_cNum(11, 3)
End Sub

Function Set_cNum(rPart As Double, iPart As Double) As cNum
Set_cNum.rP = rPart
Set_cNum.iP = iPart
End Function


But I dont know where´s the flaw.
TIA

Fabio Coatis


 
Reply With Quote
 
Fcoatis
Guest
Posts: n/a
 
      1st Apr 2008
On 1 abr, 16:21, "Jim Rech" <jrr...@live.com> wrote:
> >>But I dont know where´s the flaw.

>
> Besides some typos in the class module you never actually instantiated the
> class.
>
> Private m_rP As Double
> Private m_iP As Double
>
> Public Property Get rP() As Variant
> * * rP = m_rP
> End Property
>
> Public Property Let rP(ByVal rPart As Variant)
> * * m_rP = rPart
> End Property
>
> Public Property Get iP() As Variant
> * * iP = m_iP
> End Property
>
> Public Property Let iP(ByVal iPart As Variant)
> * * m_iP = iPart
> End Property
>
> Module:
>
> Sub test()
> * * Dim cNum1 As cNum
> * * Set cNum1 = set_cnum(11, 3)
> * * Debug.Print cNum1.rP
> * * Debug.Print cNum1.iP
> End Sub
>
> Function set_cnum(rPart As Double, iPart As Double) As cNum
> * * Dim x As New cNum
> * * x.rP = rPart
> * * x.iP = iPart
> * * Set set_cnum = x
> End Function
>



ooops

Thanks Jim for the correction.
Regards
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Complex numbers. =?Utf-8?B?V2Vpc3NlbmRvcmY=?= Microsoft Word Document Management 2 11th Nov 2004 06:56 PM
Complex numbers bill Microsoft Excel Misc 2 14th Aug 2004 03:29 AM
VBA complex numbers Levent Microsoft Excel Programming 1 22nd Jul 2004 03:46 PM
Complex Numbers Microsoft Excel Programming 1 24th Jun 2004 06:04 AM
Complex numbers Alain Turgeon Microsoft Excel Programming 2 1st Jun 2004 09:19 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 03:16 PM.