Robert,

On Fri, Jan 6, 2017 at 3:17 AM, Robert Livingston <[email protected]>
wrote:

> C_TEXT($someText)
> $someText:=DavidEscapeMethod("dog \on hill")
> Alert($someText)
>
​I just pasted David's code into a new method and ran it and it gave back
what I expected:
"dog \\on hill"​

 If you pass "dog \on hill\r" it gives back "dog \\on hill\r".

4D seems to manage this stuff itself. For example,

$text:="\"damn\" dog \\on hill\r\n"
ALERT(___escape ($text)+"\r\r"+$text)


The Alert displays:

"\"damn\" dog \\on hill\r\n"

"damn" dog \\on hill"


In the first case displaying the variable with the text escaped and in the
second place displaying the text parsed. The only thing the __escape
function does is escape the '\' in front of the 'o'.

I think what David is trying to do is something like this:

$code:="$text:=\"\"damn\" dog \\on hill\r\n"
$code:=$code+"ALERT(___escape ($text)+\"\r\r\"+$text)"

and then run $code.


​In this context the method makes sense. I've found it challenging to have
4D write 4D code for anything beyond fairly simple structures for reasons
just like this - it becomes really hard to debug and verify.

-- 
Kirk Brooks
San Francisco, CA
=======================
**********************************************************************
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