dc_dbgather()
dc_dbgather()
Hi Roger;
I know you added a codeblock parameter to dc_dbgather() so we could reuse deleted records. If for example I used DC_ADDREC(3,.t.,2)
AS THAT code block would the system attempt to find and ultimately point to a reusable record and then update it.?
Lets assume I have a newly created record object oRecord for file CustMast.dbf. I want to use this record object to ADD a new customer record to CustMast but I want to first search to see if I have a deleted record to reuse.
Would this work?
CUSTMAST->(DC_DBGATHER(oRecord,.f.,.t.{||DC_ADDREC(3,.T.,2)}
I'm assuming DC_ADDREC will be executed first and return a pointer to the record number to be updated by DC_DBGATHER()
looking forward to Arizona. See you on Wednesday night.
Bob Volz
I know you added a codeblock parameter to dc_dbgather() so we could reuse deleted records. If for example I used DC_ADDREC(3,.t.,2)
AS THAT code block would the system attempt to find and ultimately point to a reusable record and then update it.?
Lets assume I have a newly created record object oRecord for file CustMast.dbf. I want to use this record object to ADD a new customer record to CustMast but I want to first search to see if I have a deleted record to reuse.
Would this work?
CUSTMAST->(DC_DBGATHER(oRecord,.f.,.t.{||DC_ADDREC(3,.T.,2)}
I'm assuming DC_ADDREC will be executed first and return a pointer to the record number to be updated by DC_DBGATHER()
looking forward to Arizona. See you on Wednesday night.
Bob Volz
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: dc_dbgather()
Bob,
We are also arriving Wednesday afternoon. See you then.
Cliff
We are also arriving Wednesday afternoon. See you then.
Cliff
Re: dc_dbgather()
I'm arriving wed 3:02 US air from Charlotte. Not sure of the flight number yet..
anybody want to share a ride ??
anybody want to share a ride ??
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: dc_dbgather()
I have a guy picking me up. I get in Wednesday at 3:54PM American Airlines flight 654 from JFK.
Let me know if you need a lift, I will tell him to bring a bigger car if necessary.
My cell is 203 733 7420.
Let me know if you need a lift, I will tell him to bring a bigger car if necessary.
My cell is 203 733 7420.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: dc_dbgather()
We arrive a 12:42 so we are a bit too early.
Re: dc_dbgather()
Bob,
I left you a msg on your phone.. i'd like to connect at the airport..
I left you a msg on your phone.. i'd like to connect at the airport..
Brian Wolfsohn
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Retired and traveling around the country to music festivals in my RV.
OOPS.. Corona Virus, so NOT traveling right now...
http://www.breadmanrises.com
FB travel group: The Breadman Rises
Re: dc_dbgather()
No problem. I will look for you there.
BV
BV
Re: dc_dbgather()
Hi Roger;
Still no answer on my dc_dbgather question?. Any help would be appreciated.
Bob Volz
Still no answer on my dc_dbgather question?. Any help would be appreciated.
Bob Volz
Re: dc_dbgather()
Sorry, I forgot about this.
Here's how you would do it.
Here's how you would do it.
Code: Select all
bLock := {||MyLockRoutine()}
DC_DbGather( oRecord, , , bLock )
FUNCTION MyLockRoutine()
LOCATE FOR Deleted()
IF Eof()
RETURN DC_AddRec()
ELSE
IF DC_RecLock()
dbRecall()
RETURN .t.
ENDIF
RETURN .f.
The eXpress train is coming - and it has more cars.
-
- Posts: 605
- Joined: Thu Jan 28, 2010 9:11 pm
- Location: Steven Point, Wisconsin USA
- Contact:
Re: dc_dbgather()
We use record recycling but don't currently use dc_dbgather(). We add a index tag that has a for clause limiting it to only deleted records. We would use this as opposed to the locate command. You may want to adapt Roger's suggestion to use this approach if you have very large files.
Cliff
Cliff