RE: WritePro expression undefined

2018-12-27 Thread David Ringsmuth via 4D_Tech
Add,

Your timing is perfect!

I missed that until you emailed.

Life is justly humbling.

Thanks!

David Ringsmuth

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

Re: WritePro expression undefined

2018-12-27 Thread Add Komoncharoensiri via 4D_Tech
David,

eval is a project method that will execute a PROCESS 4D TAGS. I am pretty sure 
Erick provided an explanation to what that method does.

Regards,
Add




On 12/23/18, 11:29 PM, "4D_Tech on behalf of David Ringsmuth via 4D_Tech" 
<4d_tech-boun...@lists.4d.com on behalf of 4d_tech@lists.4d.com> wrote:

Tim!

We have great support from 4D! (Erick)

This is an effective 4D tech support work-around to the problem of 
“Undefined”.

Here “WParea” is a 4D Write Pro object.

After running this method on our converted 4D Write to 4D Write Pro 
documents, none of the embedded statements return “Undefined”.

It wraps all embedded expressions in an ‘eval(“….”)’. I did not find “eval” 
as a 4D command, but it works!

Off-Topic: Lastly, I must conceive a way to convert the embedded picts…
//-
C_OBJECT($range)
C_LONGINT($start;$end;$i;$type)
C_TEXT($text;$Newtext)

WP SELECT(WParea;wk start text;wk end text)
$range:=WP Get selection(WParea)
$start:=OB Get($range;"start")
$end:=OB Get($range;"end")

ARRAY TEXT($methodArray;0)
APPEND TO ARRAY($methodArray;"eval")
SET ALLOWED METHODS($methodArray)

For ($i;$start;$end)

$type:=ST Get content type(*;"WParea";$i;$i)

If ($type=2)  // found expression
$text:=ST Get expression($range;$i;$i)
$text:=Replace string($text;"\"";"\\\"")
$Newtext:="eval ("+"\""+$text+"\""+")"
ST INSERT EXPRESSION(*;"WParea";$Newtext;$i;$i+1)
End if

End for

//---

If you observe it, MERRY CHRISTMAS



David Ringsmuth

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**

**
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:4d_tech-unsubscr...@lists.4d.com
**