Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: kacida piraku
  
 
 
 kacida piraku
 To: Koen Piller
  Where is Koen Piller?
 Santpoort-Zuid
 Netherlands
 Koen Piller
 Tags
Subject: RE: running Number
Thread ID: 365497 Message ID: 365553 # Views: 40 # Ratings: 0
Version: Visual FoxPro 9 Category: Other
Date: Friday, December 28, 2012 1:22:04 AM         
   


> > Dear expeert
> > I have running number 001 until 999, that over limit I want to continue with A01..A99 and continue with B001..B99.. end next , how can I do that???
> >
> > example
> > No
> > 001
> > .
> > .
> > 999
> > A01
> > A02
> > .
> > .
> > A99
> > .
> > .
> > B01
> > .
> > .
> > B99
> >
> > Thank
>
> Hi,
>
> Please try if following solves your problem:
>
>
> Parameters tnSeqNmbr
> 
> lcPrefix = ''
> Do Case
> 	Case Vartype(tnSeqNmbr) = 'N'
> 			lcAlSeq = Alltrim(Transform(m.tnSeqNmbr))
> 			lcAlSeq = PADL(m.lcAlSeq,5, ' ')
> 			lnPrefix = VAL(ALLTRIM(Left(m.lcAlSeq, 2)))
> 			lcAlSeq = PADR(Right(lcAlSeq, 3),3,'0')
> 			If tnSeqNmbr < 26999
> 				lcPrefix = Chr(64 + m.lnPrefix )
> 			Else
> 				If tnSeqNmbr > 26999
> 					lcPrefix = "Grr we are running out of single letters: "
> 					lcAlSeq  = TRANSFORM(m.tnSeqnmbr)
> 				Endif
> 			Endif
> 		lcAlSeq = m.lcPrefix + m.lcAlSeq
> Endcase
> Return lcAlSeq
> 
> 

>
> Regards,
>
> Koen


thank for all master.it's very helpful

ENTIRE THREAD

running Number Posted by kacida piraku @ 12/27/2012 8:45:19 AM
RE: running Number Posted by Manish Swami @ 12/27/2012 9:29:50 AM
RE: running Number Posted by Samir H. @ 12/27/2012 9:32:47 AM
RE: running Number Posted by Anders Altberg @ 12/27/2012 1:19:39 PM
RE: running Number Posted by kacida piraku @ 12/28/2012 1:21:05 AM
RE: running Number Posted by Rahul Moudgill @ 12/27/2012 2:40:25 PM
RE: running Number Posted by Koen Piller @ 12/27/2012 5:48:42 PM
RE: running Number Posted by kacida piraku @ 12/28/2012 1:22:04 AM