Escape characters

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: Klaus, FourthWorld, heatherlaine, robinmiller, kevinmiller

Post Reply
Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Escape characters

Post by Andycal » Tue Feb 12, 2008 6:08 pm

Righty ho, nearly there!

I'm currently writing an application that takes some files and creates an SQL file that I can use to get the data into a database.

So far, all's going well and thanks to the guys here for the help - couldn't have done it without either RunRev or your help!

Anyway, at the final fence now and I'm outputting to a file, thing is, some of my text files have apostrophes and quotes in them, so when the sql file is written, it breaks when running it.

I'm using MySQL so it requires a backslash in front of any quotes in order to escape them and I was wondering if there's a way of doing this easily within RunRev.

I tried:

Code: Select all

replace "'" with "''" in wRest
But that didn't work (didn't really expect it to).

Any ideas?

Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Post by Andycal » Tue Feb 12, 2008 6:12 pm

Actually, the single quotes did work, the doubles don't:

Code: Select all

replace """ with """" in wRest

malte
Posts: 1098
Joined: Thu Feb 23, 2006 8:34 pm
Location: Ostenfeld germany
Contact:

Post by malte » Tue Feb 12, 2008 6:26 pm

try

replace quote with quote&quote in wRest

All the best,

malte

Andycal
Posts: 144
Joined: Mon Apr 10, 2006 3:04 pm

Post by Andycal » Tue Feb 12, 2008 8:01 pm

!!!WHOOP!!!

Thanks buddy, now finally completed my first proper RunRev app!!

Beers all round!

Post Reply

Return to “Getting Started with LiveCode - Experienced Developers”