check

Help Contents Control Structures check
yield profile

check instructionlist value (library procedure)


command which runs the instructionlist and compares the result output by the run with value. Itīs good for consistency checking of operations.

Example:

to checkplists
	local [ok]
	ok=true
	putProperty "opposite_of "yes "no
	pProp "opposite_of "black "white
	pprop "opposite_of "up "down
	check [getProperty "opposite_of "black]  "white
	check [plist "opposite_of]  [up down black white yes no]
	
	removeProperty "opposite_of "black
	check [plist "opposite_of]  [up down yes no]
	
	remProp "opposite_of "yes
	check [plist "opposite_of]  [up down]
	
	pprop "greetings "english "hello
	pprop "greetings "german "hallo
	check [plist "greetings]  [german hallo english hello]
	check [plists]  [[] [] [greetings opposite_of]]
	
	remProp "opposite_of "up
	check [plist "opposite_of]  []
	check [plists]  [[][][greetings]]
	
	type [\; The Property List functions\ ]
	ifelse not :ok
	[	pr [ARE NOT CORRECT!]
	][	pr [look OK.]
	]
	output :ok
end

References:

yield profile