help

Enrique Arredondo henry at vegena.net
Fri Nov 9 15:13:25 PST 2007


----- Original Message ----- 
From: "Kenneth Brody" <kenbrody at bestweb.net>
To: <filepro-list at lists.celestial.com>
Sent: Friday, November 09, 2007 1:47 PM
Subject: Re: help


> 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?
>
> -- 

In the later case, then the system will say "No more codes available". then 
the user has to use 12 or 14.

There are gaps on the sequence so I guess I can't use the "-nl" lookup, so 
everytime it has to do all calculations until
it finds an available one.

So I'll try using the base command see if that works out.

Thanks :-)



More information about the Filepro-list mailing list