'requestresponse TITLE "Please choose..." PROMPT "Do you want the TopTen chart only'cr'or the complete statistics for this area?" GADGETS "Top10|Complete"'
IF rc ~= 0 THEN TopTen = 1
'requestresponse TITLE "Please choose..." PROMPT "Do you want stats for all messages'cr'or do you want select messages by date?" GADGETS "Date|All"'
IF rc = 0 THEN
AllMessages = 1
ELSE /* Get dates */
DO
CALL SetupDates /* Routine to get dates */
day = SUBSTR(StartDate,7,2)
month = SUBSTR(StartDate,5,2)
year = SUBSTR(StartDate,1,4)
DispStartDate = day'.'month'.'year /* For display in stats */
day = SUBSTR(StopDate,7,2)
month = SUBSTR(StopDate,5,2)
year = SUBSTR(StopDate,1,4)
DispStopDate = day'.'month'.'year /* For display in stats */
END
'messagelist' /* Goto messagelist */
'gotomessage 2' /* Gotomessage 1 doesn't */
'prevmessage' /* work properly in Spot1.1 */
StartTime = TIME('R') /* Start time measure */
'progressopen TITLE "Reading area..."' /* Open progress window */
preq = result
'getnummsgs' /* Get total number of */
TotalMessages=result /* messages in area. */
IF TotalMessages = 0 THEN signal exit
/* Now we start examining all messages in current area. */
CALL WRITELN out, '-> Total number of participants in this area:' UserNames.0
CALL WRITELN out, '-> Total number of writers:' TotalNumberWriters
CALL WRITELN out, '-> Total number of receivers:' TotalNumberReceivers
CALL WRITELN out, ''
CALL WRITELN out, '-- This chart was created with AreaStat' VER 'written by Brian Jacobsen'
CALL close out
'progressclose' preq
'unlockgui'
EndTime = TIME('E') /* Stop time measure */
TotalTime = TRUNC(EndTime - StartTime)
/* Ask user if he wants the result posted in area or to a file */
requestdata = 'TITLE "Please choose..." PROMPT "Finished. Took:' TotalTime 'seconds.'||cr'Do you want the result sent to a file'cr'or posted in this area?" GADGETS "File|Post in area"'
'requestresponse' requestdata
IF rc = 0 THEN /* Post in area */
DO
'write TO "All" SUBJECT "Stats for this area." FILE "T:Area.stats" NOEDIT NOGUI REFLOW=OFF'
'requestresponse TITLE "Please choose..." PROMPT "Do you wish to edit this message?"'