Hi all,

We are in the progress of migrating from 4D Write to Write Pro
A lot of things are going fine, but there is one area that seems easy but I am 
having difficulties with it and that is programmatically manipulating text

I give 2 examples that maybe seem obvious to others but are not for me:

  1.  I am in a procedure where I have an Write Pro object (not perce an area 
on screen, could be a range) and an expression has been selected via $type:=ST 
Get content type($wp_obj;$start;$end;$startBlock;$endBlock). I call the command 
ST SET TEXT($wp_obj;$text;$startBlock;$endBlock) to replace the selected 
expression. So far no problems, but here it comes... Now I want to find the 
first occurrence of a carriage return in the text that comes after the replaced 
text (end inserted text - end whole text). What is the best / easiest way to do 
this? Remember, this text can contain styled text and/or expressions and/or 
pictures
  2.  Example 2 is like example 1 but now with an actual visual area. The user 
types a couple of characters. At a certain point after typing I want to 
procedurally replace the typed text from the cursor back until the first space 
and replace it with another text. Maybe somebody knows "Type it for me", this 
is what I am talking about. So, what is the best way to find the first 
occurrence of a space from the cursor back and replace this text with another 
text?

Thanks in advance,

Piotr

**********************************************************************
4D Internet Users Group (4D iNUG)
FAQ:  http://lists.4d.com/faqnug.html
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