.


IP- "". - 16 .

on-line?
? ?
Ru.Board » » » AutoIT ( 2)

: gyra, Maz

Widok (01-06-2010 13:08): . .    •

     

ViSiToR



Silver Member
| | | ICQ | |

:
--------------------------------------------------------------------------------
-- DebugMsgBoxAdd()
--
-- Add debug MsgBox to the selected text (original by Jos van der Zande).
--
-- Tool: AutoItTools.DebugMsgBoxAdd $(au3) savebefore:no,groupundo:yes Alt+D Debug: Add MsgBox
--------------------------------------------------------------------------------
function AutoItTools:DebugMsgBoxAdd()
local word = self:GetWord2()
if word == "" then
print("Cursor not on any text.")
return
end
local word2 = word:gsub("'", "''")     -- replace quote by 2 quotes
local line = editor:LineFromPosition(editor.CurrentPos) + 1
editor:LineEnd()
editor:NewLine()
--~ editor:AddText("MsgBox(262144,'debug line ~" .. line .. "' , \'" .. word2 .. "\:' & @CRLF & " .. word .. ") ;### Debug MSGBOX" )
local option = tonumber(props['debug.msgbox.option'])
if option == 2 then
editor:AddText("SetError(@Error, @Extended, MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @LF & \'" .. word2 .. "\' & @LF & @LF & 'Return:' & @LF & " .. word .. " & @LF & @LF & '@Error:' & @LF & @Error & @LF & @LF & '@Extended:' & @lf & @Extended)) ;### Debug MSGBOX" )
elseif option == 1 then
editor:AddText("SetError(@Error, @Extended, MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @LF & \'" .. word2 .. "\' & @LF & @LF & 'Return:' & @LF & " .. word .. " & @LF & @LF & '@Error:' & @LF & @Error)) ;### Debug MSGBOX" )
elseif option == 0 then
editor:AddText("SetError(@Error, @Extended, MsgBox(262144,'Debug line ~' & @ScriptLineNumber,'Selection:' & @LF & \'" .. word2 .. "\' & @LF & @LF & 'Return:' & @LF & " .. word .. ")) ;### Debug MSGBOX" )
elseif option == -1 then
editor:AddText("SetError(@Error, @Extended, MsgBox(262144,'debug line ~' & @ScriptLineNumber, \'" .. word2 .. "\:' & @LF & " .. word .. ")) ;### Debug MSGBOX" )
end
editor:LineDown()
editor:Home()
end-- DebugMsgBoxAdd()
 
--------------------------------------------------------------------------------
-- DebugConsoleWriteAdd()
--
-- Add debug ConsoleWrite to the selected text (original by Jos van der Zande).
--
-- Tool: AutoItTools.DebugConsoleWriteAdd $(au3) savebefore:no,groupundo:yes Ctrl+D Debug: Add ConsoleWrite
--------------------------------------------------------------------------------
function AutoItTools:DebugConsoleWriteAdd()
local word = self:GetWord2()
if word == "" then
print("Cursor not on any text.")
return
end
local word2 = word:gsub("'", "''")     -- replace quote by 2 quotes
local line = editor:LineFromPosition(editor.CurrentPos) + 1
editor:LineEnd()
editor:NewLine()
--~ editor:AddText("ConsoleWrite('@@ (" .. line .. ") :(' & @min & ':' & @sec & ') " .. word2 .. " = ' & " .. word .. " & @CRLF) ;### Debug Console")
local option = tonumber(props['debug.console.option'])
if option == 3 then
editor:AddText("SetError(@Error, @Extended, ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : " .. word2 .. " = ' & " .. word .. " & @CRLF & '>Error code: ' & @Error & '    Extended code: ' & @Extended & '    SystemTime: ' & @HOUR & ':' & @MIN & ':' & @SEC & @CRLF)) ;### Debug Console" )
elseif option == 2 then
editor:AddText("SetError(@Error, @Extended, ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : " .. word2 .. " = ' & " .. word .. " & @CRLF & '>Error code: ' & @Error & '    Extended code: ' & @Extended & @CRLF)) ;### Debug Console" )
elseif option == 1 then
editor:AddText("SetError(@Error, @Extended, ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : " .. word2 .. " = ' & " .. word .. " & @CRLF & '>Error code: ' & @Error & @CRLF)) ;### Debug Console" )
elseif option == 0 then
editor:AddText("SetError(@Error, @Extended, ConsoleWrite('@@ Debug(' & @ScriptLineNumber & ') : " .. word2 .. " = ' & " .. word .. " & @CRLF)) ;### Debug Console" )
elseif option == -1 then
editor:AddText("SetError(@Error, @Extended, ConsoleWrite('@@ (' & @ScriptLineNumber & ') :(' & @MIN & ':' & @SEC & ') " .. word2 .. " = ' & " .. word .. " & @CRLF)) ;### Debug Console" )
end
editor:LineDown()
editor:Home()
end-- DebugConsoleWriteAdd()

: 3251 | . 01-04-2006 | : 22:40 29-05-2010 | : ViSiToR, 23:03 29-05-2010
     


Ru.Board » » » AutoIT ( 2)
Widok (01-06-2010 13:08): . .


Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.Board
© Ru.Board 2000-2017

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

.ru