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 

Loop, StringSplit, MsgBox Problem

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



Joined: 23 Oct 2006
Posts: 31

PostPosted: Mon Jan 14, 2008 8:05 pm    Post subject: Loop, StringSplit, MsgBox Problem Reply with quote

OK, another one of my "I'm missing the obvious"

All I want to do is split up a list of names, and output the current name and the next name on the list. If I reach the last name I want to output the 1st name.

I am getting an "illegal character" error at Line 8 (MsgBox)?

Code:

Names = Joe Bob Hank Brian Elliot
StringSplit, List, Names, %A_Space%
Loop, %List0%
{
  next := A_Index + 1
  If (next > List0)
    next = 1
  MsgBox, % List%A_Index% `n % List%next%
}


Thanks
Back to top
View user's profile Send private message
TheIrishThug



Joined: 19 Mar 2006
Posts: 370

PostPosted: Mon Jan 14, 2008 8:33 pm    Post subject: Reply with quote

If you are doing MsgBox as an expression, the `n must be quoted as a string.
Back to top
View user's profile Send private message Visit poster's website AIM Address
damajha



Joined: 23 Oct 2006
Posts: 31

PostPosted: Mon Jan 14, 2008 8:45 pm    Post subject: Reply with quote

Thank you!!
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