/* UndeleteRange.thor by Troels Walsted Hansen ** $VER: UndeleteRange.thor v1.00 (01.08.95) ** ** Undelete a specified range of messages. */ options results /* needs THOR and bbsread.library functions */ p = ' ' || address() || ' ' || show('P',,) thorport = pos(' THOR.',p) if thorport > 0 then thorport = word(substr(p,thorport+1),1) else do say 'No THOR port found!' exit 10 end if ~show('p', 'BBSREAD') then do address command "run >nil: `GetEnv THOR/THORPath`bin/LoadBBSRead" "WaitForPort BBSREAD" end /* get info on messages */ address(bbsread) GETGLOBALDATA stem GLOBALDATA address(thorport) GETGLOBALCONFIG stem GLOBALCONFIG CURRENTBBS stem CURRENT if(CURRENT.CONFNAME = "") then do address(bbsread) GETCONFLIST '"'CURRENT.BBSNAME'"' CONFLIST if(rc ~= 0) then do address(thorport) REQUESTNOTIFY TEXT '"'BBSREAD.LASTERROR'"' BT '"_Ok"' exit 5 end address(thorport) REQUESTLIST instem CONFLIST title '"Select conf:"' SIZEGADGET if(rc ~= 0) then exit else CURRENT.CONFNAME = result end address(bbsread) GETCONFDATA bbsname '"'CURRENT.BBSNAME'"' confname '"'CURRENT.CONFNAME'"' stem CONFDATA /* if(CONFDATA.FIRSTMSG < 1 | CONFDATA.LASTMSG < 1) then exit address(thorport) REQUESTINTEGER MIN '"'CONFDATA.FIRSTMSG'"' MAX '"'CONFDATA.LASTMSG'"' INIT '"'CONFDATA.FIRSTMSG'"' TITLE '"First message in range:"' BT '"_Ok|_Cancel"' firstmsg = result if(rc ~= 0 | firstmsg = "RESULT") then exit REQUESTINTEGER MIN '"'firstmsg'"' MAX '"'CONFDATA.LASTMSG'"' INIT '"'CONFDATA.LASTMSG'"' TITLE '"Last message in range:"' BT '"_Ok|_Cancel"' lastmsg = result if(rc ~= 0 | lastmsg = "RESULT") then exit */ address(thorport) REQUESTINTEGER MIN '"1"' MAX '"9999999"' INIT '"'CONFDATA.FIRSTMSG'"' TITLE '"First message in range:"' BT '"_Ok|_Cancel"' firstmsg = result if(rc ~= 0 | firstmsg = "RESULT") then exit REQUESTINTEGER MIN '"'firstmsg'"' MAX '"9999999"' INIT '"'CONFDATA.LASTMSG'"' TITLE '"Last message in range:"' BT '"_Ok|_Cancel"' lastmsg = result if(rc ~= 0 | lastmsg = "RESULT") then exit /* undelete the messages with a progressbar */ OPENPROGRESS TITLE '"' || 'Deleting messages from ' || CURRENT.CONFNAME || '"' TOTAL lastmsg-firstmsg+1 AT '"_Abort"' if(rc = 0) then do window = result do i=firstmsg to lastmsg address(thorport) UPDATEPROGRESS REQ window CURRENT i-firstmsg+1 PT '"' || 'Deleting message #' || i || '"' if(rc ~= 0) then do address(thorport) CLOSEPROGRESS REQ window exit end address(bbsread) UPDATEBRMESSAGE '"'CURRENT.BBSNAME'"' '"'CURRENT.CONFNAME'"' i CLEARDELETED end end address(thorport) CLOSEPROGRESS REQ window SHOWCONFERENCE '"'CURRENT.CONFNAME'"' UPDATECONFWINDOW exit