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 

remove an element from a list

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



Joined: 30 Jan 2009
Posts: 12

PostPosted: Fri Mar 27, 2009 1:22 pm    Post subject: remove an element from a list Reply with quote

list =
(
234586
213511
072441
124128
214199
)
how can i remove "072441" the new list should look like this:

234586
213511
124128
214199

i tried with

Code:
StringReplace, list, list,072441 , `r

but it makes a hole into the list
Back to top
View user's profile Send private message
Guest






PostPosted: Fri Mar 27, 2009 1:27 pm    Post subject: Reply with quote

Code:
Loop, Parse, list, `n
{
   If InStr(A_LoopField, 072441)
      Continue
   Else
      NewContent .= A_LoopField "`n"
   }
MsgBox % NewContent
Back to top
Guest






PostPosted: Fri Mar 27, 2009 1:29 pm    Post subject: Reply with quote

Code:
StringReplace, list, list,% 072441 "`n" , ,
Question
Back to top
hezlod
Guest





PostPosted: Fri Mar 27, 2009 1:39 pm    Post subject: Re: remove an element from a list Reply with quote

Leonidas225 wrote:
i tried with

Code:
StringReplace, list, list,072441 , `r

but it makes a hole into the list

You were very close. This is what you wanted.
Code:
list =
(
234586
213511
072441
124128
214199
)

StringReplace, list, list,072441`n
msgbox, %list%
Back to top
Display posts from previous:   
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