Added Copy/Paste functions

This commit is contained in:
mysticbbs 2012-02-24 11:47:28 -05:00
parent c47d3e6caf
commit d78b82e9e2
2 changed files with 39 additions and 13 deletions

View File

@ -55,8 +55,9 @@ Var
List : TAnsiMenuList;
F : TBufFile;
Arc : RecArchive;
Copied : RecArchive;
HasCopy : Boolean = False;
// SORT THIS LIST BY NON CASE SENSITIVE ARCHIVE EXTENSION
Procedure MakeList;
Var
OS : String;
@ -105,8 +106,7 @@ Begin
List.Close;
Case List.ExitCode of
'/' : Case GetCommandOption(11, 'I-Insert|D-Delete|') of
#27 : ;
'/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of
'I' : Begin
F.RecordInsert (List.Picked);
@ -124,6 +124,18 @@ Begin
End;
'D' : If ShowMsgBox(1, 'Delete this entry?') Then Begin
F.RecordDelete (List.Picked);
MakeList;
End;
'C' : If List.Picked <> List.ListMax Then Begin
F.Seek (List.Picked - 1);
F.Read (Copied);
HasCopy := True;
End;
'P' : If HasCopy Then Begin
F.RecordInsert (List.Picked);
F.Write (Copied);
MakeList;
End;
End;

View File

@ -53,6 +53,8 @@ Var
List : TAnsiMenuList;
F : TBufFile;
Prot : RecProtocol;
Copied : RecProtocol;
HasCopy : Boolean = False;
Procedure MakeList;
Var
@ -105,8 +107,7 @@ Begin
List.Close;
Case List.ExitCode of
'/' : Case GetCommandOption(11, 'I-Insert|D-Delete|') of
#27 : ;
'/' : Case GetCommandOption(10, 'I-Insert|D-Delete|C-Copy|P-Paste|') of
'I' : Begin
F.RecordInsert (List.Picked);
@ -127,6 +128,19 @@ Begin
F.RecordDelete (List.Picked);
MakeList;
End;
'C' : If List.Picked <> List.ListMax Then Begin
F.Seek (List.Picked - 1);
F.Read (Copied);
HasCopy := True;
End;
'P' : If HasCopy Then Begin
F.RecordInsert (List.Picked);
F.Write (Copied);
MakeList;
End;
End;
#13 : If List.Picked <> List.ListMax Then Begin
F.Seek (List.Picked - 1);