AutoHotkey Community

It is currently May 27th, 2012, 10:01 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: January 27th, 2009, 1:01 pm 
I know there is probably a good reason for all the different ways of viewing and storing and manipulating variables, but it is incredibly confusing to me!

I have been using AHK off and on for a couple of years, and I just now came back after having taken a break for about 5 months, and I have never been as frusturated as I am right now.

I am trying to add AND concatenate some numbers and characters, I it's taking me FOREVER to figure out the syntax.
we have
x = x
x := x
x = %x%
x := %X%
x = % var
x := % var
ect...

and that was just assigning a variable! What if I try to add them, or concatenate them? It's so confusing!

I would like a feature to somehow simplify this kind of syntax so it's more traditional.

By the way, I was trying to make a function that would make the built in WinSet, Region function easier to use.

A function where you just give it the ID or PID of a window, specify an X,Y which is the top left corner of the region, specify Width x Height, and thats it. Kinda ironic, I am trying to write a function to simplify the confusing syntax of a build in function, but am having trouble getting past the confusing syntax of using variables, operators and expressions.

I love AHK, don't get me wrong, and I would rather suffer through these problems I am having then not have it at all, but I personally find some of this syntax very frusturating to master. Maybe it's just me?


Report this post
Top
  
Reply with quote  
PostPosted: January 28th, 2009, 8:09 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7503
Location: Australia
JD wrote:
I would like a feature to somehow simplify this kind of syntax so it's more traditional.
No single syntax would be appropriate in all contexts. What is "traditional" is also subjective. What do you suggest?

Any script that uses A:=% B or A=% B should be changed... or deleted. It is only possible because assignments are treated as a command with two arguments, and % is used to force an argument to be treated as an expression. Additionally, using % with := is meaningless. In fact, the following will cause a load-time error:
Code:
x := % y, n := 1

An often-cited link is FAQ: When exactly are variable names enclosed in percent signs?
Quote:
I it's taking me FOREVER to figure out the syntax.
FYI, there is a section for "Language Syntax" in the FAQ...


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 3 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group