Comment ========================================================== Computer Tyme fax menu. This is a client menu that works with FaxServ.mnu so that the user can send faxes without using the MHS mail system. It also manages incomming faxes for viewing and printing. ========================================================= EndComment ;----- Create Variables Var From Company Department FaxTo Subject Phone FileName Com FaxIn FaxFile PersonalFax NewFaxes FaxConnection FaxList Idx ULine = '__________________________________________' ;----- Here is where you add you own menu title and status line message MenuTitle = "Computer Tyme Fax Sending Menu" StatusLineText = "" ;----- Load look and feel routines Include "CUSTOM.INC" ReadDirectory (FaxInPath + '\*.DCX',FaxIn) NewFaxes = NumberOfElements(FaxIn) NovGetConnections(FaxConnection,'BBS1',1) FaxConnection = FaxConnection[1] ReadAscTextFile('H:\FAX.LST',FaxList) ;ReadAscTextFile('P:\FAXLISTS\LOCAL.LST',FaxList) MatrixInvert(FaxList) Idx = FaxList[1] MatrixInvert(FaxList) SortArrayLinked(FaxList,Idx) Main ;======================================== Procedure Main AddChoice('Send a Fax',1) if NewFaxes > 0 AddChoice('Receive Faxes',2) endif AddChoice('Personal Faxes',3) AddChoice('Monitor Fax Board',4) AddChoice('Run PCONSOLE',5) CornerStretchBox ('Main Menu',11,6) OnKey Task(1) |SendFax OnKey Task(2) |PersonalFax = False |ReceiveFax OnKey Task(3) |PersonalFax = True |ReceiveFax OnKey Task(4) |FaxMessage('MON') |Execute 'LA BBS1' OnKey Task(5) |Execute 'PCONSOLE' OnKey Esc |LeaveMenu EndProc Procedure FaxInPath if PersonalFax if not ExistDir 'H:\FAX' MkDir('H:\FAX') endif Return 'H:\FAX' else Return 'F:\BBS\DCXIN' endif EndProc Procedure ReceiveFax ReadDirectory (FaxInPath + '\*.DCX',FaxIn) if NumberOfElements FaxIn > 0 DrawTheBox(48,6,23,Min(12,NumberOfElements(FaxIn) + HeightDifference),'Faxes') FaxFile = PickOne(FaxIn) if FaxFile > '' FaxFile = FaxInPath + '\' + FaxFile DealWithFax endif endif EndProc Procedure DealWithFax AddChoice('View a Fax',1) AddChoice('Print a Fax',2) AddChoice('Delete a Fax',3) if not PersonalFax AddChoice('Move Fax to Personal',4) endif CornerStretchBox (FaxFile,11,15) OnKey Task(1) |ViewFax (FaxFile) OnKey Task(2) |PrintFax (FaxFile) OnKey Task(3) |DelFile (FaxFile) |LastKey = Esc OnKey Task(4) |MoveFax (FaxFile) |LastKey = Esc EndProc Procedure ViewFax (St) Execute 'F:\BBS\FAXPAK\FPVIEW.EXE ' + St + ' -Z3' EndProc Procedure PrintFax (St) Execute 'F:\BBS\FAXPAK\FPPRINT.EXE ' + St + ' -O LPT2' EndProc Procedure MoveFax (St) var NewName DrawTheBox(48,15,13,1 + HeightDifference,'New Name') InputBlankChar = '_' UpperCaseOnly NewName = Readln if LastKey = Esc then Return if NewName = '' NewName = FilePart(St) else NewName = NewName + '.DCX' endif FileRename (St,'H:\FAX\' + NewName) EndProc Procedure SendFax From = NovFullName GetInfo if Phone > '' AddComment if YesNo ('Ready to Send','Y') MailFax endif endif EndProc Procedure GetInfo var Line St Done DrawTheBox(11,13,60,7 + HeightDifference,'Send Fax Information') CapsColor 0 0 UseArrows Off UpperCaseOnly Off InputBlankChar = '_' Writeln ' Company:' Writeln ' Person:' Writeln ' Phone:' Writeln ' File:' Writeln ' Regarding:' Writeln ' Department:' Write ' From:' TextColor LCyan Blue Loop 7 GotoXY(14,LoopIndex) Write ULine EndLoop GotoXY(14,7) Write From Line = 1 while not Done GotoXY(14,Line) if Line = 1 St = Company elseif Line = 2 St = FaxTo elseif Line = 3 KeyEvent (F5) = Loc PickFaxList St = Phone elseif Line = 4 St = FileName elseif Line = 5 St = Subject elseif Line = 6 St = Department elseif Line = 7 St = From endif InputString = St St = Readln if LastKey <> Esc if Line = 1 Company = St elseif Line = 2 FaxTo = St elseif Line = 3 Phone = St KeyEvent (F5) = nil elseif Line = 4 FileName = ExistOnPath(St) GotoXY(14,Line) Write ULine GotoXY(14,Line) Write FileName elseif Line = 5 Subject = St elseif Line = 6 Department = St elseif Line = 7 From = St endif endif if LastKey = Esc Done = True elseif LastKey = CR Line = Line + 1 elseif LastKey = DownArrow Line = Line + 1 elseif LastKey = UpArrow Line = Line - 1 endif Line = Line + 6 mod 7 + 1 endwhile EndProc ;----- Use MarxEdit to add a comment to the fax. Procedure AddComment if YesNo('Add a Comment','Y') Execute 'ME.EXE H:COMMENT.TXT' ReadTextFile('H:COMMENT.TXT',Com) endif EndProc Procedure MailFax var X ;MHS Header AppendArray(X,'SMF-70') AppendArray(X,'FROM: ' + NovLoginName + ' @ CTYME') AppendArray(X,'TO: FAX @ CTYME') AppendArray(X,'') ;Information for fax server AppendArray(X,'FROM: ' + From) if FaxTo > '' then AppendArray(X,'ATTN: ' + FaxTo) if Company > '' then AppendArray(X,'COMPANY: ' + Company) if Department > '' then AppendArray(X,'DEPT: ' + Department) if Subject > '' then AppendArray(X,'SUBJECT: ' + Subject) AppendArray(X,'PHONE: ' + Phone) if ExistOnPath(FileName) > '' AppendArray(X,'FAXFILE: ' + FileName) endif Loop Com AppendArray(X,Com[LoopIndex]) EndLoop WriteTextFile(MhsSendDirectory + '\' + UniqueFileName,X) FaxMessage('GOOSE') EndProc Procedure FaxMessage (St) St = 'FROM ' + NovLoginName + '[' + Str(NovConnection) + ']: ' + St NovSendMessage(St,FaxConnection) EndProc Procedure PickFaxList var To DrawTheBox (20 7 45 14 'Fax List') MatrixInvert(FaxList) To = PickOne(FaxList[1]) if PickPosition > 0 WorkString = FaxList[2,PickPosition] ; StuffKbd CR ; StuffKeyboardNow endif MatrixInvert(FaxList) EndProc ;------ Yes or No Procedure YesNo (Prompt, Orig) var Ch DrawBox 15 21 length(Prompt) + 7 3 UseArrows Off TextColor LCyan Blue Write ' ' Prompt '? ' Orig Char(8) Ch = UpperCase(ReadKey) EraseTopWindow if Ch = CR then Ch = Orig Return Ch = 'Y' EndProc