+ added example 79

This commit is contained in:
michael 1998-07-29 14:39:02 +00:00
parent e1d76d097a
commit eca58b48ce
3 changed files with 27 additions and 1 deletions

View File

@ -37,7 +37,7 @@ OBJECTS=ex1 ex2 ex3 ex4 ex5 ex6 ex7 ex8 ex9 ex10 ex11 ex12 ex13 ex14 \
ex28 ex29 ex30 ex31 ex32 ex33 ex34 ex35 ex36 ex37 ex38 ex39 ex40 \
ex41 ex42 ex43 ex44 ex45 ex46 ex47 ex48 ex49 ex50 ex51 ex52 ex53 \
ex54 ex55 ex56 ex57 ex58 ex59 ex60 ex61 ex62 ex63 ex64 ex65 ex66 \
ex67 ex68 ex69 ex70 ex71 ex72 ex73 ex74 ex75 ex76 ex77 ex78
ex67 ex68 ex69 ex70 ex71 ex72 ex73 ex74 ex75 ex76 ex77 ex78 ex79
TEXOBJECTS=$(addsuffix .tex, $(OBJECTS))

View File

@ -81,3 +81,4 @@ ex75.pp contains an example of the Write(ln) function.
ex76.pp contains an example of the FillWord function.
ex77.pp contains an example of the Rename function.
ex78.pp contains an example of the Power function.
ex79.pp contains an example of the SetJmp/LongJmp functions.

25
docs/refex/ex79.pp Normal file
View File

@ -0,0 +1,25 @@
program example79
{ Program to demonstrate the setjmp, longjmp functions }
procedure dojmp(var env : jmp_buf; value : longint);
begin
value:=2;
Writeln ('Going to jump !');
{ This will return to the setjmp call,
and return value instead of 0 }
longjmp(env,value);
end;
var env : jmp_buf;
begin
if setjmp(env)=0 then
begin
writeln ('Passed first time.');
dojmp(env,2);
end
else
writeln ('Passed second time.');
end.