|
teknique55 Newbie
Joined: 05 Feb 2005 Posts: 4
|
Posted: Wed Mar 26, 2008 12:02 pm
breaking up a %0 script into subparts for color coding purposes. |
Hi,
I have a desire to make a script where I insert different colorcodes into a string based on a proportion of the string length.
I've tried using %len(%0) and using math to divide the length into subportions, but I do not know how to store the values of each string subpart so that I can correctly insert the colorcodes into the correct order of subparts.
In the helpfile it says something about using &nn where nn is the character #, but because I can't seem to output the string value, I end up with numbers that the mud doesn't understand.
Any help will be much appreciated in this matter. |
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Wed Mar 26, 2008 8:57 pm |
If you want to do this after matching the entire line, look into the use of %right(), %rightback(), %left(), and %leftback(). Maybe %copy(), but I'm not at all familiar with that one.
|
|
_________________ EDIT: I didn't like my old signature |
|
|
|
teknique55 Newbie
Joined: 05 Feb 2005 Posts: 4
|
Posted: Fri Mar 28, 2008 4:00 am |
Hi,
Thanks for your assistance.
I was able to get the script to cut off at certain points using %remove, %delete, and using %right, however, when I try to input it, there were text characters that got cut off due to Zmud rounding when I took the string length and divided by the number of subparts for each color coded part.
I came across the %insert command, but I cannot seem to insert multiple colorcode commands at different points, and when I try to use it, it doesn't seem to want to insert what I want to happen.
I'm not sure how to go about doing this now? |
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Mar 28, 2008 10:45 am |
Perhaps some examples of the original strings you are working with, how you are capturing it, and what you want the final output to be would allow us to help you further.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
|
|