[v2] ClipboardAll(FileRead()) causing crashing

Report problems with documented functionality
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

[v2] ClipboardAll(FileRead()) causing crashing

26 Dec 2017, 23:27

Does this AHK v2 example work? It appears to be crashing AHK v2 (the current version, i.e. a082-fffc60d, and the previous version). It is supposed to perform file to clipboard. (Change the path as appropriate.)
Clipboard and ClipboardAll
https://lexikos.github.io/v2/docs/misc/ ... ipboardAll
Clipboard := ClipboardAll(FileRead("C:\Company Logo.clip", "RAW"))
E.g.

Code: Select all

vPath := A_Desktop "\MyClipboard.clp"
FileOpen(vPath, "w").RawWrite(ClipboardAll().Data)
Clipboard := ClipboardAll(FileRead(vPath, "RAW"))
[Moderator's note: Post split from Suggestions on documentation improvements and merged with another post.]
Last edited by jeeswg on 27 Dec 2017, 11:14, edited 1 time in total.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: Suggestions on documentation improvements

27 Dec 2017, 07:01

@jeeswg: It is supposed to load a previously stored clipboard file, and it is working for me.
just me
Posts: 9424
Joined: 02 Oct 2013, 08:51
Location: Germany

Re: possible issue with ClipboardAll?

27 Dec 2017, 10:01

[Moderator's note: Post moved from another topic.]

As already said, it is supposed to re-load previously stored clipboard contents and is working for me with the latest v2 version.

But it shouldn't crash if you pass a path to another file.
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: [v2] ClipboardAll(FileRead()) causing crashing

27 Dec 2017, 17:10

As the documentation is correct, I have split your posts from the documentation thread (then realised you've reposted it, and merged the topics). I would prefer bug reports be posted in the Bug Reports forum. Otherwise, when I review the v2 topics, I have to filter through fixed bug reports.

It will most likely work with smaller data, such as text, and fail with larger data, such as images.

The error is fixed by this commit.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [v2] ClipboardAll(FileRead()) causing crashing

27 Dec 2017, 18:12

- Many thanks lexikos.
- Apologies, sometimes we should try Ask For Help first, sometimes Bug Reports directly, it's a difficult balance.
- The question originates from this:
conversion logic, v1 = -> v1 := -> v2, two-way compatibility - Page 6 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 68#p191068
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
lexikos
Posts: 9553
Joined: 30 Sep 2013, 04:07
Contact:

Re: [v2] ClipboardAll(FileRead()) causing crashing

27 Dec 2017, 18:35

it's a difficult balance
I don't share that feeling. I have no problem with potential bugs being posted in Ask for Help.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [v2] ClipboardAll(FileRead()) causing crashing

27 Dec 2017, 20:12

- If I can make a valid argument that something behaves unexpectedly, my instinct would be to post it to Bug Reports. But I know that the main dev has a more restrictive definition.
- I think the best solution would be to have a subforum for Bug Reports, effectively 'devs said it's not a bug'.
- That way you can clear the clutter.
- And other people can find useful information about bug-like behaviour.

- In this clipboard example, I infer your post as stating that it was clearly a bug, and that I should have posted directly to Bug Reports. In the kindest way possible: 'once bitten, twice shy'. I wanted to be more certain before posting it here. In the link below I was trying to be quite reasonable.
obj.HasKey() fails for all keys if a key called HasKey exists - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 55#p147755

- Btw one concern is, if I see a post by someone else, that I think is a bug, should I quote it to notify you, or is that called being a nuisance.
- Also, if I post something to Ask For Help, you or other devs could easily never see it. Perhaps I could put 'possible bug'/'possible issue' in the title.
- I have been collecting a list of possible bugs, and I have justed posted it here, to my AHK homepage.
https://autohotkey.com/boards/viewtopic ... 40#p144440
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 03:51

If you have so much trouble thinking about it you can just have someone else move all your posts to ask for help.
Recommends AHK Studio
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 05:30

- @nnnik: There's no point in being deliberately antagonistic. If I were to respond in kind, I would say: well clearly nnnik, you never think things through before you post, case in point, your last post.
- I would definitely find it useful to have a 'failed Bug Reports' subforum, it would be very useful as a reference for learning about AutoHotkey, improving the documentation (or adding to my documentation extension tutorial), and writing tutorials.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 05:40

My point was to avoid telling you to shut up and do what youre told to.
The hint clearly went above your head.
Recommends AHK Studio
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 06:47

- @nnnik: You haven't earned the right to talk to people on the forum like that.
- I was very deliberate and careful about choosing which posts to submit here, and now it will be impossible to find them without rereading all my posts. I do not find it amusing to be chastised simply for posting bug-like behaviour to Bug Reports.
- The handful of posts that I posted to Bug Reports, should still be there, or else in a 'recycle bin' subforum. Even now, useful posts by other people are being moved to Ask For Help, where I will never be able to find them.
Report problems with documented functionality
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 06:54

It is a standard procedure to post in the ask for help section before posting here - no matter how sure you are it's is a bug.
You neither understood mine nor Lexikos nor my gentle hints so I chose the direct approach. Maybe I was a little too blunt.
However you still don't seem to understand. I will treat the next direct topic of yours in the bug reports section as a rule breaking and proceed with the normal administrative task of handling these actions.
Recommends AHK Studio
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 07:08

- @nnnik: 'a little too'. I appreciate this, some of the posts on this forum, including by me, are quite harsh, but I appreciate your contributions to AutoHotkey and such posts by me are just me defending my points and aren't based on ill-will.
- Sometimes I feel you dismiss certain points I make, on the basis that I'm not a full expert in C++, which you're entitled to do, but I think it's generally best to view what I do as something that I have considered carefully and do in good faith.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 07:23

No thats not the reason. I am not the best C++ programmer myself - in fact I only worked 10 hours with C++ so far in my entire life.
i disregard many of your posts because you do not have the experience required to make them.
You sometimes try to discuss Syntax design while not even knowing half of AutoHotkeys Syntax styles and their quirks and problems.
Then you say "I thought hard about this". Yeah but you are only programming for a year or 2. There are people here that program for 20 years+.
Do you think a little hard thinking will cover that difference in experience? Do you think that they don't think hard about their points?
There are people on this forums that work and program more than 8 hours a day to expand their horizons when it comes to programming.
And they have been doing so for multiple years.
But when I see your posts I often see a barrage of different points - that are all written in a time that I sometimes take to flesh out 2 points.
It's actually rather obvious to me that they can't be as valid as other posts and to be frank it's a lot of work to correct them.

To pick out one of your points recently: "AHK v2 is a subset of AHK v1." "Thats why it's easier to learn.". Both sentences would take my time to correct.
And in the final result they won't provide any quality to the discussion. Thats why I ignore it.
Recommends AHK Studio
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 09:02

- I have been programming to some extent for approximately 20 years. AutoHotkey from around 2010 onwards, I had a quite wide knowledge of Excel macros before that. I did experiment with serious languages before trying AutoHotkey, and have done some C++.
- Re. the AutoHotkey syntax, I don't think that many people could know it much 'better' than I do, especially since I've written converters/parsers/correctors that handle every nuance of the language. People may know behind-the-scenes details re. syntax better than me, and I haven't needed to use AHK object classes much.
- Re. 'a little hard thinking', I usually make proposals based on custom functions that I have tested for months or years, the testing often reveals a beneficial slight tweak. A lot of thought goes into for example: function/parameter naming/order, generality (being able to use a function for a wide variety of purposes), consistency with existing functions.
- I often see overlap with some of my ideas in other forum threads, unfortunately, other people don't often comprehensively collect their ideas, so it's harder to compare notes.
- Btw I do go over things quite thoroughly, some weeks ago, I reread 'Changes from v1.1 to v2.0' in full, which took about 2 hours, and I recently read the 3 new pages in the documentation (Program/Concepts/Language). You claim that other users consider things carefully too, but for example, I don't often see people take on problems in a comprehensive way, like with my list of built-in functions/variables, documentation extension, GUI control zoo, ranking of AHK v2 conversion difficulties, list of best scripts, or RegEx tutorial, and I don't see too many tutorials (where the consideration of all possible readers is a major challenge). One exception is HotKeyIt's WinApi link which I am very grateful for.
WinApi
https://hotkeyit.github.io/v2/docs/commands/WinApi.htm
- Suggestions relating to making scripts two-way compatible have been more challenging. I've only become well-versed in AHK v2 this year, and, the nature of AHK v2 has been changing. Principles like 'pseudo-arrays are always bad' and 'don't change AHK v2, only change AHK v1', have made me rethink various approaches to fit in with those demands.
- I recently discovered this thread:
AutoHotkey v2 Alpha Release - Scripts and Functions - AutoHotkey Community
https://autohotkey.com/board/topic/6531 ... a-release/
Trying to take on board all of these proposals really expands your horizons as someone who wants to design functions and possibly propose syntax additions.

- The 'AHK v2 is a subset of AHK v1' (syntax-wise) point was actually more like one of your points, rightly or wrongly I assumed the reader could figure it out, I avoided stating all the minor details (, and I was brief because it was responding to something offtopic). When I converted my scripts to AHK v2, the number of syntax concepts decreased: no "" (` became the only escape character), no commands, no 'force expression', no 'can be an expression', no ClipboardAll special variable, fewer variables that don't start with 'A_' (ComSpec, ProgramFiles, %0%, %1%), between/in/contains removed, simpler GUI handling (no g-labels), fewer characters requiring escaping (in expression-style parameters), one type of continuation section, binary variables can be used like normal variables, +=/-= for dates removed, #NoEnv by default, no AutoTrim.
- Anyway, I had the intention of finishing all my code projects, functions, tutorials, and submitting my AHK v2 proposals within a year of being the forum which I've mostly done. Although tidying and submitting my backlog of scripts could take at least 3 years.
Last edited by jeeswg on 28 Dec 2017, 10:09, edited 1 time in total.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 10:05

Not needing something is the same as not knowing what it's used for.

Imagine you see someone building houses and you see him hitting nails with his bare hands.
And when you ask him about a hammer he'll tell you that he never needed it.
He'll also tell you that he has been building houses for 20 years and that there is noone that knows more about tools since he has been building his own tools for 10 years.
Then he proceeds to go to the nail manufacturer and wants to participate in a discussion about the futuristic toolchain that should be used to build houses all while never even having used such a simple tool as the hammer.
Would you ignore this guy? I would. You probably have guessed it by now but that guy is you.
Recommends AHK Studio
gregster
Posts: 8916
Joined: 30 Sep 2013, 06:48

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 10:18

I think a personal feud can be quite entertaining, but I would recommend to dial down the drama factor a bit.

nnnik, especially since you are an admin, your rather harsh comments and your behaviour will reflect on the whole AHK community unfavourably, if you want it or not. Admin or not, I think we should go back to a more friendly treatment of each other, because that's something that defined (and still defines) this community and is something most forum members appreciate.
Thanks for reading!
User avatar
nnnik
Posts: 4500
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 10:24

gregster wrote:I think a personal feud can be quite entertaining, but I would recommend to dial down the drama factor a bit.

nnnik, especially since you are an admin, your rather harsh comments and your behaviour will reflect on the whole AHK community unfavourably, if you want it or not. Admin or not, I think we should go back to a more friendly treatment of each other, because that's something that defined (and still defines) this community and is something most forum members appreciate.
Thanks for reading!
Well I am actually working on a User Script that will just hide the comments and topics of specific people so this will be the last comment on this matter from my side.
Recommends AHK Studio
gregster
Posts: 8916
Joined: 30 Sep 2013, 06:48

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 10:33

nnnik wrote:
gregster wrote:I think a personal feud can be quite entertaining, but I would recommend to dial down the drama factor a bit.

nnnik, especially since you are an admin, your rather harsh comments and your behaviour will reflect on the whole AHK community unfavourably, if you want it or not. Admin or not, I think we should go back to a more friendly treatment of each other, because that's something that defined (and still defines) this community and is something most forum members appreciate.
Thanks for reading!
Well I am actually working on a User Script that will just hide the comments and topics of specific people so this will be the last comment on this matter from my side.
Well, that's not precisely the reaction I was hoping for, but if it helps, then go ahead.
User avatar
jeeswg
Posts: 6902
Joined: 19 Dec 2016, 01:58
Location: UK

Re: [v2] ClipboardAll(FileRead()) causing crashing

28 Dec 2017, 10:37

- Not knowing what what's used for?
- You mentioned 'people ... that work and program more than 8 hours a day'. A lot of people are 'experts' but have no imagination or have expertise in a limited field. I remember a roughly 100,000-points power user on Stack Overflow saying there was no point in automating Explorer. Whatever program I use, automation is useful.
- To me, someone using commands in AutoHotkey is like 'hitting nails with his bare hands'. Function versions of commands should have been standard long ago (available, if not default). Btw anyone who uses AutoHotkey at all is probably not that kind of person.
- I have mainly been advocating for simple improvements to AutoHotkey, filling in what I see as little holes, smoothing out AHK. What in my Wish List 2.0, do you have a problem with? You could post some criticisms there.
- I'm always interested to hear new ideas. I have asked specifically about the more futuristic changes that people might like to see, and you gave a list, but I would like to see more insight into why you would want these features. Link here:
Reconsideration request? - Page 2 - AutoHotkey Community
https://autohotkey.com/boards/viewtopic ... 17#p188017
- Btw what could be more forward-thinking than my attempts to ease the conversion from AHK v1 to AHK v2, and making two-way compatible libraries as realistic as possible (Loop being the only realistic obstacle so far, although ugly workarounds exist).
Last edited by jeeswg on 28 Dec 2017, 11:13, edited 1 time in total.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA

Return to “Bug Reports”

Who is online

Users browsing this forum: No registered users and 42 guests