On 1/28/2011 7:29 PM, Garry Smith wrote:
> FXI  = 1ýý    
> 
>  DCount(FXI,VM) returns 3 
> Is there function to clear the blank value marks so that FXI = 1     and then 
> DCOUNT would return 1


If your field is associated with any other fields, simply removing all
value marks preceding null fields will potentially de-synchronize (is
there such a word?) the relationships.  That is, you can remove any
trailing VMs, but not any embedded ones.

If I were doing this, I'd start with the base rule that we're working
from the end of the string and rolling backwards until we hit a
character that isn't a VM, and keeping everything up to there.

So, using your example of "FXI  = 1ýý";
here's a code sample:

0001       fxi = "a": @vm: @vm
0002       crt "fxi = ": fxi
0003       crt "dcount = ": dcount(fxi, @VM)
0004       len.fxi = len(fxi)
0005       if (len.fxi) then
0006          for i.char = len.fxi to 1 step -1
0007             if (fxi[i.char, 1] ne @vm) then exit
0008          next i.char
0009          *
0010          if (i.char lt len.fxi) then
0011             fxi = fxi[1, i.char]
0012          end
0013       end
0014       crt "fxi = ": fxi
0015       crt "dcount = ": dcount(fxi, @VM)
0016       crt "done"
0017       stop
0018    end

And here's the output from it:
>RUN PGMS TT
fxi = aýý
dcount = 3
fxi = a
dcount = 1
done


_______________________________________________
U2-Users mailing list
[email protected]
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to