PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV (earlier versions)
→
WD18: Wrong constructor call when initializing an object
WD18: Wrong constructor call when initializing an object
Started by Nicolas Chari, Jan., 12 2015 3:48 PM - No answer
Connect yourself…
Nicolas Chari
#1
Posted on January, 12 2015 - 3:48 PM
Hey everybody,
I got an issue compiling this code:
Class = Shift
Procedure
ProduceAppointments
(
)
lAppointmentsArray is an
array of
dynamic
Appointment
FOR EACH lShiftRequirement OF _shiftRequirements
FOR i
=
1
TO lShiftRequirement.numberOfEmployees
lAppointment is an
Appointment
(
object
,
lShiftRequirement.skills
)
ArrayAdd
(
lAppointmentsArray
,
lAppointment
)
END
END
RESULT
lAppointmentsArray
At line
lAppointment is an
Appointment
(
object
,
lShiftRequirement.skills
)
program crashes and the error code says that I call the Shift constructor, needing 4 parameters and that I give none.
I don't really know why it calls the Shift constructor; "Object" is a Shift, but we don't need a constructor since it already exists, right?
Also, if you wondered, there is no call to the Shift constructor in the Appointment constructor:
Procedure Constructor
(
pShift is a Shift
,
pSkillsNeeded is an
array of
dynamic Skill
)
PRIVATE
:
_associatedShift
=
pShift
:
_skillsNeeded
=
pSkillsNeeded
Here is the Shift Constructor if you want it:
Procedure Constructeur
(
pLabel is a
string
,
pStartingTime is a DateTime
,
pEndingTime is a DateTime
,
pShiftRequirements is an
array of
dynamic ShiftRequirements
)
...
If someone has an idea how to solve this, it would help me a lot, I'm stuck
Thanks in advance.
Report
0
0
→ Go back to WINDEV (earlier versions)
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text