Wendy - here's a snippet:
DONELOK = 0
LOOP UNTIL DONELOK = 1 DO
 READU LOKREC FROM CUSTOMERFILE,CUSTID LOCKED
  CRT TIMEDATE():\ port \:SYSTEM(18):\ file CUSTOMER item \:CUSTID:\locked!\
; SLEEP 1
 END THEN DONELOK = 1 ELSE LOKREC = '' ; DONELOK = 1
REPEAT

notice the LOCKED END THEN xxxx ELSE

Steve Trimble
Computerized Data Mgmt Inc
PO Box 3473
Fayetteville, AR 72702
(479) 521-5670
9:00am - 6:00pm CST
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Wendy Smoak
Sent: Friday, October 29, 2004 4:08 PM
To: [EMAIL PROTECTED]
Subject: [U2] READU ... THEN _or_ ELSE but not both?


>From the documentation:

READU dyn.array.var FROM [file.var,] record.ID.expr [LOCKED statements]
[ON ERROR statements] {THEN statements [END] | ELSE statements [END]}

Am I reading this right?  When I READU I can either have a THEN or an
ELSE, but not both?  (That it does not compile with both tends to
confirm that...)

At the moment I think I need both. :/ And I need to do the same thing in
either case, so I ended up with:

READU R.XBWU FROM F.XBWU, X.ONE.ID LOCKED
   CRT 'XBWU RECORD IS LOCKED, IGNORE IT'
END THEN
   X.LOCKED = '1'
END ;*END READU

IF X.LOCKED = '1' THEN
   CRT 'OBTAINED LOCK ON XBWU RECORD'
   R.XBWU<XBWU.ASURITE> = X.ASURITE
   WRITE R.XBWU TO F.XBWU, X.ONE.ID ON ERROR
      IF STATUS() = 10 THEN
         ;* Either the ASURITE or USER.ID is duplicated
         X.ERROR = X.DUPLICATE.ON.WRITE
      END ;* IF STATUS
   END ;* END WRITE
END ;* IF X.LOCKED

Suggestions for improvement are welcome!

--
Wendy Smoak
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/

Reply via email to