home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 8 / CDASC08.ISO / NEWS / 554 / JUIN / DVWRITE.PAS < prev    next >
Pascal/Delphi Source File  |  1993-10-07  |  1KB  |  43 lines

  1. {─ Fido Pascal Conference ────────────────────────────────────────────── PASCAL ─
  2. Msg  : 571 of 592
  3. From : Mike Burns                          1:153/9.0            24 Jun 93  15:09
  4. To   : Chris Portman
  5. Subj : Putting A Character Right There...
  6. ────────────────────────────────────────────────────────────────────────────────
  7.  -=> Quoting Chris Portman to All <=-
  8.  
  9.  CP> I was wondering if anyone knows how to put a character at the last
  10.  CP> row and the last column at the screen - every time I attempt that, the
  11.  CP> computer scrolls down to the next line.
  12.  
  13.  CP> Is there an assembler routine someone could write fast?
  14.  
  15.  CP> Thanks
  16.  
  17.  CP> PS - An example of a program that does that is Novell's SYSCON for its
  18.  CP> background fill.
  19.  
  20. Try this Chris;}
  21.  
  22. Procedure DVWRITE(X,Y:word;S:String;Back,Fore,BLNK:byte);
  23. Var
  24. I,I2:integer;
  25. begin
  26.    If (X>80) or (Y>25) or (X<1) or (Y<1) then Exit;
  27.    If X+Length(S)>81 then Exit;
  28.    DEC(X);
  29.    DEC(Y);
  30.    I2:=0;
  31.    For I:= 0 to Length(S)-1 do
  32.      begin
  33.        Mem[$B800: (160 * y)+(x*2)+I2]:=Ord(S[I+1]);
  34.        Mem[$B800: (160 * y)+(x*2)+I2+1]:=BLNK+(Back SHL 4)+Fore;
  35.        INC(I2,2);
  36.      end;
  37. End;
  38.  
  39. This is a direct video write, and can not scroll the screen.
  40.   Valid range X = 1..80  Y= 1..25
  41. If you like take out the DEC(X&Y) and you can use 0..79 0..24
  42.  
  43. Should do the trick for you.