FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV (précédentes versions)
→
WD18: Wrong constructor call when initializing an object
WD18: Wrong constructor call when initializing an object
Débuté par Nicolas Chari, 12 jan. 2015 15:48 - Aucune réponse
Connectez-vous…
Nicolas Chari
#1
Posté le 12 janvier 2015 - 15:48
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.
Signaler
0
0
→ Revenir à WINDEV (précédentes versions)
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte