home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
DP Tool Club 8
/
CDASC08.ISO
/
NEWS
/
554
/
JUIN
/
DVWRITE.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1993-10-07
|
1KB
|
43 lines
{─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
Msg : 571 of 592
From : Mike Burns 1:153/9.0 24 Jun 93 15:09
To : Chris Portman
Subj : Putting A Character Right There...
────────────────────────────────────────────────────────────────────────────────
-=> Quoting Chris Portman to All <=-
CP> I was wondering if anyone knows how to put a character at the last
CP> row and the last column at the screen - every time I attempt that, the
CP> computer scrolls down to the next line.
CP> Is there an assembler routine someone could write fast?
CP> Thanks
CP> PS - An example of a program that does that is Novell's SYSCON for its
CP> background fill.
Try this Chris;}
Procedure DVWRITE(X,Y:word;S:String;Back,Fore,BLNK:byte);
Var
I,I2:integer;
begin
If (X>80) or (Y>25) or (X<1) or (Y<1) then Exit;
If X+Length(S)>81 then Exit;
DEC(X);
DEC(Y);
I2:=0;
For I:= 0 to Length(S)-1 do
begin
Mem[$B800: (160 * y)+(x*2)+I2]:=Ord(S[I+1]);
Mem[$B800: (160 * y)+(x*2)+I2+1]:=BLNK+(Back SHL 4)+Fore;
INC(I2,2);
end;
End;
This is a direct video write, and can not scroll the screen.
Valid range X = 1..80 Y= 1..25
If you like take out the DEC(X&Y) and you can use 0..79 0..24
Should do the trick for you.