Changing text in formatted field

Shari shari at
Wed Aug 20 22:20:08 EDT 2008

The entire field loses it's formatting, not just the changed word. 
Every word in the field becomes plain text.

I used:  replace xyz with newText

I had put specific text that would frequently be updated into the 
field, so I used placeholder text to swap out.

Basically what I'm trying to do is create a form letter of sorts on a 
card, plug in the info and print the card so that it's a nice, neat 
letter.  In reading thru the archives there were three suggestions on 
how to do this.

1.  Export the info from Rev and bring it into a word processor to 
make nice letters
2.  Use some external program in conjunction with Rev (I don't recall 
the  name of it)
3.  Create a template stack with the letter in it, fill in the info 
and print it

I'm opting for number three.  One is too confusing for the users (I 
already know this from experience, and promised them a one-click 
solution where Rev does all the work), and two would have to be 
purchased, another no-no.  So three it is.

I'm more than willing to use actual HTML if need be, or create an RTF 
file and have Rev open it, read it, replace the text, and paste it 
into the card for printing.  I've just never done any of this so I'm 
kind of muddling.

I wonder if I could create the template letter in Word, have Word 
turn it into HTML for me, and store the HTML file in a folder... have 
Rev open the file, read it, change it, and paste it into the field, 
then print?


>Hi Shari,
>Probably, Sarah wanted (or could have wanted) to write this:
>put the textStyle of word 3 of fld "Formatted" into tStyle
>put "new" into word 3 of fld "Formatted"
>set the textStyle of word 3 of fld "Formatted" to tStyle
>If you want to append text to a field, you can do this:
>put number of chars of fld x into myNrOfChars
>put the textStyle of last char of fld x into theStyle
>put myWhateverText after fld x
>set the textStyle of char myNrOfChars to -1 of fld x to theStyle
>Of course, you can also put text before a field, or before char y of 
>fld x or after char y of fld x etc and you can set the textStyle of 
>the added text to char 1 of fld x, char y-1 of fld x or char y of 
>fld x respectively.
>Best regards,
>Mark Schonewille

   Dogs and bears, sports and cars, and patriots t-shirts
  WlND0WS and MAClNT0SH shareware games

More information about the use-livecode mailing list