I have reviewed the ZLINK documentation here:
https://docs.yottadb.com/ProgrammersGuide/commands.html#zlink
I would like to ZLINK a routine at runtime, and be aware if the compilation and linking generated any errors.
For example, I created a routine named TEST2, with the following erroneous code:
CHKERR2
SET X=
QUIT
And then I made another routine, TEST, with the following code.
CHKERR
DO
. NEW $ETRAP
. SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
. ZLINK "TMGTEST2"
QUIT
CHKMATHERR
DO
. NEW $ETRAP
. SET $ETRAP="write ""Error Trapped: "",$ECODE,! set $ETRAP="""",$ECODE="""""
. WRITE 1/0
QUIT
When I run this code, I can trap a divide by 0 error, but not a ZLINK error
yottadb>ZL "TMGTEST"
yottadb>do CHKERR^TMGTEST
SET X=
^-----
At column 9, line 1006, source module /opt/worldvista/EHR/p/TMGTEST2.m
%YDB-E-EXPR, Expression expected but not found
yottadb>do CHKMATHERR^TMGTEST
Error Trapped: ,M9,Z150373210,
Question:
Is there a way to trap a zlink error (in this case, a "%YDB-E-EXPR, Expression expected but not found")?
Thanks
Kevin