help
Nancy Palmquist
nlp at vss3.com
Fri Nov 9 11:56:26 PST 2007
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.
>
> Thanks
>
>
> _______________________________________________
> Filepro-list mailing list
> Filepro-list at lists.celestial.com
> http://mailman.celestial.com/mailman/listinfo/filepro-list
>
Easy solution is to use an index on the data.
Then if I understand you correctly, you want it look like this:
00,01,02,...,09,0A,0B,...,9Y,9Z,A0,A1,..., etc
This is a guess but here might be a good way to do that:
Make a string:
string="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
Then you need two counters: first(2,.0), second(2,.0)
first="1";second="1"
Guess=mid(string,first,"1")&mid(string,second,"1")
check the index for GUESS.
if "I do nto find a match" then "I GOT A NEW CODE" stop here.
if "I find a match" then second=second+"1"
if second gt "36"
then: first=first+"1";second="1"
if first gt "36"
then: I am done
Very rough logic but this will do it. just order the string the way you
want it to cycle past the values.
Nancy
--
Nancy Palmquist MOS & filePro Training Available
Virtual Software Systems Web Based Training and Consulting
PHONE: (412) 835-9417 Web site: http://www.vss3.com
More information about the Filepro-list
mailing list