Hi,
I hope everybody have a nice sunday.
I have a malfunction that I don't understand when using a variable containing a date.
In a browse, I have events and their dates. I need to know the average of these dates for using in others procedures.
So I created a global variable (numeric long with @d06 picture) in the module that contains all relevant procedures and, with the browse template (Action/Totaling), I calc the average of these date.(see
This way is good when there is records in the browse,(see but when there is no record, my global variable is not 0 but a fanciful(?) string (see and so conditions calcs are false.
to track the problem I whrite this code in the embed "On insert after record is primed" on the update procedure (MAJ-Saillies)
"
! Initialisation
if MoyenneDateSaillies = 0 then
message('Moyenne =0')! Debug
if REP:MoyenneDureeGestation = 0 then
SAIatePrevisionMiseBas = SAIateSaillie + 62
else
SAIatePrevisionMiseBas = SAIateSaillie + REP:MoyenneDureeGestation
end ! if REP:MoyenneDureeGestation = 0
else
message(MoyenneDateSaillies) ! Debug : Result => if REP:MoyenneDureeGestation = 0 then
SAIatePrevisionMiseBas = MoyenneDateSaillies + 62
else
SAIatePrevisionMiseBas = MoyenneDateSaillies + REP:MoyenneDureeGestation
end ! if REP:MoyenneDureeGestation = 0
end ! if MoyenneDateSaillies = 0
"
could you help me
best regards
Philippe
I hope everybody have a nice sunday.
I have a malfunction that I don't understand when using a variable containing a date.
In a browse, I have events and their dates. I need to know the average of these dates for using in others procedures.
So I created a global variable (numeric long with @d06 picture) in the module that contains all relevant procedures and, with the browse template (Action/Totaling), I calc the average of these date.(see
This way is good when there is records in the browse,(see but when there is no record, my global variable is not 0 but a fanciful(?) string (see and so conditions calcs are false.
to track the problem I whrite this code in the embed "On insert after record is primed" on the update procedure (MAJ-Saillies)
"
! Initialisation
if MoyenneDateSaillies = 0 then
message('Moyenne =0')! Debug
if REP:MoyenneDureeGestation = 0 then
SAIatePrevisionMiseBas = SAIateSaillie + 62
else
SAIatePrevisionMiseBas = SAIateSaillie + REP:MoyenneDureeGestation
end ! if REP:MoyenneDureeGestation = 0
else
message(MoyenneDateSaillies) ! Debug : Result => if REP:MoyenneDureeGestation = 0 then
SAIatePrevisionMiseBas = MoyenneDateSaillies + 62
else
SAIatePrevisionMiseBas = MoyenneDateSaillies + REP:MoyenneDureeGestation
end ! if REP:MoyenneDureeGestation = 0
end ! if MoyenneDateSaillies = 0
"
could you help me
best regards
Philippe