home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Hack-Phreak Scene Programs
/
cleanhpvac.zip
/
cleanhpvac
/
GFXFX2.ZIP
/
UNITINT.ZIP
/
U_MISC.INT
< prev
next >
Wrap
Text File
|
1995-02-14
|
4KB
|
186 lines
(*
** General purpose unit. Formaly named 'BCRT' from Bas-CRT.
** Made by Bas van Gaalen
*)
{$v-}
unit u_misc;
interface
uses dos,u_txt,u_kb;
const
pos_hi=1; pos_lo=2; pos_le=4; pos_mi=8; pos_ri=16;
menuitems:byte=1;
crsrins = 20992;
crsrup = 18432;
crsrdown = 20480;
crsrleft = 19200;
crsrright = 19712;
crsrhome = 18176;
crsrend = 20224;
crsrpgup = 18688;
crsrpgdn = 20736;
crsresc = 27;
crsrcr = 13;
crsrtab = 9;
crsrbs = 8;
crsrstab = 3840;
crsrchome = 30464;
crsrcend = 29952;
crsrdel = 21248;
crsrf1 = 15104;
crsrf2 = 15360;
crsrf3 = 15616;
crsrf4 = 15872;
crsrf5 = 16128;
crsrf6 = 16384;
crsrf7 = 16640;
crsrf8 = 16896;
crsrf9 = 17152;
crsrf10 = 17408;
crsr0 = 48;
crsr1 = 49;
crsr2 = 50;
crsr3 = 51;
crsr4 = 52;
crsr5 = 53;
crsr6 = 54;
crsr7 = 55;
crsr8 = 56;
crsr9 = 57;
type
str80=string[80];
casetype=(efirst,ofirst,all,nocap);
charset=set of char;
menutype=array[1..20,1..2] of str80;
inputbtype=record
destructive,
persistant,
initinsert,
updownescape:boolean; { updownescape not implemented yet }
end;
var
inputbehave:inputbtype;
{----------------------------------------------------------------------------}
procedure fillx( { write string and fill out to xlen }
targetstr:string;
fillcharac:char;
xposition,
yposition,
xlen,
strcolour:byte);
procedure nwindow( { draw window }
xi,yi,xf,yf:byte;
title:str80;
titlepos,
titleattr,
boxattr,
shadowattr:byte);
function input( { Enhanced input routine }
xi,yi:byte;
var editline:str80;
allowed:charset;
maxlen,
color,
endcolor:byte;
uppcase:casetype;
endpos:byte):word;
procedure ansiwrite( { Display ansi file }
var addr1,addr2;
blklen:integer);
function dncase( { downcase }
c:char):char;
function strup(const { convert string to uppercase }
source:string):string;
function strdn(const { convert string to downcase }
source:string):string;
function epos( { Enhanced 'pos'-command }
const str:string;
ch:charset;
xst:byte):byte;
function rpos( { reversed enhanced pos }
schars:charset;
sstr:string):byte;
procedure scrollbar( { display vertical scrollbar }
xi,
yi:byte;
curpos,
scrlen,
nofitems:word;
colattr:byte);
function menubar( { 'tagbar' a-la GEcho and compatibles }
mx,
my,
cx,
cy,
by,
ma,
ca,
ba,
barwi,
items:byte;
menu:menutype):byte;
function askyesno:boolean;
function lz( { leading zero's }
w:word;
maxlen:byte):string;
function equal( { compare two structures }
var struc1,struc2;
size:word):boolean;
function bitson( { check if bits in byte are set }
testbyte,bitsnr:byte):boolean;
procedure trim( { trim chars from string }
var data:string;
check:char);
function forceslash( { add back-slash, if none present }
data:pathstr):string;
function noslash( { delete back-slash, if present }
data:pathstr):string;
procedure timerbar( { 'percent-done' bar }
xi,
yi,
len,
setcol,
notsetcol:byte;
curnum,
maxnum:word);
function dotted( { add dots at thousand-intervals }
var s:string):string;
function hexbyte( { convert byte-value to hexadecimal }
v:byte):string;
function hexword( { convert word-value to hexadecimal }
v:word):string;
implementation