Jump to content

write a whole script to log file?


Recommended Posts

You are going to have to write something from where you want to get info from.

If you dont want to use the standard UDF then write your own debug function, and have it report from each of your script functions.

Or use @error in each function.

EDIT:

For instance

Func _MyFunc()
;.... MyCode
ConsoleWrite("Exited from _MyFunc() with error: " & @error)
Return
EndFunc
Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

In SciTE I use Tools > Trace: Add Trace Lines

It will output to the console however.

To remove: Tools > Trace: Remove ALL Trace Lines

Even better ^^^

Never even seen that, I miss so much in scite, because there is so much.

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Link to comment
Share on other sites

  • Moderators

JohnOne,

Just put #AutoIt3Wrapper_Run_Debug_Mode=Y at the top of the script - but be prepared for a very long scroll through the output pane!

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

Even better ^^^

Never even seen that, I miss so much in scite, because there is so much.

this worked great because i changed all the consolewrites to filewrite ;)

THANK YOU.

i should have stopped working on my script last night after i felt the buzz but i was so close to finishing and then at some point i couldnt figure out why it was stuck in an infinite loop only when compiled...

Link to comment
Share on other sites

JohnOne,

Just put #AutoIt3Wrapper_Run_Debug_Mode=Y at the top of the script - but be prepared for a very long scroll through the output pane!

M23

even better ^^^

Link to comment
Share on other sites

  • Moderators

supadodger,

This will copy the contents of the SciTE output pane to a file - will that do? ;)

#AutoIt3Wrapper_Run_Debug_Mode=Y

#include <GUIConstantsEx.au3>

OnAutoItExitRegister("_Copy_SciTE")

$hGUI = GUICreate("Test", 500, 500)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Func _Copy_SciTE()

    Local $hSciTE_Wnd = WinGetHandle("[CLASS:SciTEWindow]")
    $sText = ControlGetText($hSciTE_Wnd, "", "[CLASS:Scintilla; INSTANCE:2]")
    $sText = StringToBinary($sText ,2)
    $sText = BinaryToString($sText, 1)
    $sText = String($sText)

    $hFile = FileOpen(@ScriptDir & "\SciTE_Outout.txt", 2)
    FileWrite($hFile, $sText)
    FileClose($hFile)

EndFunc

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see my UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Link to comment
Share on other sites

supadodger,

This will copy the contents of the SciTE output pane to a file - will that do? ;)

#AutoIt3Wrapper_Run_Debug_Mode=Y

#include <GUIConstantsEx.au3>

OnAutoItExitRegister("_Copy_SciTE")

$hGUI = GUICreate("Test", 500, 500)

GUISetState()

While 1

    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
    EndSwitch

WEnd

Func _Copy_SciTE()

    Local $hSciTE_Wnd = WinGetHandle("[CLASS:SciTEWindow]")
    $sText = ControlGetText($hSciTE_Wnd, "", "[CLASS:Scintilla; INSTANCE:2]")
    $sText = StringToBinary($sText ,2)
    $sText = BinaryToString($sText, 1)
    $sText = String($sText)

    $hFile = FileOpen(@ScriptDir & "\SciTE_Outout.txt", 2)
    FileWrite($hFile, $sText)
    FileClose($hFile)

EndFunc

M23

i got it using the trace feature of scite and then search & replace all the consolewrites with filewrites but i will save this thread for future use...
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...