* Program 	: Delete a file
* Author	: Stephen McNabb
* Creation date : 15th February 1995
* Last update	: 15th February 1995
* Parameters	: Address of filename to be deleted
* Output	: A negative value in d0 will show there was an error

start:	jsr	cls		/clear the screen
	move.l	#file,-(sp)	/move address of filename to stack
	move.w	#$41,-(sp)	/use Fdelete() function
	trap	#1		/use gemdos
	addq.l	#6,-(sp)	/tidy up stack

	cmpi.b	#0,d0		/check to see if there was an error
	blt	err		/if there is display an error message
	
	move.l	#success,d0	/else move address of success message into d0
	bra	skip		/and skip the next line
err:	move.l	#error,d0	/move address of error message into d0
skip:	jsr	ptext		/display message on screen
	
end:	bra	exit		/exit from program

	include "\SOURCE\FUNCTION.S"	/include standard functions

*** Program Data ***
	
file:	dc.b	'\TEST.S',0		/file to be deleted
success:dc.b	'File deleted',0	/success message
error:	dc.b	'Error!',0		/error message
	
*** End of file ***	