LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 68
Default What of these is the correct syntax to refer to Properties?

Hi all

Just a simple question really: I was wondering if there was an
accepted syntax for refering to already defined properties when
writing a sub/function in the same class.

For example:

<Declarations
Private lBaseNum as Long
</Declarations

<Class1 Code
Public Property Get BaseNumber() As Long
BaseNumber = lBaseNum
End Property

Public Property Let BaseNumber(ByVal vNewValue As Long)
lBaseNum = vNewValue
End Property

Public Function AdjBaseNumber(Adj as Long)
AdjBaseNumber = BaseNumber + Adj
End Function
</Class1 Code

The question arises in the Function AdjBaseNumber, which of the
following is correct:
a) AdjBaseNumber = BaseNumber + Adj
b) AdjBaseNumber = lBaseNum + Adj

In a) I reference the Property (BaseNumber) but in b) I reference the
Private variable (lBaseNum)

Does it make any difference?

Thanks a lot
Lloyd

 
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
Correct Syntax TeeSee Excel Discussion (Misc queries) 6 February 28th 08 01:36 AM
CORRECT SYNTAX FOR RUN... [email protected] Excel Programming 2 August 19th 06 12:39 AM
CORRECT SYNTAX FOR RUN... [email protected] Excel Programming 3 August 18th 06 09:29 PM
syntax to refer to a range as an array? david cassain Excel Worksheet Functions 12 May 26th 05 11:28 PM
If...and... - can never get the syntax correct! Darin Kramer Excel Programming 12 March 24th 05 04:18 PM


All times are GMT +1. The time now is 08:52 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"