473,386 Members | 1,647 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Curiuos error, but still functions

Hi,
this is my code
Public Shared Function LastDayOfTheMonth(ByVal dtmdate As Date) As DayOfWeek

Return dtmdate.AddDays(dtmdate.DaysInMonth(dtmdate.Year, dtmdate.Month) -
dtmdate.Day).DayOfWeek()

End Function

on the dtmdate.daysinmonth I get the error

"Access of shared memeber, constant member,..... will not be evaluated"

it wants me to replace dtmdate.daysinmonth with date which would make my
function not correct....

Can anyone give me some clues?


Jun 27 '08 #1
3 743

"Brian" <bs********@community.nospamwrote in message
news:uS**************@TK2MSFTNGP02.phx.gbl...
Hi,
this is my code
Public Shared Function LastDayOfTheMonth(ByVal dtmdate As Date) As
DayOfWeek

Return dtmdate.AddDays(dtmdate.DaysInMonth(dtmdate.Year, dtmdate.Month) -
dtmdate.Day).DayOfWeek()

End Function

on the dtmdate.daysinmonth I get the error

"Access of shared memeber, constant member,..... will not be evaluated"

it wants me to replace dtmdate.daysinmonth with date which would make my
function not correct....

Can anyone give me some clues?

It is a curious message but what it means is that what your object is has no
relationship to the answer. You can use your date variable but you notice
that the input parameter is what is important.

What it is telling you is that Date.LastDayOfTheMonth is the "correct" way
to call it. It is only a warning.

LS

Jun 27 '08 #2
On Mon, 14 Apr 2008 17:25:35 -0400, "Brian"
<bs********@community.nospamwrote:
>Hi,
this is my code
Public Shared Function LastDayOfTheMonth(ByVal dtmdate As Date) As DayOfWeek

Return dtmdate.AddDays(dtmdate.DaysInMonth(dtmdate.Year, dtmdate.Month) -
dtmdate.Day).DayOfWeek()

End Function

on the dtmdate.daysinmonth I get the error

"Access of shared memeber, constant member,..... will not be evaluated"

it wants me to replace dtmdate.daysinmonth with date which would make my
function not correct....

Can anyone give me some clues?
Why would Date.DaysInMonth(dtmdate.Year, dtmdate.Month) be incorrect?
All of the information for DaysInMonth is supplied in the parameters,
so calling it from an instance is not useful.
Jun 27 '08 #3

"Jack Jackson" <jj******@cinnovations.netwrote in message
news:r3********************************@4ax.com...
On Mon, 14 Apr 2008 17:25:35 -0400, "Brian"
<bs********@community.nospamwrote:
>>Hi,
this is my code
Public Shared Function LastDayOfTheMonth(ByVal dtmdate As Date) As
DayOfWeek

Return dtmdate.AddDays(dtmdate.DaysInMonth(dtmdate.Year, dtmdate.Month) -
dtmdate.Day).DayOfWeek()

End Function

on the dtmdate.daysinmonth I get the error

"Access of shared memeber, constant member,..... will not be evaluated"

it wants me to replace dtmdate.daysinmonth with date which would make my
function not correct....

Can anyone give me some clues?

Why would Date.DaysInMonth(dtmdate.Year, dtmdate.Month) be incorrect?
All of the information for DaysInMonth is supplied in the parameters,
so calling it from an instance is not useful.
Ok, I see it now.... date.dayinmonth with the parameters passed to it...
Jun 27 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Wayno | last post by:
My php logs are coming up empty. I have done all I can think of, and all that made sense to me. Can someone take a look at my php.ini please and tell me what you think may be the problem. I...
1
by: Timh Bergström | last post by:
Hi all! Can i do a global "on error" statement for all forms and modules instead of having "on error goto ErrHand" in each sub/function? The error should be catched to another form there the...
3
by: Saurabh Aggrawal | last post by:
Hi, I am porting an application for 64-bit AMD processor and while linking the application i am getting the following errors: Processing directory uidll... Linking DLL...
7
by: Steve Jorgensen | last post by:
Here is some code to generate code for raising and getting information about custom errors in an application. Executing the GenerateXyzErrDefs procedure generates the code. <tblXyzError>...
10
by: John | last post by:
Hi all... Either I'm doing really something really stupid - or maybe there is some bug somewhere (optimizing?). In a function I have: int x1, y1, x2, y2; float dR, dX, dY; dR =...
35
by: jeffc226 | last post by:
I'm interested in an idiom for handling errors in functions without using traditional nested ifs, because I think that can be very awkward and difficult to maintain, when the number of error checks...
5
by: Rahul B | last post by:
Hi, I have very little knowledge about creating Procedures/functions in DB2. When i tried to create the test function like CREATE FUNCTION GET_TEST (P_TEST_ID INTEGER, P_SEL_OR_SORT...
70
by: junky_fellow | last post by:
Guys, If main() calls some function func() and that function returns the error (errno), then does it make sense to return that value (errno) from main. (in case main can't proceed further) ? ...
8
by: =?Utf-8?B?TWFydGluIFNhY2hz?= | last post by:
I have been using MSCONFIG (XP Pro) for four years with no problem. I always use it in Administrator. Last night, when I attempted to go into selective startup mode, I got the following error...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.