[MAYBE SPAM] RE: Character replace in Quiz

Chris Sharman chris.sharman@ccagroup.co.uk
Thu, 06 Jan 2005 10:28:06 +0000


> <robert.mills@windsong-services.co.uk> wrote:
>>Environment: Quiz 8.39.C running on MPE/iX 6.5
>>
>>I have a char*30 source field that may contain any
>>number of semi-colons which I need to replace with
>>spaces. Any advice on the most efficient way of
>>doing this?

There's always PACK: "removes leading & trailing commas & semicolons, 
and removes leading spaces from words that begin with comma, period, 
colon, or semicolon".

Whether that's any use to you depends on what else is in the data, and 
what you need to do with it.

def nosemisorcommas char*30 = &
pack(data[1:2])+pack(data[3:2])+pack(data[5:2])+&
...

Unfortunately that turns ";ABC;DEF" into "A BCD EF", so more thought 
needed. There's also the simple approach of index and substrings, which 
is pretty tedious, but possible if you think you can get away with 
assuming less than 5 or 6 semicolons or so.

Chris


-----------------------------------------------------------------------

Any views expressed in this message are those of the sender and not
necessarily those of CCA Group.  The unauthorized use, disclosure,
copying or alteration of this message is forbidden.  The contents of
this message may be confidential and/or privileged, copyright CCA Group
and are intended solely for the use of the individual or entity to whom
they are addressed.  Whilst this message has been scanned, CCA Group
cannot guarantee that it is virus free or compatible with your systems
and accepts no responsibility for any loss or damage arising from its
use. The recipient is advised to run their own anti-virus software. If
you receive this message in error please contact
postmaster@ccagroup.co.uk immediately, destroy any copies and delete it
from your computer systems.