Re: How to process all WritePro area expressions for replacement / update?

2018-12-21 Thread John DeSoi via 4D_Tech
This may help you get started:


ARRAY LONGINT($aPos;0)
ARRAY LONGINT($aLen;0)
$start:=1

While (Match regex("\\s*)";$text;$start;$aPos;$aLen))
  $expr:=Substring($text;$aPos{2};$aLen{2})
  $expr:=Substring($expr;10)  //Strip off leading -d4-ref:'
  $expr:=URL_Decode ($expr)


End while

John DeSoi, Ph.D.


> On Dec 21, 2018, at 12:28 PM, David Ringsmuth via 4D_Tech 
> <4d_tech@lists.4d.com> wrote:
> 
> Editing a WritePro area using the WP Get text returns stylized text, and all 
> expressions have a “-d4-ref:’expression_here’”, but these are html and 4D 
> command number added expressions.

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

How to process all WritePro area expressions for replacement / update?

2018-12-21 Thread David Ringsmuth via 4D_Tech
I need some code that will process a 4D WritePro area, updating existing 
embedded expressions, replacing them with a different expression.

The command to get an expression, ST Get expression, works on only some 
expressions - data structure only like: [Table]Field.

Editing a WritePro area using the WP Get text returns stylized text, and all 
expressions have a “-d4-ref:’expression_here’”, but these are html and 4D 
command number added expressions.





Even if I replaced the expressions using the WP Get text and updated with WP 
Set Text, we loose embedded pictures. So this wont work for me.

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