How to increment Alpha-Numeric code

Hi , I have 12 digit code that is categorised in different way ,.

AP\A\001\A\F0001 .

this code is stored in database that means upto F0001 the code is created , so when the next time the request page is open it will automatically show

AP\A\001\A\F0002 that means i have to start from this code .

the other alpha characters present in the code is based on certain condition like circle, location , sales person , manager .

can anyone give me the idea how it can be done coz i have to check all conditions and finally incremnted code will display .

Subject: How to increment Alpha-Numeric code

You answered your own question - you need to check all the conditions and then create the code based on the results. How you do this depends on how you’ve designed your system. LS is likely to be the best approach and you’ll probably use a combination of things like ‘if/then’, ‘case’, and probably some kind of document that holds increment numbers (so you know to go from 001 to 002).

There is code posted elseswhere on how to do incremental counters (hint - look in the FAQ of FAQs…)

I’d also recommend you just write out the process used to decide how you’ll create a new number, then write the code to match what you wrote out.

HTH and good luck.

Doug

Subject: RE: How to increment Alpha-Numeric code

I’ve used these way:Hidden Computed when compose number field: No_nu

Num := @Subset(@DbLookup(“” : “NoCache”; “”; “AutoNum”;@Year(@Created) ; 2); 1);

NewNum := @If(@IsError(Num); 1; Num + 1);

FIELD No_nu := NewNum;

No_nu

Computed Text field: DispNo_nu

NewNum:=@If(No_nu = 0; “”; No_nu);

TxtNum := @Text(NewNum);

FullID:=@Right(@Text(@Year(@Created));1)+@Repeat(“0”;3-@Length(TxtNum);2)+TxtNum;

FIELD DispNo_tx:= FullID;

DispNo_tx

So if I use it this year(2007), Numbers will be 7001,7002…7999

year 2006: 6001,6002…6999

year 2008: 8001,8002…8999

Oh also used a hidden view (AutoNum): with Year & No_nu fields