Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: tushar Kanvinde
  Where is tushar Kanvinde?
 Kolhapur, Maharastra
 India
 tushar Kanvinde
 To: Goma Ram
  Where is Goma Ram?
 Muscat
 Oman
 Goma Ram
 Tags
Subject: RE: Replace Command
Thread ID: 372500 Message ID: 373269 # Views: 34 # Ratings: 0
Version: Visual FoxPro 6 Category: General VFP Topics
Date: Wednesday, March 20, 2013 4:49:33 PM         
   


> >
> > Would you show us your code?
> >
> >

> > Cetin Basoz
> >
> > .Net has got better.Think about moving - check my blog:
> > My Blog
> > Blog (mirror) - sounds to be down
> >

> > Support Wikipedia
>
> IF (DOCNO_FLAG="Auto")
> store 0 to mdocn
> xnkey = str(year(mdocdt))
> sele docmast
> seek xnkey
> if not eof()
> DO WHILE .T.
> IF (FLOCK())
> mdocn = bR + 1
> repl bR with (bR + 1)
> UNLOCK
> EXIT
> ELSE
> WAIT WINDOW "Waiting for lock...!"
> ENDIF
> ENDDO
> else
> DO WHILE .T.
> IF (fLOCK())
> appe blank
> repl year with year(mdocdt)
> repl br with year*1000
> mdocn = bR + 1
> repl bR with (bR + 1)
> UNLOCK
> EXIT
> ELSE
> WAIT WINDOW "Waiting for lock...!"
> ENDIF
> ENDDO
> endif
> Mdoc = LEN(ALLTRIM(STR(Mdocn)))
> mdno = PADL(MDOCN,7,'0')
> Mdocno = Mdno
> ELSE
> MDNO=MDOCNO
> ENDIF
>
>
> in above BR = br + 1 is not getting replaced

What is the index on docmast ?

When you say

	Sele docmast
	Seek xnkey


are you sure that docmast is in the correct order?

Use RLOCK() instead of FLOCK().

Use INSERT INTO instead of APPEND BLANK and REPLACE

You are incrementing by 1 every time it there is a hit with a year. Are you sure you don't have more than 999 hits per year ?

What is the REPROCESS setting?

Maybe you should put a TIMEOUT clause in the WAIT WINDOW

Use m. for every variable

I don't think you need the mdocn variable

You can use

mdno = STR(docmast.BR,7)


You will get confused with all those similar variable names mdocn ,Mdoc ,mdno & Mdocno .

Regards
Tushar
http://weblogs.foxite.com/tushar/

ENTIRE THREAD

Replace Command Posted by Goma Ram @ 3/10/2013 1:12:49 PM
RE: Replace Command Posted by Cetin Basoz @ 3/10/2013 2:59:31 PM
RE: Replace Command Posted by Goma Ram @ 3/10/2013 4:19:40 PM
RE: Replace Command Posted by Cetin Basoz @ 3/10/2013 9:05:31 PM
RE: Replace Command Posted by Goma Ram @ 3/11/2013 6:44:21 AM
RE: Replace Command Posted by Cetin Basoz @ 3/11/2013 11:57:37 AM
RE: Replace Command Posted by Goma Ram @ 3/11/2013 1:52:45 PM
RE: Replace Command Posted by Cetin Basoz @ 3/11/2013 3:54:54 PM
RE: Replace Command Posted by tushar @ 3/20/2013 4:49:33 PM
RE: Replace Command Posted by Goma Ram @ 3/10/2013 4:41:18 PM
RE: Replace Command Posted by mk sharma @ 3/10/2013 5:24:22 PM
RE: Replace Command Posted by Goma Ram @ 3/18/2013 7:13:30 AM
RE: Replace Command Posted by mk sharma @ 3/18/2013 3:47:42 PM