home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C!T ROM 2
/
ctrom_ii_b.zip
/
ctrom_ii_b
/
PROGRAM
/
PASCAL
/
PARADIS1
/
CHGENV1.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1992-04-08
|
2KB
|
76 lines
(4692) Sat 4 Apr 92 12:57
By: Joseph Crea
To: Gavin Campbell
Re: Shell/prompt (2 of 3)
St:
---------------------------------------------------------------------------
@EID:f3b4 18846720
@PID: QE 2.75
{$A+,B-,D+,E+,F-,I+,L+,N-,O-,R-,S+,V+}
{$M 16384,0,65536}
uses dos;
PROCEDURE BUILD_ENV_BLOCK(var env_block ;
env_var, env_str : string);
var
max_block : array[1..32*1024] of char absolute env_block;
temp_str : string;
index, j, k : word;
begin
index := 1;
for j := 1 to envcount do
begin
temp_str := envstr(j);
if (pos(env_var, temp_str) <> 0) then (*env variable found*)
temp_str := env_var + '=' + env_str;
for k := 1 to length(temp_str) do
begin
max_block[index] := temp_str[k];
inc(index);
end;
max_block[index] := chr(0);
inc(index);
end;
max_block[index] := chr(0);
inc(index);
memw[ seg( max_block[index]) : ofs(max_block[index]) ] := 1;
inc(index, 2);
temp_str := paramstr(0);
for j := 1 to length(temp_str) do
begin
max_block[index] := temp_str[j];
inc(index);
end;
max_block[index] := chr(0);
end; (* of procedure build_env *)
PROCEDURE NEW_ENV( var new_env_block );
begin
MEMW[ PrefixSeg : $002C ] := seg(new_env_block);
end; (* of procedure new_env *)
PROCEDURE NORMALIZE ( var untyped );
var
old_pointer : pointer absolute untyped;
segment, offset : word;
begin
segment := seg(old_pointer^);
offset := ofs(old_pointer^);
segment := segment + offset div 16;
offset := offset mod 16;
old_pointer := ptr(segment, offset);
end; (* of PROCEDURE normalize *)
.
--- QuickBBS 2.76 (Gamma-1)
* Origin: 221B Baker Street * Panama City FL * 904-871-6536 (1:3608/3)
@PATH: 3608/1 123/19 396/1 13/13 1/217 105/27 42 500/1 9 512/0
@PATH: 512/1007