From 6984263d14d4ec149e193e47f1af7cbf67eb41a9 Mon Sep 17 00:00:00 2001 From: mysticbbs Date: Mon, 27 Feb 2012 18:43:39 -0500 Subject: [PATCH] Localized file/record variables --- mystic/bbs_cfg_msgbase.pas | 22 +++++++++++----------- mystic/bbs_cfg_seclevel.pas | 29 +++++++++++++---------------- 2 files changed, 24 insertions(+), 27 deletions(-) diff --git a/mystic/bbs_cfg_msgbase.pas b/mystic/bbs_cfg_msgbase.pas index 0f29790..40c3f9b 100644 --- a/mystic/bbs_cfg_msgbase.pas +++ b/mystic/bbs_cfg_msgbase.pas @@ -17,11 +17,7 @@ Uses bbs_Cfg_SysCfg, bbs_Common; -Var - MBaseFile : TBufFile; - MBase : RecMessageBase; - -Procedure EditMessageBase; +Procedure EditMessageBase (Var MBase: RecMessageBase); Var Box : TAnsiMenuBox; Form : TAnsiMenuForm; @@ -89,11 +85,13 @@ End; Procedure Configuration_MessageBaseEditor; Var - Box : TAnsiMenuBox; - List : TAnsiMenuList; - MIndex : LongInt; - Copied : RecMessageBase; - HasCopy : Boolean = False; + Box : TAnsiMenuBox; + List : TAnsiMenuList; + MIndex : LongInt; + Copied : RecMessageBase; + HasCopy : Boolean = False; + MBaseFile : TBufFile; + MBase : RecMessageBase; Procedure MakeList; Var @@ -239,7 +237,9 @@ Begin #13 : If List.Picked < List.ListMax Then Begin MBaseFile.Seek (List.Picked - 1); MBaseFile.Read (MBase); - EditMessageBase; + + EditMessageBase (MBase); + MBaseFile.Seek (List.Picked - 1); MBaseFile.Write (MBase); End; diff --git a/mystic/bbs_cfg_seclevel.pas b/mystic/bbs_cfg_seclevel.pas index 7ed222f..8546e78 100644 --- a/mystic/bbs_cfg_seclevel.pas +++ b/mystic/bbs_cfg_seclevel.pas @@ -16,11 +16,7 @@ Uses bbs_Ansi_MenuForm, bbs_Cfg_Common; -Var - SecFile : File; - Sec : RecSecurity; - -Procedure Edit_Level (Level: Integer); +Procedure EditLevel (Var Sec: RecSecurity); Var Box : TAnsiMenuBox; Form : TAnsiMenuForm; @@ -28,14 +24,9 @@ Var Begin Topic := '|03(|09Security|03) |01-|09> |15'; - ioSeek (SecFile, Level - 1); - ioRead (SecFile, Sec); - Box := TAnsiMenuBox.Create; Form := TAnsiMenuForm.Create; - Box.Header := ' Security Level ' + strI2S(Level) + ' '; - Box.Open (12, 5, 68, 21); VerticalLine (35, 6, 20); @@ -62,9 +53,6 @@ Begin Box.Free; Form.Free; - - ioSeek (SecFile, Level - 1); - ioWrite (SecFile, Sec); End; Function Configuration_SecurityEditor (Edit: Boolean) : LongInt; @@ -72,6 +60,8 @@ Var List : TAnsiMenuList; Box : TAnsiMenuBox; HideMode : Boolean; + SecFile : File; + Sec : RecSecurity; Procedure MakeList; Var @@ -135,9 +125,16 @@ Begin End; #13 : Begin Count := strS2I(Copy(List.List[List.Picked]^.Name, 1, 3)); - If Edit Then - Edit_Level(Count) - Else Begin + + If Edit Then Begin + ioSeek (SecFile, Count - 1); + ioRead (SecFile, Sec); + + EditLevel(Sec); + + ioSeek (SecFile, Count - 1); + ioWrite (SecFile, Sec); + End Else Begin Result := Count; Break; End;