File Manager

Current Path : /usr/share/doc/crm114/examples/tests/
Upload File :
Current File : //usr/share/doc/crm114/examples/tests/fataltraptest.crm

#! /usr/bin/crm
#
#	fataltraptest.crm - test trap statement

# Copyright 2009 William S. Yerazunis.
# This file is under GPLv3, as described in COPYING.

#   test the trap statement
window
output / :*:_nl: CRM114  testing FAULT\/TRAP... :*:_nl: /
output / --- you should not see an error yet --- :*:_nl:/
{
	{
		output / you should see this -->/
	}
	{
		trap /.*/
		output / BUT YOU SHOULD NOT SEE THIS /
	}
	output /<--and this, with nothing in between. :*:_nl: :*:_nl:/
}
output / --- the next thing you see SHOULD be an error "unable to read-open"--- :*:_nl:/
{
	{
		input [zoob.zipulrlfjf] (:hi:)
	}
	trap (:my_fault:) /.*/
	{
		output / Caught the error  - fault text was :*:my_fault: /
	}
}
output / --- and again, the next thing you see SHOULD be an error "unable to write-open"--- :*:_nl:/
{
	{
		output [/No/Such/Directory/frotz.mumble] (:hi:)
	}
	trap (:my_fault:) /.*/
	{
		output / Caught the error  - fault text was :*:my_fault: /
	}
}
output /:*:_nl:/

File Manager Version 1.0, Coded By Lucas
Email: hehe@yahoo.com