Difference between revisions of "BEGIN SEQUENCE"
From Lianjapedia
Helen.george (Talk | contribs) |
|||
Line 1: | Line 1: | ||
==Purpose== | ==Purpose== | ||
Start error-handling block | Start error-handling block | ||
− | |||
==Syntax== | ==Syntax== | ||
Line 13: | Line 12: | ||
END SEQUENCE | END SEQUENCE | ||
− | |||
==See Also== | ==See Also== | ||
[[ON ERROR]] | [[ON ERROR]] | ||
− | |||
==Description== | ==Description== | ||
Line 24: | Line 21: | ||
====BREAK==== | ====BREAK==== | ||
The BREAK keyword can be used whenever the program commands detect an error. For this purpose, BREAK may appear at any depth within nested procedures. When BREAK is encountered, all stacked procedures will unwind automatically. | The BREAK keyword can be used whenever the program commands detect an error. For this purpose, BREAK may appear at any depth within nested procedures. When BREAK is encountered, all stacked procedures will unwind automatically. | ||
− | |||
==Example== | ==Example== | ||
Line 50: | Line 46: | ||
endif | endif | ||
</code> | </code> | ||
− | |||
==Products== | ==Products== |
Revision as of 11:32, 12 December 2012
Purpose
Start error-handling block
Syntax
BEGIN SEQUENCE
<command>
[BREAK]
<command>
END SEQUENCE
See Also
Description
The main purpose of the BEGIN SEQUENCE ... BREAK ... END SEQUENCE construct is to allow for programmable error handling. The commands that follow the END SEQUENCE command will normally be devoted to error handling and will be executed immediately.
BREAK
The BREAK keyword can be used whenever the program commands detect an error. For this purpose, BREAK may appear at any depth within nested procedures. When BREAK is encountered, all stacked procedures will unwind automatically.
Example
error = .F. begin sequence do while not eof() if empty(name) rec = recno() error = .T. break else display name endif skip enddo end sequence if error set message to "Error: No name in record; &rec." else set message to "End of file reached." endif
Products
Lianja Server, Lianja