Giter Site home page Giter Site logo

salzkartoffeeel / tostr.ahk Goto Github PK

View Code? Open in Web Editor NEW
6.0 2.0 1.0 29 KB

An AutoHotkey function for displaying any type of value as a string, so that it can be worked with easily.

License: GNU General Public License v3.0

AutoHotkey 100.00%
tostring stringify tostr ahk autohotkey

tostr.ahk's People

Contributors

salzkartoffeeel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

timoverboard

tostr.ahk's Issues

GUI Objects need a better way of retrieving the name/title that can't fail

Currently, the algorithm used is guiObj.name || guiObj.title, which generally works. However, when guiObj.name is a string that is considered false, but not an empty string, this fails and will fall back to guiObj.title.
For example, when guiObj.title is "0", this algorithm fails and falls back, because the string is considered false.

Bound Func Objects need a way to retrieve the function name

Regular Func Objects implement a name property, which holds the name of the function they point to. Bound Func Objects, however, only implement the call() method.
This will require some low-level digging around in the source code of AHK.

Variables without values

When I reload a script that contains #include , I get the error

Warning: This variable appears to never be assigned a value.

Specifically: local varSetCapacity

	---- D:\the good stuff... 3\AutoHotKey\Lib\toStr.ahk
	087: }
	090: {
▶	091: hFile := fileObj.handle , varSetCapacity(lpszFilePath, 260 * 2 + 1) , cchFilePath := 260 * 2 , dwFlags := 0x0 , ret := dllCall("GetFinalPathNameByHandleW", "Ptr", hFile, "Str", lpszFilePath, "UInt", cchFilePath, "UInt", dwFlags)
	097: If (ret > 260 * 2)
	097: {

For more details, read the documentation for #Warn.

and

Warning: This variable appears to never be assigned a value.

Specifically: local lpszFilePath

	---- D:\the good stuff... 3\AutoHotKey\Lib\toStr.ahk
	087: }
	090: {
▶	091: hFile := fileObj.handle , varSetCapacity(lpszFilePath, 260 * 2 + 1) , cchFilePath := 260 * 2 , dwFlags := 0x0 , ret := dllCall("GetFinalPathNameByHandleW", "Ptr", hFile, "Str", lpszFilePath, "UInt", cchFilePath, "UInt", dwFlags)
	097: If (ret > 260 * 2)
	097: {

For more details, read the documentation for #Warn.

I am running v2 and forced your script to run it too with #Requires AutoHotkey v2.0. What should I change in your script to fix this?

_objIsLinear() is inefficient

The utility function _objIsLinear() could probably be made more efficient by doing some fancy business with obj.count() and other object methods.
The current function works well for small objects, but takes a bit of time for bigger ones.
It is O(n) in the worst case (not too bad), but could potentially be made O(1).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.