help
Kenneth Brody
kenbrody at bestweb.net
Fri Nov 9 13:47:11 PST 2007
Quoting Jay R. Ashworth (Fri, 9 Nov 2007 14:56:50 -0500):
> 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,
[...]
Well, as has been pointed out elsewhere, BASE() will convert numbers
between any base from 2 to 36.
My question to the OP is: are there gaps in the sequence which are to
be used, or are you simply looking for the next number to be used after
the contiguous list?
That is, if you enter "13", are the numbers from 1300 to 13ZZ used in
order?
If so, you could do a "-nl" lookup on "13ZZ", which will give you the
highest number currently used, and you simply increment it. (Sort of
like getting a "next invoice number".)
Finally, what if they enter "13", and all 1296 numbers from 1300 to 13ZZ
have been used?
--
KenBrody at BestWeb dot net spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com
More information about the Filepro-list
mailing list