Code reformatting/cleanup

This commit is contained in:
mysticbbs 2012-02-21 18:38:48 -05:00
parent 6b18527e8b
commit 72eec6e35b
4 changed files with 101 additions and 41 deletions

View File

@ -330,19 +330,19 @@ Begin
If Format = 4 Then If Format = 4 Then
Shell_DOOR32(Temp) Shell_DOOR32(Temp)
Else Else
If ShellDOS ('', Temp) = 0 Then; ShellDOS ('', Temp);
{$ELSE} {$ELSE}
If ShellDOS ('', Temp) = 0 Then; ShellDOS ('', Temp);
{$ENDIF} {$ENDIF}
{ Check to see if event was missed while user was in door } { Check to see if event was missed while user was in door }
If Session.NextEvent.Active Then If Session.NextEvent.Active Then
If (TimerMinutes < A) and (A < Session.NextEvent.ExecTime) Then Begin { midnight roll over } If (TimerMinutes < A) and (A < Session.NextEvent.ExecTime) Then Begin { midnight roll over }
If Session.MinutesUntilEvent(Session.NextEvent.ExecTime) = 0 Then; Session.MinutesUntilEvent(Session.NextEvent.ExecTime);
End Else End Else
If (A < Session.NextEvent.ExecTime) and (TimerMinutes > Session.NextEvent.ExecTime) Then If (A < Session.NextEvent.ExecTime) and (TimerMinutes > Session.NextEvent.ExecTime) Then
If Session.MinutesUntilEvent(Session.NextEvent.ExecTime) = 0 Then; Session.MinutesUntilEvent(Session.NextEvent.ExecTime);
End; End;
End. End.

View File

@ -59,7 +59,7 @@ Type
Function SelectProtocol (Batch : Boolean) : Char; Function SelectProtocol (Batch : Boolean) : Char;
Function WildcardMatch (Wildcard, FName: String) : Boolean; Function WildcardMatch (Wildcard, FName: String) : Boolean;
Procedure CheckFileNameLength (FPath : String; Var FName : String); Procedure CheckFileNameLength (FPath : String; Var FName : String);
Procedure GetFileDescription (FN : String); Procedure GetFileDescription (FN: String);
Function CheckFileLimits (DL: Byte; DLK: Integer) : Byte; Function CheckFileLimits (DL: Byte; DLK: Integer) : Byte;
Function ArchiveList (FName : String) : Boolean; { was string } Function ArchiveList (FName : String) : Boolean; { was string }
Function ImportDIZ (FN: String) : Boolean; Function ImportDIZ (FN: String) : Boolean;
@ -449,7 +449,6 @@ Begin
End; End;
Function TFileBase.ExportFileList (NewFiles : Boolean; Qwk: Boolean) : Boolean; Function TFileBase.ExportFileList (NewFiles : Boolean; Qwk: Boolean) : Boolean;
{ ADD: templates for file listing }
Var Var
TF : Text; TF : Text;
DF : File; DF : File;
@ -711,7 +710,7 @@ Begin
Case CheckFileLimits (1, GetFileSize(Session.TempPath + Mask) DIV 1024) of Case CheckFileLimits (1, GetFileSize(Session.TempPath + Mask) DIV 1024) of
0 : If SendFile (Session.TempPath + Mask) Then Begin; 0 : If SendFile (Session.TempPath + Mask) Then Begin;
Session.SystemLog ('Download from ' + FName + ': ' + Mask); Session.SystemLog ('Download from ' + FName + ': ' + Mask);
{ make a temp var that is fdir.size div 1024 here?? smaller/faster!?}
Inc (Session.User.ThisUser.DLs); Inc (Session.User.ThisUser.DLs);
Inc (Session.User.ThisUser.DLsToday); Inc (Session.User.ThisUser.DLsToday);
Inc (Session.User.ThisUser.DLk, FDir.Size DIV 1024); Inc (Session.User.ThisUser.DLk, FDir.Size DIV 1024);
@ -762,9 +761,12 @@ Var
Session.io.OutFullLn (Session.GetPrompt(200)); Session.io.OutFullLn (Session.GetPrompt(200));
Total := 0; Total := 0;
Reset (FBaseFile); Reset (FBaseFile);
While Not Eof(FBaseFile) Do Begin While Not Eof(FBaseFile) Do Begin
Read (FBaseFile, FBase); Read (FBaseFile, FBase);
If Session.User.Access(FBase.ListACS) Then Begin If Session.User.Access(FBase.ListACS) Then Begin
Inc (Total); Inc (Total);
Session.io.PromptInfo[1] := strI2S(Total); Session.io.PromptInfo[1] := strI2S(Total);
@ -776,6 +778,7 @@ Var
Session.io.OutFull (Session.GetPrompt(201)); Session.io.OutFull (Session.GetPrompt(201));
If (Total MOD 2 = 0) And (Total > 0) Then Session.io.OutRawLn(''); If (Total MOD 2 = 0) And (Total > 0) Then Session.io.OutRawLn('');
End; End;
If EOF(FBaseFile) and (Total MOD 2 <> 0) Then Session.io.OutRawLn(''); If EOF(FBaseFile) and (Total MOD 2 <> 0) Then Session.io.OutRawLn('');
If (Session.io.PausePtr = Session.User.ThisUser.ScreenSize) and (Session.io.AllowPause) Then If (Session.io.PausePtr = Session.User.ThisUser.ScreenSize) and (Session.io.AllowPause) Then
@ -1005,7 +1008,7 @@ Begin
Inc(A); Inc(A);
End; End;
If ShellDOS ('', Temp) = 0 Then; ShellDOS ('', Temp);
End; End;
(*************************************************************************) (*************************************************************************)
@ -1278,16 +1281,19 @@ Begin
While Not Eof(FGroupFile) Do Begin While Not Eof(FGroupFile) Do Begin
Read (FGroupFile, FGroup); Read (FGroupFile, FGroup);
If Not FGroup.Hidden And Session.User.Access(FGroup.ACS) Then Begin If Not FGroup.Hidden And Session.User.Access(FGroup.ACS) Then Begin
Areas := 0; Areas := 0;
Session.User.ThisUser.LastFGroup := FilePos(FGroupFile); Session.User.ThisUser.LastFGroup := FilePos(FGroupFile);
Reset (FBaseFile); Reset (FBaseFile);
While Not Eof(FBaseFile) Do Begin While Not Eof(FBaseFile) Do Begin
Read (FBaseFile, tFBase); Read (FBaseFile, tFBase);
If Session.User.Access(tFBase.ListACS) Then Inc(Areas); If Session.User.Access(tFBase.ListACS) Then Inc(Areas);
End; End;
Close (FBaseFile); Close (FBaseFile);
Inc (Total); Inc (Total);
@ -1312,21 +1318,28 @@ Begin
Session.io.OutFullLn (Session.GetPrompt(216)) Session.io.OutFullLn (Session.GetPrompt(216))
Else Begin Else Begin
Session.io.OutFull (Session.GetPrompt(217)); Session.io.OutFull (Session.GetPrompt(217));
A := strS2I(Session.io.GetInput(4, 4, 11, '')); A := strS2I(Session.io.GetInput(4, 4, 11, ''));
If (A > 0) and (A <= Total) Then Begin If (A > 0) and (A <= Total) Then Begin
Total := 0; Total := 0;
Reset (FGroupFile); Reset (FGroupFile);
Repeat Repeat
Read (FGroupFile, FGroup); Read (FGroupFile, FGroup);
If Not FGroup.Hidden And Session.User.Access(FGroup.ACS) Then Inc(Total); If Not FGroup.Hidden And Session.User.Access(FGroup.ACS) Then Inc(Total);
If A = Total Then Break; If A = Total Then Break;
Until False; Until False;
Session.User.ThisUser.LastFGroup := FilePos(FGroupFile); Session.User.ThisUser.LastFGroup := FilePos(FGroupFile);
If Intro Then Session.io.OutFile ('fgroup' + strI2S(Session.User.ThisUser.LastFGroup), True, 0); If Intro Then Session.io.OutFile ('fgroup' + strI2S(Session.User.ThisUser.LastFGroup), True, 0);
Session.User.ThisUser.LastFBase := 0; Session.User.ThisUser.LastFBase := 0;
ChangeFileArea ('+'); ChangeFileArea ('+');
End Else FGroup := tGroup; End Else
FGroup := tGroup;
End; End;
Close (FGroupFile); Close (FGroupFile);
@ -1345,6 +1358,7 @@ Begin
While Not Eof(FBaseFile) Do Begin While Not Eof(FBaseFile) Do Begin
Read (FBaseFile, FBase); Read (FBaseFile, FBase);
If Session.User.Access(FBase.ListACS) Then Begin If Session.User.Access(FBase.ListACS) Then Begin
Inc (Listed); Inc (Listed);
If Listed = 1 Then Session.io.OutFullLn (Session.GetPrompt(33)); If Listed = 1 Then Session.io.OutFullLn (Session.GetPrompt(33));
@ -1369,6 +1383,7 @@ Begin
If (Listed MOD Config.FColumns = 0) and (Listed > 0) Then Session.io.OutRawLn(''); If (Listed MOD Config.FColumns = 0) and (Listed > 0) Then Session.io.OutRawLn('');
End; End;
If EOF(FBaseFile) and (Listed MOD Config.FColumns <> 0) Then Session.io.OutRawLn(''); If EOF(FBaseFile) and (Listed MOD Config.FColumns <> 0) Then Session.io.OutRawLn('');
If (Session.io.PausePtr = Session.User.ThisUser.ScreenSize) and (Session.io.AllowPause) Then If (Session.io.PausePtr = Session.User.ThisUser.ScreenSize) and (Session.io.AllowPause) Then
@ -1447,6 +1462,7 @@ Begin
If A > 0 Then Begin If A > 0 Then Begin
Reset (FBaseFile); Reset (FBaseFile);
If A <= FileSize(FBaseFile) Then Begin If A <= FileSize(FBaseFile) Then Begin
Seek (FBaseFile, A-1); Seek (FBaseFile, A-1);
Read (FBaseFile, FBase); Read (FBaseFile, FBase);
@ -1457,7 +1473,9 @@ Begin
End Else End Else
FBase := Old; FBase := Old;
End; End;
Close (FBaseFile); Close (FBaseFile);
Exit; Exit;
End; End;
@ -1704,6 +1722,7 @@ Var
Session.io.OutFull (Session.GetPrompt(N)); Session.io.OutFull (Session.GetPrompt(N));
Session.io.AnsiGotoXY (1, Session.io.ScreenInfo[3].Y); Session.io.AnsiGotoXY (1, Session.io.ScreenInfo[3].Y);
Session.io.AnsiClrEOL; Session.io.AnsiClrEOL;
If Session.User.Access(FBase.SysopACS) Then If Session.User.Access(FBase.SysopACS) Then
Session.io.OutFull (Session.GetPrompt(339)) Session.io.OutFull (Session.GetPrompt(339))
Else Else
@ -1740,7 +1759,6 @@ Var
End; End;
Function GetFileListSize : String; Function GetFileListSize : String;
{ ADD: text into prompts or lang config }
Var Var
A : LongInt; A : LongInt;
Begin Begin
@ -1823,6 +1841,7 @@ Var
Session.io.PromptInfo[6] := strI2S(FDir.DLs); Session.io.PromptInfo[6] := strI2S(FDir.DLs);
List[ListSize + 1].Batch := False; List[ListSize + 1].Batch := False;
For A := 1 to BatchNum Do For A := 1 to BatchNum Do
If Batch[A].FileName = FDir.FileName Then Begin If Batch[A].FileName = FDir.FileName Then Begin
List[ListSize + 1].Batch := True; List[ListSize + 1].Batch := True;
@ -2132,6 +2151,7 @@ Var
Repeat Repeat
Session.io.OutFull (Session.GetPrompt(44)); Session.io.OutFull (Session.GetPrompt(44));
Case Session.io.OneKey(#13'FNPQV', True) of Case Session.io.OneKey(#13'FNPQV', True) of
#13, #13,
'N' : If LastPage Then 'N' : If LastPage Then
@ -2150,10 +2170,13 @@ Var
End; End;
'V' : Begin 'V' : Begin
Session.io.OutFull (Session.GetPrompt(358)); Session.io.OutFull (Session.GetPrompt(358));
A := strS2I(Session.io.GetInput(2, 2, 12, '')); A := strS2I(Session.io.GetInput(2, 2, 12, ''));
If (A > 0) and (A <= ListSize) Then If (A > 0) and (A <= ListSize) Then
If Not ArchiveView (FBase.Path + List[A].FileName) Then If Not ArchiveView (FBase.Path + List[A].FileName) Then
Session.io.OutFullLn(Session.GetPrompt(191)); Session.io.OutFullLn(Session.GetPrompt(191));
DrawPage; DrawPage;
End; End;
'F' : Begin 'F' : Begin
@ -2181,7 +2204,9 @@ Var
For B := A to BatchNum Do For B := A to BatchNum Do
Batch[B] := Batch[B + 1]; Batch[B] := Batch[B + 1];
Dec (BatchNum); Dec (BatchNum);
okSave := 2; okSave := 2;
End; End;
@ -2196,16 +2221,21 @@ Var
If okSave = 1 Then Begin If okSave = 1 Then Begin
Session.io.PromptInfo[1] := FDir.FileName; Session.io.PromptInfo[1] := FDir.FileName;
Session.io.PromptInfo[2] := strComma(FDir.Size); Session.io.PromptInfo[2] := strComma(FDir.Size);
Session.io.OutFullLn (Session.GetPrompt(50)); Session.io.OutFullLn (Session.GetPrompt(50));
Inc (BatchNum); Inc (BatchNum);
Batch[BatchNum].FileName := FDir.FileName; Batch[BatchNum].FileName := FDir.FileName;
Batch[BatchNum].Size := FDir.Size; Batch[BatchNum].Size := FDir.Size;
If Mode = 1 Then If Mode = 1 Then
Batch[BatchNum].Area := Session.User.ThisUser.LastFBase Batch[BatchNum].Area := Session.User.ThisUser.LastFBase
Else Else
Batch[BatchNum].Area := FilePos(FBaseFile); Batch[BatchNum].Area := FilePos(FBaseFile);
End; End;
Until False; Until False;
DrawPage; DrawPage;
End; End;
End; End;
@ -2690,8 +2720,8 @@ Begin
Dir := FBase.Path; Dir := FBase.Path;
If SendFile(Dir + FName) Then Begin If SendFile(Dir + FName) Then Begin
{ make tempvar which is size div 1024 or maybe 'updatefilestats' proc? }
Session.SystemLog ('Downloaded: ' + FDir.FileName); Session.SystemLog ('Downloaded: ' + FDir.FileName);
Inc (Session.User.ThisUser.DLs); Inc (Session.User.ThisUser.DLs);
Inc (Session.User.ThisUser.DLsToday); Inc (Session.User.ThisUser.DLsToday);
Inc (Session.User.ThisUser.DLk, FDir.Size DIV 1024); Inc (Session.User.ThisUser.DLk, FDir.Size DIV 1024);
@ -2699,11 +2729,11 @@ Begin
Inc (FDir.DLs); Inc (FDir.DLs);
Inc (Session.HistoryDLs); Inc (Session.HistoryDLs);
Inc (Session.HistoryDLKB, FDir.Size DIV 1024); Inc (Session.HistoryDLKB, FDir.Size DIV 1024);
Seek (FDirFile, FilePos(FDirFile)-1);
Seek (FDirFile, FilePos(FDirFile) - 1);
Write (FDirFile, FDir); Write (FDirFile, FDir);
End Else Begin End Else
Session.SystemLog ('Download of ' + FDir.FileName + ' FAILED'); Session.SystemLog ('Download of ' + FDir.FileName + ' FAILED');
End;
FileErase(Session.TempPath + FName); FileErase(Session.TempPath + FName);
End; End;
@ -2711,10 +2741,12 @@ Begin
2 : Session.io.OutFullLn (Session.GetPrompt(58)); 2 : Session.io.OutFullLn (Session.GetPrompt(58));
3 : Session.io.OutFullLn (Session.GetPrompt(211)); 3 : Session.io.OutFullLn (Session.GetPrompt(211));
End; End;
Close (FDirFile); Close (FDirFile);
Exit; Exit;
End; End;
End; End;
Close (FDirFile); Close (FDirFile);
Session.io.OutFullLn (Session.GetPrompt(51)); Session.io.OutFullLn (Session.GetPrompt(51));
@ -2722,14 +2754,15 @@ End;
Procedure TFileBase.DownloadBatch; Procedure TFileBase.DownloadBatch;
Var Var
A : Byte; A : Byte;
K : LongInt; K : LongInt;
M : Integer; M : Integer;
Dir : String[40]; Dir : String[40];
Old : FBaseRec; Old : FBaseRec;
FL : Text; FL : Text;
Begin Begin
K := 0; K := 0;
For A := 1 to BatchNum Do Inc (K, Batch[A].Size); For A := 1 to BatchNum Do Inc (K, Batch[A].Size);
GetTransferTime (K, M, A); GetTransferTime (K, M, A);
@ -2774,19 +2807,25 @@ Begin
Session.io.PromptInfo[1] := Batch[A].FileName; Session.io.PromptInfo[1] := Batch[A].FileName;
If dszSearch (Batch[A].FileName) Then Begin If dszSearch (Batch[A].FileName) Then Begin
Session.SystemLog ('Download: ' + Batch[A].FileName); Session.SystemLog ('Download: ' + Batch[A].FileName);
Session.io.OutFullLn (Session.GetPrompt(385)); Session.io.OutFullLn (Session.GetPrompt(385));
Inc (Session.User.ThisUser.DLs); Inc (Session.User.ThisUser.DLs);
Inc (Session.User.ThisUser.DLsToday); Inc (Session.User.ThisUser.DLsToday);
Inc (Session.User.ThisUser.DLk, Batch[A].Size DIV 1024); Inc (Session.User.ThisUser.DLk, Batch[A].Size DIV 1024);
Inc (Session.User.ThisUser.DLkToday, Batch[A].Size DIV 1024); Inc (Session.User.ThisUser.DLkToday, Batch[A].Size DIV 1024);
Inc (Session.HistoryDLs); Inc (Session.HistoryDLs);
Inc (Session.HistoryDLKB, Batch[A].Size DIV 1024); Inc (Session.HistoryDLKB, Batch[A].Size DIV 1024);
Seek (FBaseFile, Batch[A].Area - 1); Seek (FBaseFile, Batch[A].Area - 1);
Read (FBaseFile, Old); Read (FBaseFile, Old);
Assign (FDirFile, Config.DataPath + Old.FileName + '.dir'); Assign (FDirFile, Config.DataPath + Old.FileName + '.dir');
Reset (FDirFile); Reset (FDirFile);
While Not Eof(FDirFile) Do Begin While Not Eof(FDirFile) Do Begin
Read (FDirFile, FDir); Read (FDirFile, FDir);
If (FDir.FileName = Batch[A].FileName) And (FDir.Flags And FDirDeleted = 0) Then Begin If (FDir.FileName = Batch[A].FileName) And (FDir.Flags And FDirDeleted = 0) Then Begin
Inc (FDir.DLs); Inc (FDir.DLs);
Seek (FDirFile, FilePos(FDirFile) - 1); Seek (FDirFile, FilePos(FDirFile) - 1);
@ -2794,12 +2833,12 @@ Begin
Break; Break;
End; End;
End; End;
Close (FDirFile); Close (FDirFile);
End Else Begin End Else Begin
Session.SystemLog ('Download: ' + Batch[A].FileName + ' FAILED'); Session.SystemLog ('Download: ' + Batch[A].FileName + ' FAILED');
Session.io.OutFullLn (Session.GetPrompt(386)); Session.io.OutFullLn (Session.GetPrompt(386));
End; End;
End; End;
Close (FBaseFile); Close (FBaseFile);
@ -2844,6 +2883,7 @@ Begin
Session.io.OutFull (Session.GetPrompt(196)); Session.io.OutFull (Session.GetPrompt(196));
Str := Session.io.GetInput(40, 40, 12, ''); Str := Session.io.GetInput(40, 40, 12, '');
If Str = '' Then Exit; If Str = '' Then Exit;
Session.SystemLog ('File search: "' + Str + '"'); Session.SystemLog ('File search: "' + Str + '"');
@ -2853,12 +2893,14 @@ Begin
If All Then Begin If All Then Begin
Session.io.OutRawLn (''); Session.io.OutRawLn ('');
Reset (FBaseFile); Reset (FBaseFile);
While (Not Eof(FBaseFile)) and (Not Done) Do Begin While (Not Eof(FBaseFile)) and (Not Done) Do Begin
Found := False; Found := False;
Read (FBaseFile, FBase); Read (FBaseFile, FBase);
If Session.User.Access(FBase.ListACS) Then Scan_Base; If Session.User.Access(FBase.ListACS) Then Scan_Base;
End; End;
Close (FBaseFile); Close (FBaseFile);
End Else Begin End Else Begin
Session.io.OutRawLn (''); Session.io.OutRawLn ('');
@ -2866,10 +2908,12 @@ Begin
Scan_Base; Scan_Base;
Close (FBaseFile); Close (FBaseFile);
End; End;
If Not Found Then Session.io.OutFullLn('|CR'); If Not Found Then Session.io.OutFullLn('|CR');
Session.io.OutFullLn (Session.GetPrompt(198)); Session.io.OutFullLn (Session.GetPrompt(198));
FBase := Old; FBase := Old;
Session.User.IgnoreGroup := False; Session.User.IgnoreGroup := False;
End; End;
@ -2929,11 +2973,13 @@ Begin
If Global Then Begin If Global Then Begin
Reset (FBaseFile); Reset (FBaseFile);
While (Not Eof(FBaseFile)) And (Not Done) Do Begin; While (Not Eof(FBaseFile)) And (Not Done) Do Begin;
Read (FBaseFile, FBase); Read (FBaseFile, FBase);
GetFileScan; GetFileScan;
If (FScan.NewScan > 0) and Session.User.Access(FBase.ListACS) Then Scan_Current_Base; If (FScan.NewScan > 0) and Session.User.Access(FBase.ListACS) Then Scan_Current_Base;
End; End;
Close (FBaseFile); Close (FBaseFile);
End Else Begin End Else Begin
If FBase.FileName = '' Then If FBase.FileName = '' Then
@ -2954,7 +3000,7 @@ Begin
Session.io.OutFullLn (Session.GetPrompt(88)); Session.io.OutFullLn (Session.GetPrompt(88));
Session.User.IgnoreGroup := False; Session.User.IgnoreGroup := False;
FBase := TempFBase; FBase := TempFBase;
End; End;
(**************************************************************************) (**************************************************************************)
@ -2971,12 +3017,14 @@ Begin
Old := FDir; Old := FDir;
Pos := FilePos(FDirFile); Pos := FilePos(FDirFile);
Get_Next_File := True; Result := True;
Repeat Repeat
If (Eof(FDirFile) And Not Back) or ((FilePos(FDirFile) = 1) and Back) Then Begin If (Eof(FDirFile) And Not Back) or ((FilePos(FDirFile) = 1) and Back) Then Begin
FDir := Old; FDir := Old;
Seek (FDirFile, Pos); (* this may need {I-} and/or Pos-1 *)
Get_Next_File := False; Seek (FDirFile, Pos);
Result := False;
Exit; Exit;
End; End;
If Back Then Seek (FDirFile, FilePos(FDirFile) - 2); If Back Then Seek (FDirFile, FilePos(FDirFile) - 2);
@ -3063,6 +3111,7 @@ Begin
Session.io.OutFullLn ('|08|$D79Ä'); Session.io.OutFullLn ('|08|$D79Ä');
Seek (DataFile, FDir.Pointer); Seek (DataFile, FDir.Pointer);
For A := 1 to 11 Do Begin For A := 1 to 11 Do Begin
Temp := ''; Temp := '';
If A <= FDir.Lines Then Begin If A <= FDir.Lines Then Begin
@ -3080,6 +3129,7 @@ Begin
Session.io.OutFull ('|09([) Previous (]) Next (D) Delete (I) Import DIZ (U) Update DIZ' + Session.io.OutFull ('|09([) Previous (]) Next (D) Delete (I) Import DIZ (U) Update DIZ' +
'|CR(M) Move (V) View Archive (E) Email ULer (Q) Quit: '); '|CR(M) Move (V) View Archive (E) Email ULer (Q) Quit: ');
Case Session.io.OneKey('123456[]DEIMQUV!', True) of Case Session.io.OneKey('123456[]DEIMQUV!', True) of
'1' : Begin '1' : Begin
Temp := Session.io.InXY (4, 3, 70, 70, 11, FDir.FileName); Temp := Session.io.InXY (4, 3, 70, 70, 11, FDir.FileName);
@ -3104,7 +3154,7 @@ Begin
Seek (FDirFile, FilePos(FDirFile) - 1); Seek (FDirFile, FilePos(FDirFile) - 1);
Write (FDirFile, FDir); Write (FDirFile, FDir);
End; End;
'E' : If Session.Menu.ExecuteCommand ('MW', '/TO:' + strReplace(FDir.Uploader, ' ', '_')) Then; 'E' : Session.Menu.ExecuteCommand ('MW', '/TO:' + strReplace(FDir.Uploader, ' ', '_'));
'I' : Begin 'I' : Begin
Session.io.OutFullLn ('|CR|14Importing file_id.diz...'); Session.io.OutFullLn ('|CR|14Importing file_id.diz...');
If ImportDIZ(FDir.FileName) Then Begin If ImportDIZ(FDir.FileName) Then Begin
@ -3156,11 +3206,13 @@ Begin
Seek (DataFile, FDir.Pointer); Seek (DataFile, FDir.Pointer);
FDir.Pointer := FileSize(DataFile2); FDir.Pointer := FileSize(DataFile2);
Seek (DataFile2, FDir.Pointer); Seek (DataFile2, FDir.Pointer);
For B := 1 to FDir.Lines Do Begin For B := 1 to FDir.Lines Do Begin
BlockRead (DataFile, Temp[0], 1); BlockRead (DataFile, Temp[0], 1);
BlockRead (DataFile, Temp[1], Ord(Temp[0])); BlockRead (DataFile, Temp[1], Ord(Temp[0]));
BlockWrite (DataFile2, Temp[0], Length(Temp) + 1); BlockWrite (DataFile2, Temp[0], Length(Temp) + 1);
End; End;
Close (DataFile2); Close (DataFile2);
Seek (FDirFile, FileSize(FDirFile)); Seek (FDirFile, FileSize(FDirFile));
Write (FDirFile, FDir); Write (FDirFile, FDir);
@ -3175,6 +3227,7 @@ Begin
FDir.Flags := FDir.Flags Or FDirDeleted; FDir.Flags := FDir.Flags Or FDirDeleted;
End; End;
Close (FBaseFile); Close (FBaseFile);
Break; Break;
End; End;
@ -3193,11 +3246,13 @@ Begin
Assign (TF, Session.TempPath + 'file_id.diz'); Assign (TF, Session.TempPath + 'file_id.diz');
ReWrite (TF); ReWrite (TF);
Seek (DataFile, FDir.Pointer); Seek (DataFile, FDir.Pointer);
For B := 1 to FDir.Lines Do Begin For B := 1 to FDir.Lines Do Begin
BlockRead (DataFile, Temp[0], 1); BlockRead (DataFile, Temp[0], 1);
BlockRead (DataFile, Temp[1], Ord(Temp[0])); BlockRead (DataFile, Temp[1], Ord(Temp[0]));
WriteLn (TF, Temp); WriteLn (TF, Temp);
End; End;
Close (TF); Close (TF);
ExecuteArchive (FBase.Path + FDir.FileName, '', Session.TempPath + 'file_id.diz', 1); ExecuteArchive (FBase.Path + FDir.FileName, '', Session.TempPath + 'file_id.diz', 1);
@ -3208,16 +3263,19 @@ Begin
'[' : Begin '[' : Begin
Seek (FDirFile, FilePos(FDirFile) - 1); Seek (FDirFile, FilePos(FDirFile) - 1);
Write (FDirFile, FDir); Write (FDirFile, FDir);
If Not Get_Next_File(True) Then;
Get_Next_File(True);
End; End;
']' : Begin ']' : Begin
Seek (FDirFile, FilePos(FDirFile) - 1); Seek (FDirFile, FilePos(FDirFile) - 1);
Write (FDirFile, FDir); Write (FDirFile, FDir);
If Not Get_Next_File(False) Then;
Get_Next_File(False);
End; End;
'!' : Begin '!' : Begin
Seek (DataFile, FDir.Pointer); Seek (DataFile, FDir.Pointer);
If FDir.Lines > Config.MaxFileDesc Then FDir.Lines := Config.MaxFileDesc; If FDir.Lines > Config.MaxFileDesc Then FDir.Lines := Config.MaxFileDesc;
For A := 1 to FDir.Lines Do Begin For A := 1 to FDir.Lines Do Begin
BlockRead (DataFile, Session.Msgs.MsgText[A][0], 1); BlockRead (DataFile, Session.Msgs.MsgText[A][0], 1);
BlockRead (DataFile, Session.Msgs.MsgText[A][1], Ord(Session.Msgs.MsgText[A][0])); BlockRead (DataFile, Session.Msgs.MsgText[A][1], Ord(Session.Msgs.MsgText[A][0]));
@ -3395,7 +3453,7 @@ Begin
Reset (FBaseFile); Reset (FBaseFile);
If Session.io.GetYN('|CR|12Upload files in all directories? |11', True) Then Begin If Session.io.GetYN('|CR|12Upload files in all directories? |11', True) Then Begin {++lang}
While Not Done and Not Eof(FBaseFile) Do Begin While Not Done and Not Eof(FBaseFile) Do Begin
Read (FBaseFile, FBase); Read (FBaseFile, FBase);
Pos := FilePos(FBaseFile); Pos := FilePos(FBaseFile);

View File

@ -681,7 +681,7 @@ Var
If View Then Exit; If View Then Exit;
If Listed = 0 Then Session.io.OutRawLn(''); If Listed = 0 Then Session.io.OutRawLn('');
Listed := A; Listed := A;
If ExecuteCommand (MenuList[A].Command, MenuList[A].Data) Then; ExecuteCommand (MenuList[A].Command, MenuList[A].Data);
Done := True; Done := True;
End; End;
End; End;
@ -790,7 +790,7 @@ Begin
Set_Node_Action (Session.GetPrompt(346)); Set_Node_Action (Session.GetPrompt(346));
If Check_Node_Message Then; Check_Node_Message;
Keys := #13; Keys := #13;
ExtKeys := ''; ExtKeys := '';

View File

@ -1156,7 +1156,7 @@ Var
MsgNew^.DoStringLn(Str); MsgNew^.DoStringLn(Str);
End; End;
If MsgNew^.WriteMsg <> 0 Then; MsgNew^.WriteMsg;
MsgNew^.CloseMsgBase; MsgNew^.CloseMsgBase;
@ -1400,7 +1400,7 @@ Var
Ansi_View_Message := False; Ansi_View_Message := False;
Repeat Repeat
If Check_Node_Message Then; Check_Node_Message;
Set_Node_Action (Session.GetPrompt(348)); Set_Node_Action (Session.GetPrompt(348));
@ -1534,7 +1534,7 @@ Var
MsgBase^.SeekFirst(A); MsgBase^.SeekFirst(A);
If Not SeekNextMsg(True, False) Then Begin If Not SeekNextMsg(True, False) Then Begin
MsgBase^.SeekFirst(CurMsg); MsgBase^.SeekFirst(CurMsg);
If SeekNextMsg(True, False) Then; SeekNextMsg(True, False);
End; End;
End; End;
Break; Break;
@ -1688,7 +1688,8 @@ Var
Procedure FullReDraw; Procedure FullReDraw;
Begin Begin
If Check_Node_Message Then; Check_Node_Message;
Session.io.OutFile ('ansimlst', True, 0); Session.io.OutFile ('ansimlst', True, 0);
PageSize := Session.io.ScreenInfo[2].Y - Session.io.ScreenInfo[1].Y + 1; PageSize := Session.io.ScreenInfo[2].Y - Session.io.ScreenInfo[1].Y + 1;
@ -1892,7 +1893,7 @@ end;
Case Ch of Case Ch of
#13 : Begin #13 : Begin
MsgBase^.SeekFirst(MsgInfo[PagePos].Num); MsgBase^.SeekFirst(MsgInfo[PagePos].Num);
If SeekNextMsg (True, False) Then; SeekNextMsg (True, False);
If Ansi_View_Message Then Break; If Ansi_View_Message Then Break;
MsgBase^.SeekFirst(MsgInfo[1].Num); MsgBase^.SeekFirst(MsgInfo[1].Num);
@ -2055,7 +2056,7 @@ end;
MsgBase^.SeekFirst(A); MsgBase^.SeekFirst(A);
If Not SeekNextMsg(True, False) Then Begin If Not SeekNextMsg(True, False) Then Begin
MsgBase^.SeekFirst(B); MsgBase^.SeekFirst(B);
If Not SeekNextMsg(True, False) Then; SeekNextMsg(True, False);
End; End;
End; End;
Break; Break;
@ -2416,7 +2417,7 @@ Begin
AppendMessageText (MsgBase, Lines, ''); AppendMessageText (MsgBase, Lines, '');
If MsgBase^.WriteMsg <> 0 Then; MsgBase^.WriteMsg;
MsgBase^.CloseMsgBase; MsgBase^.CloseMsgBase;
@ -2729,7 +2730,7 @@ Var
AppendMessageText (MsgBase, Lines, ''); AppendMessageText (MsgBase, Lines, '');
If MsgBase^.WriteMsg <> 0 Then; MsgBase^.WriteMsg;
End; End;
Begin Begin
@ -3198,7 +3199,8 @@ Begin
MsgBase^.DoStringLn(' * Origin: ' + ResolveOrigin(MBase) + ' (' + strAddr2Str(Config.NetAddress[MBase.NetAddr]) + ')'); MsgBase^.DoStringLn(' * Origin: ' + ResolveOrigin(MBase) + ' (' + strAddr2Str(Config.NetAddress[MBase.NetAddr]) + ')');
End; End;
If MsgBase^.WriteMsg <> 0 Then; MsgBase^.WriteMsg;
MsgBase^.CloseMsgBase; MsgBase^.CloseMsgBase;
Inc (Session.User.ThisUser.Posts); Inc (Session.User.ThisUser.Posts);