AutoHotkey Community

It is currently May 26th, 2012, 11:27 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 7 posts ] 
Author Message
PostPosted: November 18th, 2009, 4:31 am 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
I want to set the variable isGreater to the 2d array row%row%col%col% * row%row%col%col + 1% * row%row%col%col+2%

How can I do do this in one expression?

I have tried the following
Code:
isGreater := % row%x%col% A_Index + 1 * row%x%col% A_Index + 2 * row%x%col% A_Index + 3
isGreater := % row%x%col%A_Index + 1 * row%x%col%A_Index + 2 * row%x%col%A_Index + 3


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 4:34 am 
show us in a non-one expression working example first
it will be easier for us to read than those row row col col


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 4:48 am 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
Code:
isGreater = row1col1 * row1col2 * row1col3


Last edited by System Monitor on November 18th, 2009, 4:49 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 5:37 am 
Offline

Joined: October 7th, 2006, 4:50 pm
Posts: 3157
Location: MN, USA
Code:
row1col1 = 1
row1col2 = 2
row1col3 = 3

Loop,1
 isGreater := (row%A_Index%col%A_Index%) * (row%A_Index%col . A_Index+1) * (row%A_Index%col . A_Index+2)
MsgBox,% isGreater


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 7:31 am 
Learn how and where to use % signs. Detailed explanation and lots of useful examples can be found here.
AutoHotkey Expression Examples: "" %% () and all that.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 7:42 am 
Offline

Joined: March 9th, 2007, 2:47 am
Posts: 509
Location: Unknown
thanks!
lots would be an understatement :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: November 18th, 2009, 7:48 am 
Offline
User avatar

Joined: May 24th, 2009, 5:35 am
Posts: 2099
Location: Iowa, USA
Just a thought:

If you're working with 2D arrays, you might want to try AHK_L.

_________________
Image
Recommended: AutoHotkey_L
Basic Webpage Controls


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: Bing [Bot], Cerberus, Leef_me, Maestr0, Pulover, rbrtryn, Yahoo [Bot] and 69 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