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
**********************************************************************

Reply via email to