home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Extra 1997 #5
/
AmigaPlus_Extra-CD_5-97.iso
/
online-tools
/
mail
/
ems
/
rexx
/
count.ems
< prev
next >
Wrap
Text File
|
1993-07-29
|
2KB
|
72 lines
/* Count.ems */
options results
signal on error
signal on syntax
if( ~show( 'l', "ems_rexx.library" ) ) then
do
if( ~addlib( "ems_rexx.library", 0, -30, 0 ) )then
do
say "Could not open ems_rexx.library"
exit 10
end
end
call EMS_Areas( 'areas' )
count_msg.0 = areas.0 + 1; tot_msg = 0
count_file.0 = areas.0 + 1; tot_file = 0
do i=1 to areas.0
count_msg.i = 0
count_file.i = 0
if EMS_Area_Msg_DBname( areas.i ) ~= '' then do; call EMS_Area_Item_List( areas.i, 'MSG' , 'items' ); count_msg.i = items.0; drop items.; end
if EMS_Area_File_DBname( areas.i ) ~= '' then do; call EMS_Area_Item_List( areas.i, 'FILE', 'items' ); count_file.i = items.0; drop items.; end
tot_msg = tot_msg + count_msg.i
tot_file = tot_file + count_file.i
end
count_msg.i = tot_msg
count_file.i = tot_file
width_areas = EMS_Calc_Stem_Width( 'areas' , 'ADAPT' )
width_msg = EMS_Calc_Stem_Width( 'count_msg' , 'ADAPT_RIGHT' )
width_file = EMS_Calc_Stem_Width( 'count_file', 'ADAPT_RIGHT' )
say '|'
say '| Number of messages in areas:'
do i=1 to areas.0
say '| Area' areas.i 'has' count_msg.i 'message(s) ' count_file.i 'file(s)'
end
say '|------------------------------------------------------------------'
say '|' copies( ' ', width_areas ) 'Total : ' count_msg.i 'message(s) ' count_file.i 'file(s)'
say '| End Of List'
call EMS_FreeScriptData()
exit 0
error:
syntax:
error_text = EMS_LastError()
if error_text = '' then error_text = rc ErrorText( rc )
say '| ***BREAK: error at' sigl error_text
call EMS_FreeScriptData()
exit rc