anybody have an idea on what i am doing wrong here,
Argument not specified for parameter 'JobTitle' of 'Public Sub
New(JobTitle As String, NumberOfEmployees As Integer)'.
thanks
Portroe 14 14444
* portroe <bo*@sleigh.com> scripsit: anybody have an idea on what i am doing wrong here,
Argument not specified for parameter 'JobTitle' of 'Public Sub New(JobTitle As String, NumberOfEmployees As Integer)'.
Post the code you use to create the new object (the constructor call).
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
'this is the constructor from the course class,
Public Sub New(ByVal JobTitle As String, ByVal NumberOfEmployees As Integer)
Me.iJobTitle = JobTitle
Me.iNumberOfEmployees = NumberOfEmployees
Me.iFreeOfCharge = ""
End Sub
'thanks
Herfried K. Wagner [MVP] wrote: * portroe <bo*@sleigh.com> scripsit:
anybody have an idea on what i am doing wrong here,
Argument not specified for parameter 'JobTitle' of 'Public Sub New(JobTitle As String, NumberOfEmployees As Integer)'.
Post the code you use to create the new object (the constructor call).
* portroe <bo*@sleigh.com> scripsit: 'this is the constructor from the course class,
Public Sub New(ByVal JobTitle As String, ByVal NumberOfEmployees As Integer) Me.iJobTitle = JobTitle Me.iNumberOfEmployees = NumberOfEmployees Me.iFreeOfCharge = "" End Sub
'thanks
And how do you call it? Where does the error occur?
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
The error occurs when i try to debug, Ireceive this as a build error,
Herfried K. Wagner [MVP] wrote: * portroe <bo*@sleigh.com> scripsit:
'this is the constructor from the course class,
Public Sub New(ByVal JobTitle As String, ByVal NumberOfEmployees As Integer) Me.iJobTitle = JobTitle Me.iNumberOfEmployees = NumberOfEmployees Me.iFreeOfCharge = "" End Sub
'thanks
And how do you call it? Where does the error occur?
"portroe" <bo*@sleigh.com> schrieb 'this is the constructor from the course class,
Public Sub New(ByVal JobTitle As String, ByVal NumberOfEmployees As Integer) Me.iJobTitle = JobTitle Me.iNumberOfEmployees = NumberOfEmployees Me.iFreeOfCharge = "" End Sub
The question was how the sub is called, i.e. what is the code to create the
object?
--
Armin http://www.plig.net/nnq/nquote.html http://www.netmeister.org/news/learn2quote.html
Hi portroe,
Probably you create the object as this
dim myCourse as New course()
while it has to be
dim myCourse as New course("Programmers",1000)
Just a gues?
Cor 'this is the constructor from the course class,
Public Sub New(ByVal JobTitle As String, ByVal NumberOfEmployees As
Integer) Me.iJobTitle = JobTitle Me.iNumberOfEmployees = NumberOfEmployees Me.iFreeOfCharge = "" End Sub
'thanks
* portroe <bo*@sleigh.com> scripsit: The error occurs when i try to debug, Ireceive this as a build error,
Post the line where the error occurs (must be something like '... New
SomeType(...)'. Maybe you are missing to specify a parameter value or
you are passing wring data.
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
the error occurs in the following line
Dim MyCourse As New Course()
thanks
Herfried K. Wagner [MVP] wrote: * portroe <bo*@sleigh.com> scripsit:
The error occurs when i try to debug, Ireceive this as a build error,
Post the line where the error occurs (must be something like '... New SomeType(...)'. Maybe you are missing to specify a parameter value or you are passing wring data.
* portroe <bo*@sleigh.com> scripsit: the error occurs in the following line
Dim MyCourse As New Course()
\\\
Dim MyCourse As New Course("My Job Title", 22)
///
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Echo??
dim myCourse as New course("Programmers",1000) \\\ Dim MyCourse As New Course("My Job Title", 22) ///
Cor
* "Cor" <no*@non.com> scripsit: Echo??
Sorry...
dim myCourse as New course("Programmers",1000)
Huh...
--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
"portroe" <bo*@sleigh.com> wrote in message
news:OS**************@TK2MSFTNGP11.phx.gbl... the error occurs in the following line
Dim MyCourse As New Course()
Quite right too.
Your Course class "Constructor" (Sub New) is declared as taking
two arguments, JobTitle and NumberOfEmployees. That means
that *every* time you want to create an object of type Course,
you *must* supply both arguments. In this code, you haven't, so
it won't compile.
If you really /want/ to be able to create Course objects /without/
specifying these arguments (and I /don't/ think you do), then add
another Sub New to the Course Class that takes no arguments.
HTH,
Phill W.
Thanks guys that was it,
The new object demands the numberofemployees
this I had defined by the constructor, but no value is assigned to the
Object “MyCourse”.
OO Programming has a steep learning curve at the beginning,
greets
portroe
Phill. W wrote: "portroe" <bo*@sleigh.com> wrote in message news:OS**************@TK2MSFTNGP11.phx.gbl...
the error occurs in the following line
Dim MyCourse As New Course()
Quite right too. Your Course class "Constructor" (Sub New) is declared as taking two arguments, JobTitle and NumberOfEmployees. That means that *every* time you want to create an object of type Course, you *must* supply both arguments. In this code, you haven't, so it won't compile.
If you really /want/ to be able to create Course objects /without/ specifying these arguments (and I /don't/ think you do), then add another Sub New to the Course Class that takes no arguments.
HTH, Phill W.
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Steven Bethard |
last post by:
So I've been playing around with trying to add a keyword argument to min
and max that works similarly to the one for sorted. It wasn't too hard
actually, but it does raise a few questions about...
|
by: Frans Englich |
last post by:
Hello,
In my use of getopt.getopt, I would like to make a certain parameter
mandatory. I know how to specify such that a parameter must have a value if
it's specified, but I also want to make...
|
by: Kapt. Boogschutter |
last post by:
I'm trying to create a function that has at least 1 Argument but can also
contain any number of Arguments (except 0 because my function would have no
meaning for 0 argument).
The arguments...
|
by: Booted Cat |
last post by:
I've seen lots of discussions on the proposed inclusion of "function
call with named arguments" to C/C++ on these newsgroups. My proposal
is slightly different in that:
* No ANSI approval is...
|
by: Michael Conroy |
last post by:
Hi... Synposis...
Throws exception:
"Specified argument was out of the range of valid values."
Read on for the juicy tidbits.
MySimpleClassCol mscc=new MySimpleClassCol();
private void...
|
by: Todd Perkins |
last post by:
Hello all, surprisingly enough, this is my first newsgroup post, I usually
rely on google. So I hope I have enough info contained. Thank you in
advance for any help!
Problem:
I am getting...
|
by: subdhar |
last post by:
I'm getting following error in asp.net application.I search the web
and couldn't find error like this can any one help me in trouble with
this error
Specified argument was out of the range of...
|
by: George W. Jackson |
last post by:
I copied the code below and saved it as a .vbs file. Can anyone tell me why
I would be getting an 800A0005 error while another XP Pro. and a 2000
machine can run it just fine? The error is "An...
|
by: shaanxxx |
last post by:
i have statements
printf("%f",(double)1); /* works fine although i have sent %f for
double */
printf("%c",(int)64); /* works fine although i have sent %c for
int */
Need your comment on...
|
by: dave_dp |
last post by:
Hi, I have just started learning C++ language..
I've read much even tried to understand the way standard says but still
can't get the grasp of that concept.
When parameters are passed/returned...
|
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$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
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...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
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...
|
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,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| |