New Color patch and String Replacer patch

From: Ronald Fenner (abbadon@mac.com)
Date: 12/31/02


I've uploaded some patches to do string replacement and color codes
using the string replacement patch. once they are moved from incoming
you should be able to find them under code/colour and code/utils.

The string replacement patch is a set of functions that implement a
flexible means of replacing or filtering the text tokens specified. the
text tokens can be of variable length and do not require a starting
character but one can be used. The two functions that replace and
filter the string utilize hook functions to allow for their flexibility.

The color patch utilizes the string replacement patch to filter and
replace color codes with their real ansi values. it also supports level
restricted color codes and includes cursor codes and background color
codes as well.

I have also used the string replacement function to filter and replace
the special XML characters for reading and writing files just to give
you and idea of what you can do with it. also since it allows for you
to calculate values and pass user specific data which it will pass on
to the hook functions one could use it to build a system that could
modify text on the fly based on certain conditions.

  enjoy,

Ron Fenner

--
   +---------------------------------------------------------------+
   | FAQ: http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html |
   | Archives: http://post.queensu.ca/listserv/wwwarch/circle.html |
   | Newbie List:  http://groups.yahoo.com/group/circle-newbies/   |
   +---------------------------------------------------------------+



This archive was generated by hypermail 2b30 : 06/25/03 PDT