Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

dmp()


  • Please log in to reply
8 replies to this topic
ObiWanKenobi
  • Members
  • 83 posts
  • Last active: Oct 17 2015 05:37 PM
  • Joined: 21 Aug 2012

dmp 1.24 - Advanced debug function for AutoHotKey

I wrote this debug function for AutoHotKey to have a better handling with my AutoHotKey debugging workflow.

It depends on AutoHotKey_L.

Usage: dmp(yourVar, yourVar2)

Result:

dmp.png

Features:

  • multidimensioal arrays are displayed serialized
  • dumped lines can be copied & directly pasted in your AutoHotKey script
  • ability to cancel dmp-loop (via Button Cancel or via ESC-Key)
  • continue dmp-loop via Button Continue or via Enter-Key

 

How to install:

In your main script directory create a folder \lib and place dmp.ahk there.

Example:

C:\myscript\lib\dmp.ahk

 

After you have finished this you can use dmp() anywhere in your script.

 

Download: dmp.ahk

Homepage: http://guresicpark.de/autohotkey/dmp

 

 

Happy dmping.



ObiWanKenobi
  • Members
  • 83 posts
  • Last active: Oct 17 2015 05:37 PM
  • Joined: 21 Aug 2012

dmp 1.1

New Version out!

 

How to install:

In your main script directory create a folder \lib and place dmp.ahk there. Example:

C:\myscript\lib\dmp.ahk

 

After that you can use function dmp() anywhere in your script.

 

Example code:

car1 := {model: "Toyota", color:"red", speed:100}
car2 := {model: "Chrysler", color:"white", speed:200}
car3 := {model: "BMW", color:"Black", speed:180}

driver1 := {name: "Peter", age:"31", salary:1800, car:car3}
driver2 := {name: "Jeff", age:"38", salary:2200, car:car1}
driver3 := {name: "Jim", age:"40", salary:1950, car:nil}
driver4 := {name: "Frank", age:"22", salary:1650, car:car2}

drivers := [driver1, driver2, driver3, driver4]

for deltaDriver, driverItem in drivers
{
    dmp(driverItem)
}

dmp(drivers)

Download: dmp.ahk



egocarib
  • Members
  • 42 posts
  • Last active: Aug 12 2017 10:04 PM
  • Joined: 17 Apr 2015

Thanks! Was just looking for something like this.



ObiWanKenobi
  • Members
  • 83 posts
  • Last active: Oct 17 2015 05:37 PM
  • Joined: 21 Aug 2012

dmp 1.2

 

- bugfixes

- output improved

- new feature: now you can output multiple variables with one dmp call, example:

aNames := ["Jeff", "Peter", "Jim"]
sText := " Lorem ipusm "

dmp(aNames, sText, Trim(sText))

Result:

dmp2.png

 

Download: dmp.ahk

Homepage: http://guresicpark.de/autohotkey/dmp



ObiWanKenobi
  • Members
  • 83 posts
  • Last active: Oct 17 2015 05:37 PM
  • Joined: 21 Aug 2012

@egocarib, you are welcome ;)



ObiWanKenobi
  • Members
  • 83 posts
  • Last active: Oct 17 2015 05:37 PM
  • Joined: 21 Aug 2012

dmp 1.21

 

- nicer output

- performance tweaks

- small code clean up

 

Download: dmp.ahk

Homepage: http://guresicpark.de/autohotkey/dmp



ObiWanKenobi
  • Members
  • 83 posts
  • Last active: Oct 17 2015 05:37 PM
  • Joined: 21 Aug 2012

dmp 1.22

- bugfix

 

Download: dmp.ahk

Homepage: http://guresicpark.de/autohotkey/dmp



ObiWanKenobi
  • Members
  • 83 posts
  • Last active: Oct 17 2015 05:37 PM
  • Joined: 21 Aug 2012

dmp 1.23

- code cleanup

- New feature: alphabetically sorted output, example:

>>>>> drivers

drivers[1]["age"] := "31"
drivers[1]["car"]["color"] := "Black"
drivers[1]["car"]["model"] := "BMW"
drivers[1]["car"]["speed"] := 180
drivers[1]["name"] := "Peter"
drivers[1]["salary"] := 1800

6 elements for drivers <<<<<

Download: dmp.ahk

Homepage: http://guresicpark.de/autohotkey/dmp



ObiWanKenobi
  • Members
  • 83 posts
  • Last active: Oct 17 2015 05:37 PM
  • Joined: 21 Aug 2012

dmp 1.25

- window is now resizeable

- added button "Reload scirpt" for restarting debugged script after modifying script file

 

Download: dmp.ahk

Homepage: http://guresicpark.de/autohotkey/dmp