Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are
spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the
password reset link.
Entire forum
➜ MUSHclient
➜ General
➜ string manipulation (changing say text)
string manipulation (changing say text)
|
It is now over 60 days since the last post. This thread is closed.
Refresh page
Posted by
| Thebloodsiren
(13 posts) Bio
|
Date
| Thu 06 Feb 2003 11:13 AM (UTC) |
Message
| I want to (1) be able to change the case of some characters of text, ie manipulate strings. And (2) be able to apply color codes to the first or random letters in text.
Eg if i type:
say My name is Insano
I have made an alias to send the text i want manipulated to a sub. just dont know what the vbasic way to manipulate strings.
(1) I want to be able to change the text to say
"mY namE is InSaNo", where there is a random percentage chance (50% maybe) of alternating the case of one character.
(2) "$4M$2y $4n$2ame $4i$2s $4I$2nsano"
where $4 is put before all the first text and represents the color code. then $2 is the color of the rest of the message.
I got no ideas,
Thanks |
-----------------------------------
Calm down, its only ones and zeros. | Top |
|
Posted by
| Nick Gammon
Australia (23,120 posts) Bio
Forum Administrator |
Date
| Reply #1 on Thu 06 Feb 2003 09:21 PM (UTC) |
Message
| To pull out parts of a string use mid. To get a random number use rnd.
Do you want to colour stuff on your window only? See the ColourNote plugin. |
- Nick Gammon
www.gammon.com.au, www.mushclient.com | Top |
|
Posted by
| Thebloodsiren
(13 posts) Bio
|
Date
| Reply #2 on Thu 06 Feb 2003 10:58 PM (UTC) |
Message
| Excuse my ignorance but how does this mid and rnd functions work using vbasic. My experience in programming goes to 6 months studying C. A quick example will be ever so helpful.
Thanks :)
And no, I wanted to send the actual changing colour codes to the mud, so I have a "individual" style of says.
|
-----------------------------------
Calm down, its only ones and zeros. | Top |
|
Posted by
| Thebloodsiren
(13 posts) Bio
|
Date
| Reply #3 on Fri 07 Feb 2003 12:41 AM (UTC) |
Message
| Oh, and what command will invert the case of a character. ie make an "a" to an "A".
|
-----------------------------------
Calm down, its only ones and zeros. | Top |
|
Posted by
| Shadowfyr
USA (1,788 posts) Bio
|
Date
| Reply #4 on Fri 07 Feb 2003 01:45 AM (UTC) |
Message
| Get a character from the middle - mid(string, start, length)
Get a character from the left side - left(string, length)
Get a character from the right side - right(string, length)
Change to uppercase - ucase(string)
Change to lowercase - lcase(string)
You may also find it useful to download the help files at http://download.microsoft.com/download/winscript56/Install/5.6/W982KMeXP/EN-US/scrdoc56en.exe. ;)
| Top |
|
The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).
To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.
13,219 views.
It is now over 60 days since the last post. This thread is closed.
Refresh page
top