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 

Simple "If" condition problem

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





PostPosted: Fri Nov 13, 2009 3:33 pm    Post subject: Simple "If" condition problem Reply with quote

Quote:
AAA TY 676767 7679T767010267 56564 67675 6767 DT

Stringsplit,tah,clipboard,%A_Space%,


if tah8=DT
{
msgbox,NOWDT
}


Why that code does not work.. what is the problem. the msgbox does not appear.
Back to top
jaco0646



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

PostPosted: Fri Nov 13, 2009 3:38 pm    Post subject: Reply with quote

It works for me (after putting the string on the clipboard of course).
Code:
clipboard = AAA TY 676767 7679T767010267 56564 67675 6767 DT

Stringsplit,tah,clipboard,%A_Space%,


if tah8=DT
{
msgbox,NOWDT
}

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





PostPosted: Fri Nov 13, 2009 3:49 pm    Post subject: Reply with quote

Allright i have copy the text to clipboard from an excel cell and it contains formulas.May this effect the problem? How can i fix it?
Back to top
aaffe



Joined: 17 May 2007
Posts: 940
Location: Germany - Deutschland

PostPosted: Fri Nov 13, 2009 4:00 pm    Post subject: Reply with quote

Try:
Code:
clipboard = AAA TY 676767 7679T767010267 56564 67675 6767 DT

Stringsplit,tah,clipboard,%A_Space%%A_TAB%,


if tah8=DT
{
msgbox,NOWDT
}


I think the delimiter is not a Space, perhaps a Tab.
Back to top
View user's profile Send private message
KGC
Guest





PostPosted: Fri Nov 13, 2009 4:12 pm    Post subject: Reply with quote

Code:
clipboard = AAA TY 676767 7679T767010267 56564 67675 6767 888

Stringsplit,tah,clipboard,%A_Space%,


if tah8=888
{
msgbox,NOWDT
}


Above code does not work too. How can i test if ahk calculate 888?
Back to top
aaffe



Joined: 17 May 2007
Posts: 940
Location: Germany - Deutschland

PostPosted: Fri Nov 13, 2009 4:35 pm    Post subject: Reply with quote

Code:
Loop, %tah0%
MsgBox % tah%A_INDEX%
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