-- file: Replace.Mesa -- edited by Brotz, October 12, 1981 3:24 PM -- edited by Taft, May 26, 1983 6:11 PM DIRECTORY exD: FROM "ExceptionDefs", inD: FROM "InteractorDefs", intCommon, opD: FROM "OperationsDefs", tsD: FROM "TOCSelectionDefs", vmD: FROM "VirtualMgrDefs"; Replace: PROGRAM IMPORTS exD, inD, intC: intCommon, opD, tsD, vmD = BEGIN tnp: inD.TOCTextNbrPtr = intC.tocTextNbr; toc: vmD.TOCHandle = intC.tocTextNbr.toc; tocIndex: vmD.TOCIndex; key: CARDINAL; IF ~tnp.haveToc OR ~intC.cmTextNbr.haveMessage THEN exD.DisplayExceptionString["No toc or message"L] ELSE BEGIN key _ vmD.WaitForLock[toc]; IF tsD.TOCSelectionEmpty[toc, key] THEN BEGIN exD.DisplayExceptionString["No message selected"L]; vmD.UnlockTOC[toc, key]; END ELSE BEGIN worked: BOOLEAN; tocIndex _ tsD.LastSelectedEntry[toc, key]; -- inD.IndicateCommandBusy[intC.mailFileCommandHouse]; tsD.DeconsiderAll[tnp, key]; tsD.ResetTOCSelection[toc, key]; worked _ opD.ReplaceMailOperation [delete: TRUE, toc: toc, msg: intC.cmTextNbr.message, index: tocIndex, key: key]; IF worked THEN BEGIN tsD.SetTOCSelection[toc, key, tocIndex]; inD.Consider[tocIndex, tocIndex, tnp, key]; intC.composedMessageEdited _ FALSE; END ELSE exD.DisplayExceptionString["Not enough room to perform replace."L]; inD.UpdateTOCThumbLine[tnp, key]; vmD.UnlockTOC[toc, key]; -- inD.IndicateCommandFinished[intC.mailFileCommandHouse]; END; END; END. -- of Replace -- (635)\f1