P
Peter Judge
Guest
Using the IF CAN-FIND THEN FIND approach means that there aren’t any stray error-ish conditions flying around (ie if you FIND NO-ERROR then if the find fails an error isn’t raised but the ERROR-STATUS handle is still populated with a messages and the ERROR flag is set to true). Whether you care about this depends on the kind of code you’re writing and how defensively you want to write your code. (I was affected by this a little while ago – there’s a thread on these forums somewhere discussing it). Oh, and the other thing you’ll probably need to use with the IF CAN-FIND THEN FIND approach is the RELEASE statement to remove any records in that buffer from the current record scope. My usage is closer to the below RELEASE buffer. IF CAN-FIND(buffer WHERE) THEN FIND buffer WHERE. // no need for no error here // without the release, there may be a record in scope if the CAN-FIND returned false IF AVAILABLE buffer THEN // do stuff
Continue reading...
Continue reading...