17.05.2015 Views

Pascal News

Pascal News

Pascal News

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

8-Sep-Sl<br />

1:<br />

2:<br />

Yet Another Extension<br />

Function Locate(var parent,search:File) :Integer;<br />

~ Pr~-assertions: parent.M=Directj parent.Pos is starting point. }<br />

~ Post-assertions: parent.Pos=Locate+length(search) ,<br />

t Locate is assigned the parent sequence number of the first elef!tent<br />

of search (starting the search from the input va!ue of<br />

parent.Pos).. If the search file cannot be found in parent, Lcca~::;'?<br />

is returned as length(parent}. This defini~ion avoids S9€cia:­<br />

case handling both within Locate and in the calling (;OCC. Conpare<br />

this simplicity to the definition and use of DEC's BASIC ins':"/pos<br />

function! }<br />

label 1,2;<br />

var 10calroot:Integer;<br />

begin<br />

localroot:=pos(parent) ;<br />

while localroot

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

Saved successfully!

Ooh no, something went wrong!