Search found 91 matches

by [Shambles]
16 Nov 2018, 06:13
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

I never said that I do not see the same problems - in fact I have repeated this argument over and over again. However there is no hope for v1. In order to check the amount of parameters on any method that any AHK Object provides we may have to remove meta-functions. I can understand how meta-functi...
by [Shambles]
16 Nov 2018, 01:55
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

iseahound and I seem to mostly agree. Although the notion of a default base object might seem strange to some people, it is not really that deviant. Most object-oriented programming languages use a single inheritance model where there is one class or object at the root of the type hierarchy. If the...
by [Shambles]
15 Nov 2018, 21:57
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

Function objects often do have a base object. Function objects are all objects returned by Func() . All other objects implement the "Callable" interface. They are therefore callables not function objects. Function objects don't have a base object they have a function that handles all acceses. so th...
by [Shambles]
15 Nov 2018, 09:07
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

Like we said before not all objects have a base object. ObjGetBase only applies to objects that can have a base object. Function Objects do not have a base object. Creating consistency for those old objects just isn't possible in v1. Most of your concerns are adressed in v2 to some extend. Im not s...
by [Shambles]
15 Nov 2018, 06:33
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: Regression In ObjGetBase(Object) and ObjSetBase(Object, BaseObject)

If you pay any attention at all, you'd notice that ObjSetGetBase isn't documented for Func objects. You could tell from the documentation and from me telling you, now twice. Good luck. I am very much paying attention. One AutoHotkey function, IsObject(Value) , says that function objects are objects...
by [Shambles]
15 Nov 2018, 06:05
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: Regression In ObjGetBase(Object) and ObjSetBase(Object, BaseObject)

I downloaded 1.1.29.00, it throws too. I have not tried previous versions with my old code and today's input, but I do know that my code worked until today. It is possible that something is different about the input I used today. The code that threw today detects the type of a function object to en...
by [Shambles]
15 Nov 2018, 05:51
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: Regression In ObjGetBase(Object) and ObjSetBase(Object, BaseObject)

I myself know of this problem and have argumented against it for quite a while. But like I said there is no method for doing what you need to do. Even if you need to do it - whats impossible is impossible. AHK is not a language suited for development at all. v2 fixes this by adding a type function....
by [Shambles]
15 Nov 2018, 04:22
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: Regression In ObjGetBase(Object) and ObjSetBase(Object, BaseObject)

Helgef wrote:
15 Nov 2018, 04:18
This is about knowing whether a type can be made to work with an operation at all, and how.
v1,

Code: Select all

can_set_base(value){
	return objgetcapacity(value) != ""
}
:cry:

Cheers.
That is not what my code does or needs to do.
by [Shambles]
15 Nov 2018, 04:21
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: Regression In ObjGetBase(Object) and ObjSetBase(Object, BaseObject)

ObjGetBase(Object) and ObjSetBase(Object, BaseObject) used to return an empty string when they failed. When? An exception is thrown if Object is of an incorrect type. src: ObjGetBase It is clearly documented behaviour. The code above confirms that the function object Func("Hello") is indeed an obje...
by [Shambles]
15 Nov 2018, 04:09
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

Re: Regression In ObjGetBase(Object) and ObjSetBase(Object, BaseObject)

ObjGetBase should not be used for type detection. In AHK v1 there is no method for type detection. You can use a workaround which reads an entry in the data structure of any object to identify the type of an object. However that relies on undocumented features. Anyways there is no chance to use Obj...
by [Shambles]
14 Nov 2018, 20:57
Forum: Wish List
Topic: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change
Replies: 57
Views: 9895

ObjGetBase(Object) and ObjSetBase(Object, BaseObject) Need to Change

The Short Version: ObjGetBase(Object) and ObjSetBase(Object, BaseObject) used to return an empty string when they failed. The Long Version: class AClass { Hello() { MsgBox % "Hello World!" } } "".base.base := AClass "".Hello() ObjGetBase("") The code above successfully sets the base object of the d...
by [Shambles]
02 Oct 2017, 03:24
Forum: Tutorials
Topic: Writing Command-Line Programs in AutoHotkey
Replies: 5
Views: 4848

Re: Writing Command-Line Programs in AutoHotkey

nnnik wrote:It might be worth mentioning that certain IDEs eat your stdout and your code under the section connecting to standard streams will not do what you expect using this IDEs
Please elaborate.

I am having trouble imagining what problems you expect to occur.
by [Shambles]
01 Oct 2017, 22:05
Forum: Tutorials
Topic: Writing Command-Line Programs in AutoHotkey
Replies: 5
Views: 4848

Addendum

Special Thanks
qwerty12 told me why my program became unstable when I used RegisterCallback when setting my console control event handler, directed me to helpful resources, and critiqued this document.

See Also
  • tmplinshi's script for changing the Subsystem field of the PE header
by [Shambles]
01 Oct 2017, 02:14
Forum: Tutorials
Topic: Writing Command-Line Programs in AutoHotkey
Replies: 5
Views: 4848

Writing Command-Line Programs in AutoHotkey

Introduction This tutorial might be of interest to those who want to automate the (un)installation, updating, and (re)configuration of software those extending editors (e.g. Emacs) that can use the standard streams (stdin, stdout, and stderr) to communicate with other programs This is written for v...
by [Shambles]
20 Sep 2017, 04:34
Forum: Ask For Help
Topic: Surprising Behavior When Handling Console Control Signals
Replies: 10
Views: 1913

Re: Surprising Behavior When Handling Console Control Signals

You are a programmer. You write programs. Your knowledge indicates you are experienced, and your solution to my problem indicates you are not bad at it. People denying themselves or others the title is used as an excuse to make terrible decisions, like designing a programming language "for non-progr...
by [Shambles]
19 Sep 2017, 16:58
Forum: Ask For Help
Topic: Surprising Behavior When Handling Console Control Signals
Replies: 10
Views: 1913

Re: Surprising Behavior When Handling Console Control Signals

Sorry, I meant something along the lines of if having the console handler run on the same thread as the rest of your script wasn't desirable, then you'd have to have to use MCode for the handler function. Also: I'm not particularly in the know about AHK threads (my usual approach is to add Critical...
by [Shambles]
19 Sep 2017, 02:25
Forum: Ask For Help
Topic: Surprising Behavior When Handling Console Control Signals
Replies: 10
Views: 1913

Re: Surprising Behavior When Handling Console Control Signals

The CTRL_CLOSE_EVENT , CTRL_LOGOFF_EVENT, and CTRL_SHUTDOWN_EVENT signals give the process an opportunity to clean up before termination. A HandlerRoutine can perform any necessary cleanup, then take one of the following actions: Call the ExitProcess function to terminate the process. Return FALSE ...
by [Shambles]
18 Sep 2017, 22:13
Forum: Ask For Help
Topic: Surprising Behavior When Handling Console Control Signals
Replies: 10
Views: 1913

Re: Surprising Behavior When Handling Console Control Signals

Not being knowledgeable about Windows signal handlers, either, all I can post are my observations and an exception was not thrown every single time I closed the command prompt window hosting your script (but I did see an exception message when I hit Ctrl+C/Break). The only consistent thing I did se...
by [Shambles]
18 Sep 2017, 14:36
Forum: Ask For Help
Topic: Surprising Behavior When Handling Console Control Signals
Replies: 10
Views: 1913

Re: Surprising Behavior When Handling Console Control Signals

The console ctrl handler function runs on another thread. Use Lexikos' RegisterSyncCallback instead and AutoHotkey won't be unstable after your function has been called. (Also, I recommend just actually doing everything in the HandlerRoutine function - once it returns, your CheckForSignals function...
by [Shambles]
18 Sep 2017, 04:37
Forum: Ask For Help
Topic: Surprising Behavior When Handling Console Control Signals
Replies: 10
Views: 1913

Surprising Behavior When Handling Console Control Signals

I have been attempting to write a command-line application in AutoHotkey. The code below demonstrates the problem I am having: global Signal := "off" ; Prevent "" from being handled as 0. HandlerRoutine(dwCtrlType) { Signal := dwCtrlType return true } DllCall("AttachConsole", "int", -1) DllCall("Set...

Go to advanced search