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

Play RetroMUD
Post new topic  Reply to topic     Home » Forums » zMUD General Discussion
Amfitrion
Wanderer


Joined: 29 Sep 2001
Posts: 75
Location: Israel

PostPosted: Thu Jan 24, 2002 11:46 pm   

Explode
 
There is a command in LPC named explode.
Is there something like this in zmud?

- Amfitrion.
Reply with quote
Vijilante
SubAdmin


Joined: 18 Nov 2001
Posts: 5182

PostPosted: Fri Jan 25, 2002 12:38 am   
 
I am not versed in LPC, is that some new type of drug? Anyhow, I don't think anyone is going to be able to tell you if there is something similar unless you tell us what "explode" does.
Reply with quote
Amfitrion
Wanderer


Joined: 29 Sep 2001
Posts: 75
Location: Israel

PostPosted: Fri Jan 25, 2002 12:51 am   
 
You are right. Here is what explode does:

"explode() takes two strings as arguments, the first is the string you want to break up, and the second is the pattern that explode() looks for as a marker of where to break the string. It returns an array of strings holding the result."

So if there is a string containing the follow data: "one and two and three", if you do:
explode("one and two and three", " and ")
you will get three strings as output:
String 1: "one"
String 2: "two"
String 3: "three"

There is implode function that does the opposite.


- Amfitrion.
Reply with quote
MattLofton
GURU


Joined: 23 Dec 2000
Posts: 4834
Location: USA

PostPosted: Fri Jan 25, 2002 2:06 am   
 
quote:

There is a command in LPC named explode.
Is there something like this in zmud?

- Amfitrion.



The closest things I can think of would be %numwords() for explode() and %concat() for implode().

%numwords() allows you to find the number of "word"-sized text strings based on what the divider is (by default it's a space, but you can specify what you like as a second parameter).

%concat() will take any number of string parameters and connect them all into one long string.

li'l shmoe of Dragon's Gate MUD
Reply with quote
dacheeba
Adept


Joined: 29 Oct 2001
Posts: 250

PostPosted: Fri Jan 25, 2002 2:21 am   
 
quote:
%concat() will take any number of string parameters and connect them all into one long string.


ANY number of string parameters? Help file says up to nine...if so this, this command may help me with the problem im having.
Reply with quote
Display posts from previous:   
Post new topic   Reply to topic     Home » Forums » zMUD 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