473,385 Members | 1,342 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,385 software developers and data experts.

Argument not specified

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

Nov 20 '05 #1
14 14443
"portroe" <bo*@sleigh.com> schrieb
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)'.


How can we know as you don't tell us how you call the sub?
--
Armin

http://www.plig.net/nnq/nquote.html
http://www.netmeister.org/news/learn2quote.html

Nov 20 '05 #2
* 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>
Nov 20 '05 #3
'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).


Nov 20 '05 #4
* 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>
Nov 20 '05 #5
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?


Nov 20 '05 #6
"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

Nov 20 '05 #7
Cor
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

Nov 20 '05 #8
* 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>
Nov 20 '05 #9
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.


Nov 20 '05 #10
* 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>
Nov 20 '05 #11
Cor
Echo??

dim myCourse as New course("Programmers",1000)

\\\
Dim MyCourse As New Course("My Job Title", 22)
///


Cor
Nov 20 '05 #12
* "Cor" <no*@non.com> scripsit:
Echo??
Sorry...
dim myCourse as New course("Programmers",1000)


Huh...

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #13
"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.
Nov 20 '05 #14
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.


Nov 20 '05 #15

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

Similar topics

1
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...
6
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...
7
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...
5
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...
3
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...
4
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...
9
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...
1
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...
5
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...
12
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...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
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:
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...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.