Register to post in forums, or Log in to your existing account
 

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » CMUD General Discussion
MCrews17
Beginner


Joined: 16 Oct 2011
Posts: 13

PostPosted: Tue Jan 24, 2012 5:35 pm   

#capture command
 
Does anybody know of any commands that I can use to scan through multiple lines of output?

ie:

(I'm trying to capture the items below into an array.)

Your Have: item1, item2, item3, etc., ...

#var inv %array("item1","item2","item3", "etc.", "...")

Thanks,

MCrews17
Reply with quote
Daern
Sorcerer


Joined: 15 Apr 2011
Posts: 809

PostPosted: Tue Jan 24, 2012 8:05 pm   
 
Try this:
Code:
#TRIGGER {^You have: (*)} {inv = %replace(%1, ", ", "|")}

Reply with quote
Rahab
Wizard


Joined: 22 Mar 2007
Posts: 2320

PostPosted: Tue Jan 24, 2012 9:25 pm   
 
Note: Daern's code turns the captured items into a stringlist. You really do want to use a stringlist, not an array. You should not use %array unless you are trying to do COM coding.
Reply with quote
MCrews17
Beginner


Joined: 16 Oct 2011
Posts: 13

PostPosted: Thu Jan 26, 2012 4:56 am   
 
Okay, that does the trick! Thanks guys! Razz
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » CMUD General Discussion All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

© 2009 Zugg Software. Hosted by Wolfpaw.net