03.06.2013 Views

Turbo Prolog

Turbo Prolog

Turbo Prolog

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

clauses<br />

dosver(VERSION):­<br />

AX=L;8*256,<br />

bios(33,reg(AX,O,O,O,O,O,O,O),reg(VV,_,_,_,_,_,_,_)),<br />

1* you could use hex notation, bios($21 ... )<br />

instead of bios(33 ... ) *1<br />

L=VV/256, H=VV-256*L, VERSION=H+L/100.<br />

diskspace(DISK,TOTALSPACE,FREESPACE):-<br />

AAX=5L;*256,<br />

bios(33,reg(AAX,O,O,DISK,O,O,O,O),<br />

reg(AX,BX,CX,DX,_,_,_,_)),<br />

FREESPACE=1.0*BX*CX*AX, TOTALSPACE=1.0*DX*CX*AX.<br />

makedir(NAME):ptr_dword(NAME,DS,DX),<br />

AX=256*57,<br />

bios(33,reg(AX,O,O,DX,O,O,DS,O),_).<br />

removedir(NAME):ptr_dword(NAME,DS,DX),AX=256*58,<br />

bios(33,reg(AX,O,O,DX,O,O,DS,O),_).<br />

ACCESSING THE EDITOR<br />

FROM WITHIN A TURBO PROLOG PROGRAM<br />

The following predicates are used to call the <strong>Turbo</strong> <strong>Prolog</strong> editor.<br />

edit(InStringParam,OutStringParam)<br />

The <strong>Turbo</strong> <strong>Prolog</strong> editor is invoked in the active window. All the usual editor facilities<br />

are now available. (The operation of the editor is described in Chapters 2 and 12.) The<br />

editor will be used on the text given in InStringParam, and OutStringParam will receive<br />

the edited result. Thus, the following call could be used to start editing an empty screen:<br />

edit (1111, Text) .<br />

display( String)<br />

The <strong>Turbo</strong> <strong>Prolog</strong> editor is invoked in the active window. The text in String can be<br />

examined under editor control but cannot be altered (and therefore only a subset of<br />

the editor's facilities are available in "display" mode).<br />

editmsg(InString, OutString, LeftHeader, RightHeader,<br />

Message,Position, HelpFileName, Code)<br />

The <strong>Turbo</strong> <strong>Prolog</strong> editor is called, and InString can then be edited in the currently active<br />

window to form OutString. Two texts are inserted in the header given by LeftHeader<br />

and RightHeader. The cursor is located at the Position-th character in InString and the<br />

Programmer's Guide 161

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!