Locked command question

Kenneth Brody kenbrody at bestweb.net
Wed Aug 3 09:31:58 PDT 2005


Quoting Don Coleman (Wed, 03 Aug 2005 12:20:20 -0400):

> I have a table that I need to test for two different situations.  First
> if the lookup fails and secondly if the record I am looking to is
> locked.  This is the first time I am using the locked command and I am
> getting an unexpected result in the following test table:
>
>    1 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If:
>        Then: end
>    2 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
> @KEYT    If:
>        Then: AA(4,ALLUP)="OC  "
>    3 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If:
>        Then: lookup req = labelreq  k=AA   i=A -npxw
>    4 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If: not req
>        Then: beep;msgbox "\r Patient group OC not found";end
>    5 -------   -   -   -   -   -   -   -   -   -   -   -   -   -   -   -
>          If: LOCKED(req)
>        Then: beep;msgbox "\r Patient group OC is locked";end
[...]
> If I am not in update mode on patient group OC I get no error message as
> expected.  However, if I am in update mode on record OC the error
> message I receive is line 4 - Patient group not found and not the
> expected message found on line 5.  Do I need to rearrange the tests
> being performed on lines 4 & 5 or do I have something wrong on my lookup
> flags.  I see in the help files & on-line manual that I must use the -p
> & -w flags.  This is my first use of the -w flag.  fP v5.0.6DN9 on
> WIN98SE laptop.  This programming will be used on a WIN2000 Advanced
> Server network with WIN2000 & XP Prof. clients.

The "-w" flag causes the lookup to fail (rather than wait) if the record
is locked.  You can then test if LOCKED(lookupname) is true, to check if
the record was locked.  However, you are checking for failure (for _any_
reason) prior to checking for failure-due-to-lock.

--
KenBrody at BestWeb dot net        spamtrap: <g8ymh8uf001 at sneakemail.com>
http://www.hvcomputer.com
http://www.fileProPlus.com


More information about the Filepro-list mailing list