//Check file -- checks to be sure file is of right length!!!

//BLDR checkfile scan prepresswindow prepress util float initaltoio

get "ix.dfs"

external [
	ReadComInit
	ReadCom

	PrePressWindowInit
	WindowSetPosition
	WindowClose
	ReadIX
	FileLength
	TypeForm
	DblShift

	MCInit
	DPCop; DPAD; DPSB
	]

let foo() be [
	MCInit()

	ReadComInit()
	let str=vec 20
	let sw=vec 10
	ReadCom(str,sw)

while ReadCom(str,sw) do
	[
	let w=PrePressWindowInit(str,false)
	if w eq 0 then [ TypeForm("File does not exist",0); loop ]
	TypeForm("File: ",str,0)
	let filelen=vec 1
	FileLength(w,filelen)
	DblShift(filelen,1)
	WindowSetPosition(w,table [ 0;0 ] )

	let v=vec 40
[	ReadIX(w,v)
	if v>>IXH.Type eq IXTypeEnd then break

	let last=vec 1
	DPCop(last,lv v>>IX.sa)
	DPAD(last,lv v>>IX.len)
	DPSB(last,table [ 0;1 ] )

	if v>>IXH.Type ne IXTypeName then
	TypeForm("Last used: ",4,last,", length: ",4,filelen,1,str)

] repeat
	WindowClose(w)
	]

]