AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Putting % in correct places

 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
System Monitor



Joined: 09 Mar 2007
Posts: 463
Location: Unknown

PostPosted: Wed Nov 18, 2009 3:31 am    Post subject: Putting % in correct places Reply with quote

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
Back to top
View user's profile Send private message Visit poster's website
Guest






PostPosted: Wed Nov 18, 2009 3:34 am    Post subject: Reply with quote

show us in a non-one expression working example first
it will be easier for us to read than those row row col col
Back to top
System Monitor



Joined: 09 Mar 2007
Posts: 463
Location: Unknown

PostPosted: Wed Nov 18, 2009 3:48 am    Post subject: Reply with quote

Code:
isGreater = row1col1 * row1col2 * row1col3


Last edited by System Monitor on Wed Nov 18, 2009 3:49 am; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website
jaco0646



Joined: 07 Oct 2006
Posts: 1770
Location: MN, USA

PostPosted: Wed Nov 18, 2009 4:37 am    Post subject: Reply with quote

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

_________________
http://autohotkey.net/~jaco0646/
Back to top
View user's profile Send private message Visit poster's website
guest helper
Guest





PostPosted: Wed Nov 18, 2009 6:31 am    Post subject: Reply with quote

Learn how and where to use % signs. Detailed explanation and lots of useful examples can be found here.
AutoHotkey Expression Examples: "" %% () and all that.
Back to top
System Monitor



Joined: 09 Mar 2007
Posts: 463
Location: Unknown

PostPosted: Wed Nov 18, 2009 6:42 am    Post subject: Reply with quote

thanks!
lots would be an understatement Smile
Back to top
View user's profile Send private message Visit poster's website
jethrow



Joined: 24 May 2009
Posts: 722
Location: Iowa, USA

PostPosted: Wed Nov 18, 2009 6:48 am    Post subject: Reply with quote

Just a thought:

If you're working with 2D arrays, you might want to try AHK_L.
_________________
AHKL, COM_L,Webpage Controls,Donate to AHK
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group