Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default complex numbers

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 533
Default complex numbers

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" wrote in message
...
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


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default complex numbers

On 1 abr, 16:21, "Jim Rech" 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
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA: Calculating Complex Numbers LenS Excel Discussion (Misc queries) 0 January 8th 07 05:24 PM
Round-down complex numbers nsv Excel Discussion (Misc queries) 7 February 2nd 06 03:37 PM
VBA complex numbers Levent Excel Programming 1 July 22nd 04 03:46 PM
Complex Numbers No Name Excel Programming 1 June 24th 04 06:04 AM
Complex numbers Alain Turgeon Excel Programming 2 June 1st 04 09:19 PM


All times are GMT +1. The time now is 08:06 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"