Solved

Names of properties in custom classes

Posted on 2002-06-26
8
148 Views
Last Modified: 2013-11-23
I'd like to define a property named Date in a class that I am writing.

But, when I input the following property definition
   
    Public Property Get Date() As Date
        ...
    End Property

I get:

    Compile Error
    Expected: identifier

I'm assuming that this has something to do with the built in Date object.  Is there any way to get around this?
0
Comment
Question by:derekl
8 Comments
 
LVL 28

Accepted Solution

by:
AzraSound earned 50 total points
ID: 7111189
Yes it is due to the intrinsic Date function.  You need to change the property name.  If it is a specific date, give it more meaning, e.g. LoginDate, DateSubmitted, InvoiceDate, etc.
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7111297
You can try to suffix it with an underscore.  Not exactly what you want, but reasonably close.


Public Property Get Date_() As Variant

End Property

Public Property Let Date_(ByVal vNewValue As Variant)

End Property
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7111318
Keywords cannot be used as name for variables, constants, properties like any other language (as long as i know).
0
 
LVL 69

Expert Comment

by:Éric Moreau
ID: 7111644
Try this:

Public Property Get [Date]() As Date
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 

Author Comment

by:derekl
ID: 7112547
Public Property Get[Date]() As Date did not work.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7113583
what about Azra and rspahitz comments?
0
 
LVL 22

Expert Comment

by:rspahitz
ID: 7114017
Personally, I think Azra's comment makes the most sense (in addition to answering the Q!) since the date will most likely not be "generic" but will be related to something.
0
 
LVL 16

Expert Comment

by:Richie_Simonetti
ID: 7180859
Why "B" grade? what were you waiting for?
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Suggested Solutions

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now