-
Notifications
You must be signed in to change notification settings - Fork 3
/
APPEND.PAS
172 lines (167 loc) · 5.84 KB
/
APPEND.PAS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
{ @author: Sylvain Maltais (support@gladir.com)
@created: 2022
@website(https://www.gladir.com/msdos0)
@abstract(Target: Turbo Pascal, Free Pascal)
}
Program _APPEND;
Uses DOS;
Var
Language:(_Albanian,_French,_English,_Germany,_Italian,_Spain);
TmpLanguage:String;
Regs:Registers;
I:Integer;
C:Char;
Function StrToUpper(S:String):String;
Var
I:Byte;
Begin
For I:=1 to Length(S)do Begin
If S[I] in['a'..'z']Then S[I]:=Chr(Ord(S[I])-32);
End;
StrToUpper:=S;
End;
BEGIN
Language:=_French;
TmpLanguage:=GetEnv('LANGUAGE');
If TmpLanguage<>''Then Begin
If TmpLanguage[1]='"'Then TmpLanguage:=Copy(TmpLanguage,2,255);
If StrToUpper(Copy(TmpLanguage,1,2))='EN'Then Language:=_English Else
If StrToUpper(Copy(TmpLanguage,1,2))='GR'Then Language:=_Germany Else
If StrToUpper(Copy(TmpLanguage,1,2))='IT'Then Language:=_Italian Else
If StrToUpper(Copy(TmpLanguage,1,2))='SP'Then Language:=_Spain Else
If(StrToUpper(Copy(TmpLanguage,1,2))='SQ')or
(StrToUpper(Copy(TmpLanguage,1,3))='ALB')Then Language:=_Albanian;
End;
If(ParamStr(1)='/?')or(ParamStr(1)='--help')or(ParamStr(1)='-h')or
(ParamStr(1)='/h')or(ParamStr(1)='/H')Then Begin
Case Language of
_Albanian:Begin
WriteLn('APPEND : Kjo komand‰ ju lejon t‰ hapni dosje t‰ vendosura n‰ repertor‰ te ',
'specifikuar sikur t‰ ishte repertori aktual.');
WriteLn;
WriteLn('Sintaksa: APPEND [/E] [/PATH:ON|OFF] [/X:ON|OFF]');
WriteLn;
WriteLn(' /E Duhet t‰ lidhni list‰n e repertor‰ve me nj‰ variab‰l t‰ ',
'quajtur "APPEND"');
WriteLn(' /PATH:OFF Mos k‰rkoni n‰ list‰n e repertor‰ve t‰ shtuara kur k‰rkoni ',
'dosje t‰ dh‰nash.');
WriteLn(' /PATH:ON Duhet t‰ k‰rkoni n‰p‰r list‰n e repertor‰ve t‰ shtuara ',
'kur k‰rkoni dosje t‰ dh‰nash.');
WriteLn(' /X:OFF Mos k‰rkoni n‰ list‰n e repertor‰ve t‰ shtuara kur ',
'ekzekutoni nj‰ program.');
WriteLn(' /X:ON Duhet t‰ k‰rkoni t‰ k‰rkoni n‰ list‰n e repertor‰ve ',
't‰ shtuara gjat‰ ekzekutimit t‰ nj‰ programi.');
End;
_Germany:Begin
WriteLn('Erm”glicht Programmen das Offnen von Datedateien in den angegebenen ');
WriteLn('Verzeichnissen, als ob sie im aktuellen Verzichnis w„ren.');
WriteLn;
WriteLn('APPEND [[Laufwerk:]Pfad[;...]] [/X[:ON|:OFF]] [/PATH:ON|/PATH:OFF] [/E]');
End;
_English:Begin
WriteLn('APPEND : Allows programs to open data files in specified ',
'directories as if they were in the current directory.');
WriteLn;
WriteLn('Syntax : APPEND [/E] [/PATH:ON|OFF] [/X:ON|OFF]');
WriteLn;
WriteLn(' /E Stores a copy of the appended directory list in an environment');
WriteLn(' variable named APPEND. /E may by used only the first time');
WriteLn(' you use APPEND after starting your system.');
WriteLn(' /PATH:ON Applies appended directories to file requests that already');
WriteLn(' specify a path. /PATH:ON is the default setting.');
WriteLn(' /PATH:OFF Turns off the effect of /PATH:ON.');
WriteLn(' /X:OFF Applies appended directories to file requests to open files.');
WriteLn(' /X:OFF is the default setting.');
WriteLn(' /X:ON Applies appended directories to file searches and');
WriteLn(' application execution.');
End;
Else Begin
WriteLn('APPEND : Cette commande permet d''ouvrir des fichiers ',
'quelques se trouvant dans les r‚pertoires sp‚cifi‚s ',
'comme s''il s''agissait du r‚pertoire courant.');
WriteLn;
WriteLn('Syntaxe : APPEND [/E] [/PATH:ON|OFF] [/X:ON|OFF]');
WriteLn;
WriteLn(' /E Il faut associ‚ la liste des r‚pertoires … une variable');
WriteLn(' d''environnement se nommant ®APPEND¯.');
WriteLn(' /PATH:OFF Il ne faut pas rechercher dans la liste des r‚pertoires');
WriteLn(' ajout‚s lors de la recherche de fichiers de donn‚es.');
WriteLn(' /PATH:ON Il faut rechercher dans la liste des r‚pertoires ajout‚s');
WriteLn(' lors de la recherche de fichiers de donn‚es.');
WriteLn(' /X:OFF Il ne faut pas rechercher dans la liste des r‚pertoires');
WriteLn(' ajout‚s lors de l''ex‚cution d''un programme.');
WriteLn(' /X:ON Il faut rechercher dans la liste des r‚pertoires ajout‚s');
WriteLn(' lors de l''ex‚cution d''un programme.');
End;
End;
End
Else
If ParamCount>0 Then Begin
For I:=1 to ParamCount do Begin
If StrToUpper(ParamStr(I))='/E'Then Begin
Regs.AX:=$B700;
Intr($2F,Regs);
Regs.AX:=$B707;
Regs.BX:=Regs.BX or (1 shl 14);
Intr($2F,Regs);
End
Else
If StrToUpper(ParamStr(I))='/PATH:OFF'Then Begin
Regs.AX:=$B700;
Intr($2F,Regs);
Regs.AX:=$B707;
Regs.BX:=Regs.BX and Not(1 shl 13);
Intr($2F,Regs);
End
Else
If StrToUpper(ParamStr(I))='/PATH:ON'Then Begin
Regs.AX:=$B700;
Intr($2F,Regs);
Regs.AX:=$B707;
Regs.BX:=Regs.BX or (1 shl 13);
Intr($2F,Regs);
End
Else
If StrToUpper(ParamStr(I))='/X:OFF'Then Begin
Regs.AX:=$B700;
Intr($2F,Regs);
Regs.AX:=$B707;
Regs.BX:=Regs.BX and Not(1 shl 15);
Intr($2F,Regs);
End
Else
If StrToUpper(ParamStr(I))='/X:ON'Then Begin
Regs.AX:=$B700;
Intr($2F,Regs);
Regs.AX:=$B707;
Regs.BX:=Regs.BX or (1 shl 15);
Intr($2F,Regs);
End
Else
Begin
WriteLn('Le paramŠtre ',ParamStr(I),' n''est pas reconnu.');
Halt;
End;
End;
End
Else
Begin
Regs.AX:=$B704;
Intr($2F,Regs);
If(Regs.ES=0)and(Regs.DI=0)Then Begin
WriteLn('Aucun chemin de recherche pour APPEND');
End
Else
Begin
{$IFNDEF FPC}
I:=0;
Repeat
C:=Char(Mem[Regs.ES:Regs.DI+I]);
Write(C);
Inc(I);
Until C=#0;
{$ENDIF}
WriteLn;
End;
End;
END.