Don't debug lines with %n

If reporting a bug with the Zeus IDE please post the details here. Please do not post questions here.
Post Reply
E Programmer
Posts: 38
Joined: Thu Apr 07, 2005 7:07 pm

Don't debug lines with %n

Post by E Programmer »

Jessie

I have associated this macro with my ~ key.

Lua Macro:

Code: Select all

function key_macro()
  local data_line=get_line_text()
  debug_output("line"..data_line)
end

key_macro()
When I select this line from a file:
Data%n

Zeus crashes (I lose unsaved work).

If the line is
Data%m
it's ok. It seems to be the characters '%n' that does it.
It does not crash if I don't have the debug_output in the file. So once my files are working, everything is fine after I remove all the debug_output lines. So this is a NON-CRITICAL bug. More of an FYI

I'm using Zeus 3.97-beta25
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

The bad news is I can confirm this is a bug and a very serious one at that :(

The good news is I can replicate the error so it should be fixed shortly ;)

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

This bug has been identified. The issue is the %n pattern is being identified as a format character.

The short term fix is to write the macro as follows:

Code: Select all

function key_macro()
  local data_line=get_line_text()

  -- %n is picked up as a format character so de-format it when found
  if (string.find(data_line, "%%n", 1, false) ~= nil) then
    data_line = string.gsub(data_line, "%n", "%%n")
    --message_box(1, data_line, "Testing")
  end
  debug_output("line"..data_line)
end

key_macro()
Shortly, there will be a new beta version released that also fixes this issue.

Cheers Jussi
jussij
Site Admin
Posts: 2650
Joined: Fri Aug 13, 2004 5:10 pm

Post by jussij »

This issue should now be fixed in the beta version found here:

http://www.zeusedit.com/z300/ze397h-beta.zip

Cheers Jussi
Post Reply