'requeststring TITLE "Select a user in current message-base"'
naam=RESULT
if naam == 'RESULT' then exit
'messagelist'
'include FROM "'naam'" NOREQ NOGUI'
'getnumselected'
totaal=RESULT
if totaal == 0 then do
'requestnotify PROMPT "Name not found."'
exit
end
'messages'
'firstmessage'
'getfrom'
eerst_nm=RESULT
if naam ~= eerst_nm then 'nextmarked'
CR='0d'x
LF='0a'x
tel=0
einde=0
say totaal
'progressopen TITLE "Reading dates..."'
prg=RESULT
do while einde == 0
'progressupdate' prg tel totaal
res2=RC
if res2 == 5 then do
'progressclose' prg
'excludeflag ALL'
exit
end
'getdatewritten'
datum.tel=RESULT
tel=tel+1
'nextmarked'
einde=RC
end
'progressclose' prg
'excludeflag ALL'
address command 'Date >t:date.temp'
Datum=Get_current_date()
address command 'Delete >NIL: t:date.temp'
call Get_dates_right()
'requestresponse TITLE "Choose time-basis:" PROMPT " Day - Stats of the last 7 days 'cr' Week - Stats of the last 4 weeks" GADGETS "_Day|_Week|_Cancel"'
res2=RC
select
when res2 == 1 then call Make_day_stats()
when res2 == 2 then call Make_week_stats()
otherwise exit
end
if (res2 == 1) | (res2 == 2) then do
'requestresponse TITLE "Include result:" PROMPT " File - Results will be saved in file 'cr' Message - Write result in message base" GADGETS "File|_Message|_Cancel"'