<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
OK I figured a few things out.<br>
<br>
First, you can not use LOCKED(file) eq "1" on an IF line, you have
to only use Locked(file)<br>
<br>
Second, you have to check for LOCKED before you check for NOT metro.<br>
<br>
In my tests, if the record was locked then the logic on line 12 was
true and it never got to the check for the LOCKED record. I guess
the -w on the lookup line will treat locked records like the lookup
failed, instead of waiting for the lock to release. (Verified by
the docs.) <br>
<br>
So check for LOCKED first then check for NOT.<br>
<br>
You have to use the -w or the waiting happens at the LOOKUP and
never continues to anything after that.<br>
<br>
So that seems to be how you get it to work.<br>
<br>
Sequence is:<br>
<br>
lookup blah -nx<big><b>pw</b></big><br>
if <b>Locked(lookup)</b> then do whatever.<br>
If <b>not lookup</b> then do whatever.<br>
<br>
I know I am supposed to wait for responses but I get on a roll and
since I got the flow worked out, I thought I would share to others.<br>
Nancy<br>
<br>
<br>
<br>
<div class="moz-cite-prefix">On 6/26/2014 2:05 PM, Nancy Palmquist
wrote:<br>
</div>
<blockquote cite="mid:53AC60ED.5060109@vss3.com" type="cite">
<pre wrap="">Ken,
I tried this abbreviated logic to see what was happening. I get a syntax
error at LOCKED( on line 13
If I put Locked(metro) eq "1" on an IF line I get the syntax error at EQ.
10 ------- - - - - - - - - - - - - - - - -
@keyr ■ If: ■
Then: ke(10,.0)="999" ■
11 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: lookup metro=metrodb k=ke i=a -nxpw ■
12 ------- - - - - - - - - - - - - - - - -
■ If: not metro ■
Then: end ■
13 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: n(5,.0)=LOCKED(metro) ■
14 ------- - - - - - - - - - - - - - - - -
■ If: n eq "1" ■
Then: msgbox "LOCKED RECORD" ■
15 ------- - - - - - - - - - - - - - - - -
■ If: ■
Then: end
On 6/26/2014 12:19 PM, Kenneth Brody wrote:
</pre>
<blockquote type="cite">
<pre wrap="">On 6/26/2014 12:11 PM, Nancy Palmquist wrote:
</pre>
<blockquote type="cite">
<pre wrap="">Fellow filepro developers,
I just wondered if anyone could save me some time testing out a possible
solution to a problem.
In a clerk session, (filepro 5.0 version) I have a lookup to a file like
this:
lookup file=myfile k=ke i=a -nxp
Can I tell right at that point if the record is locked and move
somewhere else in the programming?
if Locked(file) eq "1" then "do something"
</pre>
</blockquote>
<pre wrap="">[...]
You're already 99% of the way there...
Add the 'W" flag to the lookup:
Then: lookup file=myfile k=ke i=e -nxpw
Then you can test with:
If: locked(file)
Then: ... do something ...
</pre>
</blockquote>
<pre wrap="">
</pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Nancy Palmquist
Owner
Virtual Software Systems - <a class="moz-txt-link-abbreviated" href="http://www.vss3.com">www.vss3.com</a>
(412) 835-9417</pre>
</body>
</html>