xlate question
Brian K. White
brian at aljex.com
Thu Jan 20 12:49:33 PST 2005
----- Original Message -----
From: "Matthew Williams" <matthew.d.williams at gmail.com>
To: "FilePro Mailing List" <filepro-list at lists.celestial.com>
Sent: Thursday, January 20, 2005 3:16 PM
Subject: xlate question
>I would like to replace any commas and single quotes in a field with
> blank spaces with xlate, however I can only figure it out to eliminate
> one or the other, how would I do it with multiple ascii chars? so far
> this works to eliminate one of them:
>
> rep(15)=xlate(15,chr("34")," ")
rep(15)=xlate(15,chr("34"){","," ")
Let me chop that up so it makes more sense visually:
xlate( 15 , chr("34"){"," , " " )
you don't need chr("44") for the comma, "," will do
you only need chr for a few things that would be interpreted by fp itself as
being part of the command syntax and anything that's not printable. so, ",
\, form-feed, line-feed, carriage-return, etc... nothing special about
commas in this case.
and the right-most section has 2 spaces inside the quotes
those two spaces correspond 1:1 with the 2 characters in the middle part
to show how it works better, suppose you wanted to replace all " with ^ and
all , with ;
xlate(15,chr("34"){",","^;" )
Brian K. White -- brian at aljex.com -- http://www.aljex.com/bkw/
+++++[>+++[>+++++>+++++++<<-]<-]>>+.>.+++++.+++++++.-.[>+<---]>++.
filePro BBx Linux SCO Prosper/FACTS AutoCAD #callahans Satriani
>
> That eliminates all single quotes, now I would like to also remove
> commas which is chr("44"), how do I add that to the list of characters
> to translate?
>
> This is as i'm writing out to a file on a export if that helps out any...
>
> Thanks!
> -Matt
> Hale Mfg. Co.
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
More information about the Filepro-list
mailing list