home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Extra 1997 #5
/
AmigaPlus_Extra-CD_5-97.iso
/
online-tools
/
mail
/
ems
/
rexx
/
import.ems
< prev
next >
Wrap
Text File
|
1993-08-30
|
3KB
|
118 lines
/* Import.ems */
options results
signal on error
signal on syntax
parse arg mode domain .
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
mode = upper( mode )
if mode = '' | mode = 'NORMAL' then
do
if domain = '' then call EMS_Tosser_Import( )
else call EMS_Tosser_Import( domain )
end
call EMS_Areas_Imported( 'areas' )
call EMS_Switch_Local( 'SEARCH_NEW' , 'ON' )
call EMS_Switch_Local( 'SEARCH_ON_TO' , 'ON' )
call EMS_Switch_Local( 'IGNORE_FROM' , 'ON' )
call EMS_Switch_Local( 'IGNORE_SUBJECT', 'ON' )
call EMS_Switch_Local( 'IGNORE_DATE' , 'ON' )
call EMS_Switch_Local( 'IGNORE_TEXT' , 'ON' )
sysop_name = EMS_Var_Local( 'SYSOP_NAME' )
len_name = 0
msg_count. = 0
msg_count_forus. = 0
len_msg = 0
len_msg_forus = 0
file_count. = 0
file_count_forus. = 0
len_file = 0
len_file_forus = 0
doareafix = 'NO'
do i=1 to areas.0
if upper( EMS_Area_Type( areas.i ) ) = 'MAIL' then doareafix = 'YES'
if EMS_Area_Msg_DBname( areas.i ) ~= '' then
do
call EMS_Database_Search( areas.i, 'MSG' , 'items', '#?' ); msg_count.i = items.0; drop items.
call EMS_Database_Search( areas.i, 'MSG' , 'items', sysop_name ); msg_count_forus.i = items.0; drop items.
end
if EMS_Area_File_DBname( areas.i ) ~= '' then
do
call EMS_Database_Search( areas.i, 'FILE', 'items', '#?' ); file_count.i = items.0; drop items.
call EMS_Database_Search( areas.i, 'FILE', 'items', sysop_name ); file_count_forus.i = items.0; drop items.
end
len_name = max( len_name , length( areas.i ) )
len_msg = max( len_msg , length( msg_count.i ) )
len_msg_forus = max( len_msg_forus , length( msg_count_forus.i ) )
len_file = max( len_file , length( file_count.i ) )
len_file_forus = max( len_file_forus, length( file_count_forus.i ) )
end
/* Prints the list */
if areas.0 ~= 0 then
do
call EMS_Log_Print( 4, '|' , 'TIME' )
call EMS_Log_Print( 4, '| List of imported areas:', 'TIME' )
space_name = copies( ' ', len_name )
space_msg = copies( ' ', len_msg )
space_msg_forus = copies( ' ', len_msg_forus )
space_file = copies( ' ', len_file )
space_file_forus = copies( ' ', len_file_forus )
do i=1 to areas.0
line = '|' overlay( areas.i , space_name )
line = line 'New msg(s):' overlay( msg_count.i , space_msg )
line = line '(' || overlay( msg_count_forus.i , space_msg_forus ) || ')'
line = line '- New File(s):' overlay( file_count.i , space_file )
line = line '(' || overlay( file_count_forus.i, space_file_forus ) || ')'
call EMS_Log_Print( 4, line, 'TIME' )
end
end
if doareafix = 'YES' then call 'EMS:rexx/Areafix.ems'
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