#EscapeChar removal

Discuss the future of the AutoHotkey language
djvj11
Posts: 15
Joined: 21 Jun 2014, 01:30

#EscapeChar removal

20 Dec 2015, 23:23

Looks like #EscapeChar and #CommentFlag were removed but the problem with that is I need that to pass objects from the initial thread to other threads with ahk_H. The only way I'm aware of doing that is by using the JSON library which requires the use of those directives.

Is there another way to pass objects? This is very important for multithreading.
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: #EscapeChar removal

21 Dec 2015, 01:23

Change "the JSON library" or use a different library.

AutoHotkey v2 is not intended to be compatible with all v1 scripts. If "the JSON library" uses those directives, it is obviously not designed to work with v2.

Someone more familiar with AutoHotkey_H may have more suggestions.
djvj11
Posts: 15
Joined: 21 Jun 2014, 01:30

Re: #EscapeChar removal

21 Dec 2015, 02:28

I've been converting over the libraries I use as I get errors when trying to run scripts. Nothing I couldn't fix yet until this JSON library. But I don't need to even use it if there was another way to pass objects.

If anyone else knows another way I would really appreciate letting me know or if there is another place I should be asking, let me know as well.
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: #EscapeChar removal

21 Dec 2015, 02:34

Well you could create your own library at any given time.
You just need to use a For Loop to get the content of an object and then convert it to data that can be opened by your main script.
JSON is just an example of how you could do it.
Recommends AHK Studio
djvj11
Posts: 15
Joined: 21 Jun 2014, 01:30

Re: #EscapeChar removal

21 Dec 2015, 02:48

Thanks for the advice nnnik. I'd rather not reinvent the wheel if I don't need to. I did find this library that I will give it a shot:
https://autohotkey.com/board/topic/1048 ... ike-style/
There is also this as well:
https://autohotkey.com/board/topic/6649 ... tructures/
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: #EscapeChar removal

21 Dec 2015, 02:55

How hard can it be to replace // with ; and \ with `? Well, for each \\ you would need to figure out whether to replace it with `` (single literal escape char) or \ (ordinary literal slash)... otherwise, it could hardly be simpler.

There are several JSON libraries. The top result when I google site:autohotkey.com json at the moment seems to be Coco's JSON class, which is compatible with v1 and v2.

Also, I think CriticalObject might be what you're looking for.
djvj11
Posts: 15
Joined: 21 Jun 2014, 01:30

Re: #EscapeChar removal

21 Dec 2015, 06:47

oh, thanks, I didn't realize there were others. The one I was using was finks and it always annoyed me having to use the escapechar change. If I can do away with that, that's the route I'd rather go.

Never heard of CriticalObject...I'll definitely check it out.

Looking forward to trying these alternatives!

Return to “AutoHotkey Development”

Who is online

Users browsing this forum: No registered users and 63 guests