summaryrefslogtreecommitdiff
path: root/ipl/packs/loadfuncpp/examples/runerr.icn
blob: 8c39c9a96317dccb972343f4892ed233c0ab809f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

link loadfuncpp

procedure main()
	x := [1,2,3]
	main2()
end

global newdisplay

procedure main2()
	newrunerr := loadfuncpp("runerr.so", "iexample", 2)
	newdisplay := loadfuncpp("runerr.so", "iexample2", 2)
#&trace := -1
	newrunerr(callme, "Hello!")
	write("We don't get here!")
end

procedure callme()
	initial {
		write("callme() called! first time!")
		return
	}
	write("callme() called for second time!")
	newdisplay(nextcall, runerr)
	#runerr(123, "callme error termination!")
	return
end

procedure nextcall()
	write("Call to nextcall")
end