Incrementing Alphanumeric Fields

Rod Caddy rcaddy at pro-set.com
Wed Jan 18 13:41:37 PST 2012


I have a customer running SCO Unix with Filepro 4.5.  They have a file 
that they use as experimental documentation before they turn the product 
into a real product number.  In the experimental file there is an 
experimental number that was setup as (4, allup). They use the 
processing below to increment the numbers.  The numbers are A000, A001, 
etc.  The problem is that the Alpha does not increment correctly.  It 
will work for a while and then will jump to Uxxx.(xxx being the numeric 
portion of the number.  I am open to ideas here, I have tried modifying 
the code several ways and have had very little success.


   1  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If:
        Then: end
   2  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
@wef1    If: 1 ne ""
        Then: end
   3  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If:
        Then: r(4,allup)="ZZZZ"
   4  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If:
        Then: lookup new = exp  k=r    i=a -el
   5  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If: new(1)="9999"
        Then: 1="A000"; display; end
   6  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If:
        Then: 1=new(1)
   7  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If: mid(1,"2","3")="999"
        Then: 1=chr(asc(mid(1,"1","1"))+"1"){"000"; display; end
   8  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If:
        Then: mid(1,"2","3")=mid(1,"2","3")+"1"
   9  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If: mid(1,"2","2") = "  "
        Then: mid(1,"2","2")="00"; display; end
  10  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If: mid(1,"2","1") = " "
        Then: mid(1,"2","1")="0"; display; end
  11  -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   
-   -
          If:
        Then: display; end

-- 

Pro-Set Systems Logo <www.pro-set.com>  Rod Caddy
   Pro-Set Systems
   rcaddy at pro-set.com
The information in this e-mail is confidential and may be privileged. If
   you are not the intended recipient, please destroy this e-mail and
   notify the sender immediately. You should not retain, copy, distribute
   or use this e-mail for any purpose, nor disclose any of its contents to
   any other person.



More information about the Filepro-list mailing list