Jump to content


Photo

[forum] Workaround category


  • Please log in to reply
16 replies to this topic

#1 xxmarkxx

xxmarkxx
  • Members
  • 75 posts

Posted 27 June 2012 - 07:54 AM

It may be nice to see a workarounds subcategory under the Support category.
That way people could post and easily find small workarounds to issues with AHK.
For instance, someone on IRC couldn't figure out how to send a single tab to the
clipboard. I came up with something for him but it would be nice if I had a place to
post it up other that Support since most posts there are questions looking to get answered.

#2 CodeEater

CodeEater
  • Members
  • 78 posts

Posted 27 June 2012 - 09:54 AM

+1

#3 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 27 June 2012 - 12:21 PM

slightly offtopic - what was the solution/workaround?

My issue with this is that there are a million workarounds for any (perceived) issue. What should happen in the event that an elegant solution is posted in response to a workaround?

-1, because I think it should just go in the support forum as a question, so better solutions can be found.

#4 CodeEater

CodeEater
  • Members
  • 78 posts

Posted 27 June 2012 - 01:28 PM

The Support forum has a lot of rubbish (a lot of topics have the same problem but the author didn't search for or can't find the right topic due to the limitation of the search engine).
i think it'd better have subcategory such as :
-------------------------
- Support
+ Hotkeys & Hotstrings
+ GUI
+ COM
+ Functions
+ Advanced Issues
+ Others
-----------------------

#5 fragman

fragman
  • Members
  • 1591 posts

Posted 27 June 2012 - 01:41 PM

As an alternative one could introduce tags and force the usage of them in the Support forum.

#6 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 27 June 2012 - 01:59 PM

agreed that support has a ton of duplicate stuff. that's sort of how it goes. I like the idea of the multiple subtopics (I'm really happy gaming got split out), but it just means more time for mods to move stuff around into the other places. One solution is to not have posts in the support section, and force them to be in a subforum.

interesting thought. I'd like to see more +1/-1 votes here.

#7 rbrtryn

rbrtryn
  • Members
  • 814 posts

Posted 27 June 2012 - 02:16 PM

What should happen in the event that an elegant solution is posted in response to a workaround?

I would vote that truly elegant solutions or work-arounds be placed in the tutorials forum.

-1, because I think it should just go in the support forum as a question, so better solutions can be found.

If a better solution is found, the post in the tutorials can be easily modified.

One solution is to not have posts in the support section, and force them to be in a subforum.

I like this idea, but users post in the wrong forum on regular basis already. This would only get worse as the number of forums increases.

#8 Guests

  • Guests

Posted 27 June 2012 - 02:44 PM

agreed that support has a ton of duplicate stuff. that's sort of how it goes.

Some moderators at other forums simply delete faqs, they either wait for an answer or post it themselves and say something like "this thread will be removed after 7 days or earlier if you confirm you've read it" or something similar.

It doesn't stop the faqs because there are always people too lazy or incompetent (don't know the keywords to use) to search but it does mean there is hardly any repetition. It also produces better search results, not 10 pages of search results with autoclickers/spamming a key threads but just one with a handful of results.

#9 xxmarkxx

xxmarkxx
  • Members
  • 75 posts

Posted 27 June 2012 - 09:47 PM

Engunneer, posted the workaround here:
<!-- l --><a class="postlink-local" href="http://www.autohotkey.com/community/viewtopic.php?f=1&t=88096">viewtopic.php?f=1&t=88096</a><!-- l -->

Oh, and my original idea for the subcategory was that any other solutions
would just be listed as comments under the original thread.

#10 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 28 June 2012 - 02:09 AM

that topic is exactly why it should be in support. You suspected there was a better answer, even though you had a working solution. now it's not a workaround anymore.

#11 xxmarkxx

xxmarkxx
  • Members
  • 75 posts

Posted 29 June 2012 - 03:46 AM

Mr. engunneer,
First let me say, with all that you have contributed to this site and your brilliant mind as a programer, I sincerely have the utmost respect for you. I will however have to disagree with you on this.

I made that post confident that what I was offering was a workaround to an issue not only in AHK but the documentation as well. What I was referring to when I asked for "a more direct way of doing this" was a more direct and simplified workaround as I knew that what should work does not.

As per doc- Var := expression
x := "literal string"  ; [color=#FF0000]Same performance as x = literal string.[/color]
As per doc- Variables and Expressions
Storing values in variables: To store a string or number in a variable, there are two methods: traditional and expression. The traditional method uses the equal sign operator (=) to assign unquoted literal strings or variables enclosed in percent signs. For example:

MyString = This is a literal string.

By contrast, the expression method uses the colon-equal operator (:=) to store numbers, quoted strings, and other types of expressions. [color=#FF0000]The following examples are functionally identical to the previous ones:[/color]

MyString := "This is a literal string."
These two basic doc examples alone would lead one to believe that if they opted to use the traditional method, clipboard = x`tx would result in xTABx Which it does. Logically one would assume then that x`t or `tx or even just `t would return the expected result. It does not.

Only when using the expression method does one actually get the expected, logical result. Why would a literal `t have to be represented using the expression method? It shouldn't as x`tx indicates. This shows one of two things. Either that the highlighted statements in the above doc examples are not entirely correct, or if they are, there is inconsistent behavior, ie bug in AHK. Most likely it is a combination of the two.

But what it all boils down to is that AHK is expected by the user to behave in a particular manor both logically and supported by the documentation in regards to a literal tab. And that does not appear to be the case.

Workaround - Oxford Dictionary
"A method for overcoming a problem or limitation in a program or system."
And in this case, I believe the documentation as well.

A tab can not consistently be sent to the clipboard (and possibly any variable) via `t (and it appears using any other syntax) using the standard method as the AHK documentation and logic leads one to believe.

By definition, would not only my solution but the other solution as well still be a workaround?

I am however starting to realize that a workaround subcategory may not work out. It would probably get bombarded with people posting workarounds who do not actually make an attempt to read the docs first.

#12 Lexikos

Lexikos
  • Administrators
  • 8850 posts

Posted 29 June 2012 - 07:50 AM

The examples which are "functionally identical" do not contain any leading or trailing spaces or tabs. It is not a generalization about all such assignments, but a statement about two specific sets of examples. The behaviour of each type of assignment is documented, and the differences are not limited to just the handling of leading or trailing spaces or tabs.

By default, any spaces or tabs at the beginning and end of Value are omitted from Var. To prevent this, use the methods described at AutoTrim Off.
Source: SetEnv



#13 engunneer

engunneer
  • Fellows
  • 9162 posts

Posted 29 June 2012 - 12:19 PM

I am however starting to realize that a workaround subcategory may not work out. It would probably get bombarded with people posting workarounds who do not actually make an attempt to read the docs first.

This statement is more in line with my point/fear.

One of the side-effects of posting so much here is that I don't read the docs all the time, since i remember the main things that i need to help people. In this case, my mind immediately jumps to A_Tab, so I didn't read the Variables and Expressions page in the docs. I will admit my fault for not RTFM :)

If I had seen the topic in Support before it was answered, I would have directed you to A_Tab, which links to AutoTrim for more details. I feel Autotrim explains what is going on. <!-- m -->http://www.autohotke...ds/AutoTrim.htm<!-- m -->

Also, in AHK_L, Var = `t is explicitly allowed (this is a change from Basic)

Also, I thank that you think I am a brilliant programmer, but i have to deflect that to AHK's programmers. I don't use half the capabilities of AHK and the tools that Chris, Lex, and others have provided for us. I simply like attempting to help people with technical problems.

#14 Lexikos

Lexikos
  • Administrators
  • 8850 posts

Posted 29 June 2012 - 03:00 PM

Also, in AHK_L, Var = `t is explicitly allowed (this is a change from Basic)

However, AutoTrim still needs to be disabled at run-time.

#15 xxmarkxx

xxmarkxx
  • Members
  • 75 posts

Posted 30 June 2012 - 12:10 AM

Engunneer I sincerely hope that you didn't get the impression I was implying that you were one of those people I was referring to in my comment about those who do not attempt to read the docs. You know more about whats in there than most I'm sure. All I was saying is that it's frustrating reading a post where someone asks a question and it's painfully obvious that they didn't even make an attempt to read even the basic documentation for the command they're asking about. I'm sure you know what I'm talking about.

Alas AutoTrim has finally raised it's head and slapped me in the face. ;p
I'm one of those who can't break past learning by need. AutoTrim has been one of those things that while scouring through docs would always get skipped over. Some day I'll learn if it doesn't sound relevant to the task, it probably is......

Lexikos I REALLY need to try out AHK_L one of these days. I am far from what anyone would even remotely call a programer or writer of amazing scripts. It just always assume AHK_L is beyond my scope of understanding or skill level.

I guess it shows my ignorance by asking this, but what is the purpose for having AutoTrim on by default? I mean if someone specifically writes a code with a leading or trailing space or tab, why would he want it automatically trimmed off? I'm not saying it shouldn't be. I'm just not certain why it would be.

Ahh, this is getting way off topic....