addslashes
Brian K. White
brian at aljex.com
Thu Aug 26 08:46:12 PDT 2010
On 8/26/2010 11:20 AM, Kenneth Brody wrote:
> On 8/25/2010 4:39 PM, richard wrote:
>> I have a need to create some sql queries using filepro.
>>
>> My problem is that some of my text includes apostrophes and other chars.
>> that "break" the query.
>>
>> In php there is a command called "addslashes".
>>
>> Is there a simple way in filepro to turn "Robert's golf clubs" into
>> "Robert\'s golf clubs"?
>
> If all you want to do is just make sure that any apostrophe is preceded by a
> backslash, why not use an edit to add them if necessary? (Why don't people
> start with "gee, can this be done with an edit"?)
>
> { ({!" "!}@) | (<\>"'") | * }
>
Because the edit syntax is arcane, and the edit mechanism does not scale
(once you've written a few edits, you run out of available edit slots in
the global table, and have to start mucking around with per-file edit
tables...) Not complaining, you asked.
Now if doedit() could take a string of edit definition as an argument
right there on the spot instead of needing it to be defined in one of
the edit tables, that might be pretty useful.
--
bkw
More information about the Filepro-list
mailing list