Brian
Had You tried
WRITE X ON F.Y,KEY ON ERROR
  IF something THEN
   do what
 END ELSE
   do else
 END
END
It should work.

Lembit Pirn
Seitse pluss Seitse O\
Tondi 1
Tallinn 11313
+372 6566232
[EMAIL PROTECTED]
----- Original Message ----- From: "Brian Leach" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, October 11, 2004 5:40 PM
Subject: RE: [U2] Syntax for WRITE ... ON ERROR



Wendy,

Write MyRecord On MYFILE, MyID ON ERROR
 Crt "file write failed e.g. permissions error"
End Then
 Crt "This worked a treat"
End Else
 Crt "This failed miserably"
End

Brian


-----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Wendy Smoak Sent: 09 October 2004 00:46 To: [EMAIL PROTECTED] Subject: [U2] Syntax for WRITE ... ON ERROR

From the manual:
WRITE
Syntax
WRITE expr {ON | TO} [file.var,] record.ID.expr [ON ERROR statements]

There's no 'END', so how does it know what belongs to 'ON ERROR' and what's
just the next line of the program?


I need to put an IF statement in the ON ERROR clause, to check for the
STATUS()=10 and do something different if that happens.

A quick test shows that I only get one line for ON ERROR-- code on a second
line beneath it gets executed whether the write succeeds or not (though I
didn't try an IF block).


Any advice?  A GOSUB statement, or ??

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

________________________________________________________________________
This email was checked by MessageLabs SkyScan before entering Microgen.


________________________________________________________________________ This email was checked on leaving Microgen for viruses, similar malicious code and inappropriate content by MessageLabs SkyScan.

DISCLAIMER

This email and any attachments are confidential and may also be
privileged.

If you are not the named recipient, please notify the sender
immediately and do not disclose the contents to any other
person, use it for any purpose, or store or copy the information.

In the event of any technical difficulty with this email, please
contact the sender or [EMAIL PROTECTED]

Microgen Information Management Solutions
http://www.microgen.co.uk
-------
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