Is this a bug? ZBREAK Trace option does not appear to handle comma-separated SET command
I came across this behaviour when debugging some Cache ObjectScript code. I have provided a simple example below.
Example 1:
START ZBREAK /TRACE:ON:"C:/temp/zbreak_trace.log" ZBREAK *VAR1:"T" ZBREAK *VAR2:"T" ZBREAK *VAR3:"T" Set (VAR1,VAR2,VAR3)="" Kill VAR1,VAR2,VAR3 Quit
Trace Output:
Trace: ZBREAK SET VAR3="" at START+5^TRACE Trace: ZBREAK KILL VAR1 at START+6^TRACE Trace: ZBREAK KILL VAR2 at START+6^TRACE Trace: ZBREAK KILL VAR3 at START+6^TRACE
$ZV value:
Cache for Windows (x86-32) 2017.1 (Build 792) Mon Mar 20 2017 20:20:07 EDT
Notice that the SET statement in the log file only refers to VAR3 - the last variable that was initialised to empty string. Here are a couple of ways to mitigate this issue.
- Do not use the ZBREAK Trace option. Use watchpoints in your preferred IDE.
- Write all SET statements in long-hand format. Avoid the round-brackets comma syntax.
Example 2:
START ZBREAK /TRACE:ON:"C:/temp/zbreak_trace.log" ZBREAK *VAR1:"T" ZBREAK *VAR2:"T" ZBREAK *VAR3:"T" Set VAR1="" Set VAR2="" Set VAR3="" Kill VAR1,VAR2,VAR3 Quit
Trace Output:
Trace: ZBREAK SET VAR1="" at START+5^TRACE Trace: ZBREAK SET VAR2="" at START+6^TRACE Trace: ZBREAK SET VAR3="" at START+7^TRACE Trace: ZBREAK KILL VAR1 at START+8^TRACE Trace: ZBREAK KILL VAR2 at START+8^TRACE Trace: ZBREAK KILL VAR3 at START+8^TRACE
Notice that the SET statements now feature all three variables as expected.