YAPC::EU 2018 Glasgow Update!
This commit is contained in:
parent
22f33d4004
commit
4e2d22a71d
1170 changed files with 15042 additions and 3047 deletions
|
|
@ -1,22 +1,23 @@
|
|||
/*REXX program demonstrates detects and handles division by zero. */
|
||||
|
||||
signal on syntax /*handle all REXX syntax errors. */
|
||||
x = sourceline() /*being cute, x=size of this pgm.*/
|
||||
y = x-x /*setting to zero the obtuse way.*/
|
||||
z = x/y /*this'll do it, furrrr shurrre. */
|
||||
exit /*We're kaput. Ja vohl ! */
|
||||
|
||||
/*───────────────────────────────error handling subroutines and others.─*/
|
||||
err: if rc==42 then do; say; say /*1st, check for a specific error*/
|
||||
say center(' division by zero is a no-no. ',79,'═')
|
||||
say; say
|
||||
exit 130
|
||||
end
|
||||
|
||||
say; say; say center(' error! ',max(40,linesize()%2),"*"); say
|
||||
do j=1 for arg(); say arg(j); say; end; say;
|
||||
exit 13
|
||||
|
||||
novalue: syntax: call err 'REXX program' condition('C') "error",,
|
||||
condition('D'),'REXX source statement (line' sigl"):",,
|
||||
sourceline(sigl)
|
||||
/*REXX program demonstrates detection and handling division by zero. */
|
||||
signal on syntax /*handle all REXX syntax errors. */
|
||||
x = sourceline() /*being cute, x=is the size of this pgm*/
|
||||
y = x - x /*setting to zero the obtuse way. */
|
||||
z = x / y /*this'll trigger it, furrrr shurrre. */
|
||||
exit /*We're kaput. Ja vohl ! */
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
err: if rc==42 then do; say /*first, check for a specific error. */
|
||||
say center(' ***error*** ', 79, "═")
|
||||
say 'Division by zero detected at line ' @ ,
|
||||
" and the REXX statement is:"
|
||||
say sourceLine(@)
|
||||
say
|
||||
exit 42
|
||||
end
|
||||
say
|
||||
say center(' error! ', 79, "*")
|
||||
do #=1 for arg(); say; say arg(#); say
|
||||
end /*#*/
|
||||
exit 13
|
||||
/*──────────────────────────────────────────────────────────────────────────────────────*/
|
||||
syntax: @=sigl; call err 'REXX program' condition("C") 'error', condition('D'), ,
|
||||
'REXX source statement (line' sigl"):", sourceLine(sigl)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue