Solved

Names of properties in custom classes

Posted on 2002-06-26
8
149 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
ScreenConnect 6.0 Free Trial

Check out the updates in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI that improves session organization and overall user experience. See the enhancements for yourself!

 
LVL 70

Expert Comment

by:Éric Moreau
ID: 7111644
Try this:

Public Property Get [Date]() As Date
0
 

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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Magic Software info 18 130
Excel - Save a copy of work book 13 84
Added a column screws up code 5 57
Firemonkey allowing RTL on android 6 31
Introduction I have seen many questions in this Delphi topic area where queries in threads are needed or suggested. I know bumped into a similar need. This article will address some of the concepts when dealing with a multithreaded delphi database…
Background What I'm presenting in this article is the result of 2 conditions in my work area: We have a SQL Server production environment but no development or test environment; andWe have an MS Access front end using tables in SQL Server but we a…
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 utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…

770 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