help

Jay R. Ashworth jra at baylink.com
Fri Nov 9 11:56:50 PST 2007


On Fri, Nov 09, 2007 at 11:36:24AM -0800, Enrique Arredondo wrote:
> I can't think of a way to do this little project, maybe someone can shade 
> me  some light:
> 
> I need to display the next available number when the user inputs the first 
> 2 digits , so filepro has to check on the database until it finds an 
> available one.
> 
> That is:
> User input
> ------
> 13      --- >   so I have to find from 00 thru ZZ and show which one is 
> not on use.
> 
> How can I increment from 00 all the way to ZZ so it shows me  13A4 or 13R9 
> available.

You're working with base 36 integers.  I assume you're using the
traditional increment approach where:

08..09..0a..0b...0y..0z..10..11...19..1a.... ?

There's no native method of dealing with base-36 numbers in filepro,
unlike in, say, perl, so your best (least-effort) solution may well be
-- assuming you have a perl handy -- to hand that off to perl.  It
should be a one-liner, if my memory that perl knows how to increment
numbers of arbitrary base is correct.  If not, perhaps bc or dc.  This
is *nix, right?

PS: re your subject line, have I posted "How To Ask Questions The Smart
Way" here lately?

Cheers,
-- jra
-- 
Jay R. Ashworth                   Baylink                      jra at baylink.com
Designer                     The Things I Think                       RFC 2100
Ashworth & Associates     http://baylink.pitas.com                     '87 e24
St Petersburg FL USA      http://photo.imageinc.us             +1 727 647 1274


More information about the Filepro-list mailing list