edits help

Kenneth Brody kenbrody at spamcop.net
Fri May 27 12:59:06 PDT 2011


On 5/27/2011 3:41 PM, Jay Ashworth wrote:
> ----- Original Message -----
>> From: "Kenneth Brody"<kenbrody at spamcop.net>
>
>> Without it, the "accept any amount of any character" part of the edit will
>> accept all of the trailing spaces. Because the "&39;" expansion has
>> increased the number characters in the field, the result no longer fits. By
>> adding the "@" (which must come before the "*"), all of the trailing spaces
>> are consumed, and are not part of the resulting value. Therefore, unless
>> the expanded value is too long to fit, the edit "works". (Consider the
>> case of a field consisting of nothing but apostrophes.) However, using
>> DOEDIT() and passing an explicit length, can work around this.
>
> But you're still not going to get any indication that you may have tried to
> expand off the end of the destination field, as you could with a 'function',
> right?

If the result doesn't pass the destination field's edit, the assignment 
fails and the destination is blanked.  (I believe that, long ago, this was a 
fatal error.)  This is true whether it's simply an assignment to a field 
with an edit, or the result of the DOEDIT() function.

So, these both result in field "yy" being blank:

     xx(50,*) = "Something that fails the 'foo' edit"
     yy(50,foo) = xx
and
     xx(50,*) = "Something that fails the 'foo' edit"
     yy(50,*) = doedit(xx,"foo")

But, there is a difference between these two:

     xx(10,*) = "''''''''''"
     yy(40,*) = doedit(xx,"urlenc")       '' Fails (yy is blanked)
and
     xx(10,*) = "''''''''''"
     yy(40,*) = doedit(xx,"urlenc","40")  '' Succeeds


-- 
Kenneth Brody


More information about the Filepro-list mailing list