English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

if (ends < start)then
start = 24 - start
hoursWorked = start + ends
else
hoursWorked = ({Incident.ShiftEndTime} - {Incident.ShiftStartTime})
hoursWorked = hoursWorked / 100
end if

2007-11-21 06:39:22 · 3 answers · asked by Blaine W 2 in Science & Mathematics Mathematics

A little more than 6 would be helpful.

Anything please.

2007-11-21 06:48:26 · update #1

3 answers

Looks like a Visual Basic script "if" test

If (ends < start) then

(if the end time is earlier than the start time, e.g. 2:00 is less than 4:00, that means that the work was started on the previous day, therefore:

start = 24 - start

(In this example, 24 - 4 = 20:00 This step brings the time back to the previous day)

hoursWorked = start + ends

(so if the person started work at 4:00, and ended at 2:00, the hours worked = 20 :00 plus 2:00 = 22:00)

else

(means that ends is not < start, in which case the next 2 statements compute the hours worked, and then divide them by 100)

endif

(ends the section of programming that started with "if")

2007-11-21 07:24:54 · answer #1 · answered by Joe L 5 · 1 0

Pretty confusing psuedo code. Looks like it determines how
many hour you worked in a shift. I'd have to guess that
ends and start are numbers from 1 to 24. If ends < start, then
you worked the night shift, for example came in at hour 18
and then worked till 4 am the next day. So start = 24 - start
turns start into the number of hours worked from the time
you started until midnight. Then you add ends to get the hours
worked from midnight till quitting time the next morning.

The other case handles the day shift work, when ends is
> start (i.e came in at 8, and worked until hour 17).
For some reason, different variables (Incident.shiftendtime,
incidient.shiftstarttime)
are used to compute the time worked, and it looks like
these are in units that require dividing by 100. Perhaps
the "incident" variables have values like 800 and 1700. This
would give a difference of 900, so you'd have to divide by
100 to get hoursWorked into the correct units.

2007-11-21 07:27:04 · answer #2 · answered by cryptogramcorner 6 · 0 0

6

2007-11-21 06:46:20 · answer #3 · answered by Anonymous · 0 0

fedest.com, questions and answers