function addSlashes: I did it

Sylvain Le Gourriérec sylvain.legourrierec at son-video.com
Mon Sep 9 06:47:00 EDT 2002


--------------------------------------------------------
function addSlashes myText

  -- on remplace " par \"
  replace numToChar(34) with numToChar(92) & numToChar(34) in myText

  -- on remplace ' par \'
  replace numToChar(39) with numToChar(92) & numToChar(39) in myText

  -- on remplace \ par \\
  replace numToChar(92) with numToChar(92) & numToChar(92) in myText

  -- on remplace NULL(ASCII 0) par \0
  replace numToChar(0) with numToChar(92) & numToChar(48) in myText


  return myText

end addSlashes


Does a build-in function like this exist?


Sylvain Le Gourriérec  --  développement  -- son-video-distribution

-------------> windows 2000 + runrev 1.1.1 + MySQL 3.23 + PHP 4
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.runrev.com/pipermail/use-livecode/attachments/20020909/82754fce/attachment.html>


More information about the use-livecode mailing list