AnsweredAssumed Answered

clearing partial data from a large text field (FMP7)

Question asked by amixer on Mar 24, 2009
Latest reply on Apr 19, 2009 by amixer

Title

clearing partial data from a large text field (FMP7)

Post

Hello all, I'm a longtime dabbler in FM and I know this script step should be pretty easy which is why it's frustrating me to no end that it's not working.  Here's what I'm doing. I have a large text field from which I use a script to grab the first few whole words that equal 45 characters or less.  I'm using a set field command to put this line in another text field.  I then wish to delete those words I put into the second text field from the first field.  I've tried using set selection, but for some reason it's not working.  I checked my start and end position variables and they are computing correctly, but the selection never gets created.  I have not tried using cut and paste simply because I don't want to be forced to have this particular layout up  when I'm running the script.  I also tried to employ the perform find/replace script step on the field, giving the find parameter as the words I just pasted into the scecond field and the replace parameter as "" (basically empty I figured).  No dice.  How can I accomplish this? What am I failing to realize that is stopping these script steps from working?  Any help would be appreciated. Thanks!

-Andrew OS X 10.5.6

 

 

here's the basic idea:

 

Set Field [ textmanip::loopcount; 1 ]
Set Field [ textmanip::y; 0 ]
Loop
If [ (Length ( LeftWords ( textmanip::text entry ; textmanip::loopcount ) ) > textmanip::charlen) = True ]
Set Field [ textmanip::line 1; LeftWords ( textmanip::text entry ; (textmanip::loopcount - 1) ) ]
Set Selection [ textmanip::text entry; Start Position: 1; End Position: Length ( LeftWords textmanip::text entry ; textmanip::loop
count-1 ) ) ]

Clear [ textmanip::text entry ]

Exit Loop If [ IsEmpty ( textmanip::line 1 ) = False ] 

Else
Set Field [ textmanip::loopcount; textmanip::loopcount + 1 ]
End If
End Loop
 

 

I haven't yet finished the whole script which is why it exits right now if line 1 is full.

 




Outcomes