2020-03-01 01:59:50 +00:00
|
|
|
//$BK,1$WARNING:$BK,0$ Don't return out of a catch{}. This
|
2020-02-15 20:01:48 +00:00
|
|
|
//might get fixed.
|
|
|
|
|
Rename abs_addres to abs_address.
Update documentation/comments to rename addr, fun, var, stmt, blk, desc, reg, seg, ptr, dup, clus, val, and bttn, to address, function, variable, statement, block, description, register, segment, pointer, duplicate, cluster, value, and button, respectively.
2021-10-07 02:35:32 +01:00
|
|
|
//You can use $LK,"PutExcept",A="MN:PutExcept"$() in a catch statement
|
2020-02-15 20:01:48 +00:00
|
|
|
//and it will report args.
|
|
|
|
Bool Prompt(I64 i)
|
|
|
|
{
|
2020-12-23 23:27:18 +00:00
|
|
|
"%d ", i;
|
2020-02-20 23:40:10 +00:00
|
|
|
return YorN;
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
U0 D1()
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
"D1\n";
|
2020-12-23 23:27:18 +00:00
|
|
|
if (Prompt(1))
|
|
|
|
throw('Point1');
|
|
|
|
if (Prompt(2))
|
|
|
|
throw('Point2');
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
U0 D2()
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
"D2\n";
|
2020-12-23 23:27:18 +00:00
|
|
|
try
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
D1;
|
2020-12-23 23:27:18 +00:00
|
|
|
if (Prompt(4))
|
|
|
|
throw('Point4');
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
"D2 handler\n"
|
2020-12-23 23:27:18 +00:00
|
|
|
"Ch:%c:%P\n", Fs->except_ch, Fs->except_callers[0];
|
|
|
|
if (Fs->except_ch == 'Point1')
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
"Caught in D2\n";
|
2020-12-23 23:27:18 +00:00
|
|
|
Fs->catch_except = TRUE;
|
2020-02-20 23:40:10 +00:00
|
|
|
}
|
|
|
|
}
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
U0 Demo()
|
|
|
|
{
|
2020-12-23 23:27:18 +00:00
|
|
|
try
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
D2;
|
2020-12-23 23:27:18 +00:00
|
|
|
if (Prompt(3))
|
|
|
|
throw('Point3');
|
|
|
|
}
|
|
|
|
catch
|
|
|
|
{
|
2020-02-20 23:40:10 +00:00
|
|
|
"Demo handler\n"
|
2020-12-23 23:27:18 +00:00
|
|
|
"Ch:%c:%P\n", Fs->except_ch, Fs->except_callers[0];
|
|
|
|
Fs->catch_except = TRUE;
|
2020-02-20 23:40:10 +00:00
|
|
|
}
|
2020-02-15 20:01:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Demo;
|