> On Jan 5, 2017, at 7:37 PM, David Adams <[email protected]> wrote:
> 
> $escaped:=""
> 
> If (Count parameters>=1)// If this isn't true, you should deal with it.
>   $escaped:=$1
> 
>   $escaped:=Replace string($escaped;"\\";"\\\\";*)
>   $escaped:=Replace string($escaped;"\n";"\\n";*)
>   $escaped:=Replace string($escaped;"\r";"\\r";*)
>   $escaped:=Replace string($escaped;"\t";"\\t";*)
>   $escaped:=Replace string($escaped;"\"";"\\\"";*)
>   $escaped:=Char(Double quote)+$escaped+Char(Double quote)
> End if
> 
> $0:=$escaped


In the spirit of things shouldn't the line

  $escaped:=Char(Double quote)+$escaped+Char(Double quote)

be replaced with 

$escaped:="\""+$escaped+"\""


*    *    *    *    *    *    *    *    *    *    


But more seriously:

If I pass the as the parameter          "dog \on hill"              what do I 
expect the output of the method to be?


C_TEXT($someText)
$someText:=DavidEscapeMethod("dog \on hill")
Alert($someText)



What is and what should be  $someText?

I am one of those people who find escaping confusing.
**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
Archive:  http://lists.4d.com/archives.html
Options: http://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to