Incrementing Alphanumeric Fields
Bruce Easton
bruce at stn.com
Thu Jan 19 11:13:37 PST 2012
I don't see anything wrong with the code in a perfect world (that
agrees with it). But because assigning a new number involves an
indexed lookup, the results are subject to:
1. the data already on file (are their invalid values stored for field
1?), and
2. the health of the automatic index used for the lookup
Also, since you say it will sometimes jump to U####, then could
the user sometimes be holding down the U a little too long
(when they have keyed U to go into update mode and this field
1 is the first field on the screen)? I guess I am wondering if
the field sometimes is populated correctly, but the user is
unintentionally overwriting one or more characters with the
same U that was being held to go into update mode.
Bruce
On 1/18/12 4:41 PM, Rod Caddy wrote:
> 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
>
More information about the Filepro-list
mailing list