Will RLOCK() cause EOF() returns .T. ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

Post Reply
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Will RLOCK() cause EOF() returns .T. ?

Post by huangchenmin »

Hi everyone
I met a rare situation.
there are program code in attachment.
It was something like following describtion:
1.Inner do while loop work with database B(work area 2) was surrounded in another do while loop.
2.the outer loop work with database A(work area 2).
3.Under specificed condition, record of database a will be locked inorder to process replacement.
4.the record was locked will unlock after replacement process finished.
5.exit loop.
6.back to work area 1 and skip, displaying message depends on EOF().
7. Whenever replacement was executed, EOF() returns .T..

please help!
BEST REGARDS
chen min
Attachments
MissOPD.zip
(46.74 KiB) Downloaded 225 times
MissOPD.zip
(46.74 KiB) Downloaded 218 times
User avatar
l3whmg
Posts: 694
Joined: Mon Feb 23, 2009 8:46 pm
Location: Italy
Contact:

Re: Will RLOCK() cause EOF() returns .T. ?

Post by l3whmg »

Hi Chen Min,
Can I suggest to you to use this syntax

IF MSOPD->(EOF()) ...
IF CO03L->(EOF()) ...
IF MSOPD->(RLOCK()) ...
DO WHILE !MSPOD->(EOF()) ...

and then test your program?

In other words, I think its' better to use alias everywhere.

Best regards
Luigi from Italy
www.L3W.it
User avatar
dhaine_adp
Posts: 457
Joined: Wed Aug 06, 2008 12:22 pm
Location: Manila, Philippines

Re: Will RLOCK() cause EOF() returns .T. ?

Post by dhaine_adp »

Hi,

I never encounter such problem with eof() and with rlock() returning logical TRUE. I took a quick glanced on your posted code. Please check your routine prior to calling the function mentioned on the posted code. Also if you can use alias instead of workarea number, that would help you a lot in trouble shooting problem like this. Luigi is also right by prefixing alias name. Oh, well it is more readable to use statement like this: "select MSOPD", as compared to statement "select 1".

use MSOPD alias MSOPD new
use ANOTHER alias ANOTHER new
use THIS alias THAT new

select MSOPD
got top
while !eof()

select MSOPD
dbskip()
end

Like this my friend, the bug is much easier to track. Happy hunting.....

Regards,

Daany
Regards,

Danny
Manila, Philippines
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: Will RLOCK() cause EOF() returns .T. ?

Post by huangchenmin »

l3whmg wrote:Hi Chen Min,
Can I suggest to you to use this syntax
.....
Best regards
Thanks for supports
huangchenmin
Posts: 157
Joined: Mon Jun 07, 2010 2:24 am

Re: Will RLOCK() cause EOF() returns .T. ?

Post by huangchenmin »

dhaine_adp wrote:Hi,

I never encounter such problem with eof() and with rlock() returning logical TRUE. I took a quick glanced on your posted code........
Regards,

Daany
Thanks for supports
Post Reply