Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

variable numeric long not 0 when empty

Status
Not open for further replies.

berthoud

Technical User
Oct 31, 2010
51
0
0
FR
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
SAI:DatePrevisionMiseBas = SAI:DateSaillie + 62
else
SAI:DatePrevisionMiseBas = SAI:DateSaillie + REP:MoyenneDureeGestation
end ! if REP:MoyenneDureeGestation = 0
else
message(MoyenneDateSaillies) ! Debug : Result => if REP:MoyenneDureeGestation = 0 then
SAI:DatePrevisionMiseBas = MoyenneDateSaillies + 62
else
SAI:DatePrevisionMiseBas = MoyenneDateSaillies + REP:MoyenneDureeGestation
end ! if REP:MoyenneDureeGestation = 0
end ! if MoyenneDateSaillies = 0
"

could you help me

best regards

Philippe
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top