Mecki, Thanks for your ideas and help.
Correct, the READU will stop on a record locked condition which is not the problem. Also this is not my code, but represents maybe 2000 read statements that might be in the entire application that assumes that the CITEM will not be changed if the ELSE clause is taken (per the pick flavor behavior of $options read.retain). And yes, with all of my own original code, I always assume that the ITEM is undefined if the read fails and I always set the ITEM to null. But again, this is code I inherited and have to deal with the runtime aspect of something not working correctly under some unknown circumstance. I'm not sure how long this issue has been present since I just happen to go into this one screen and notice that a field that should be empty suddenly had a zero in it. Upon further investigation, I'm able to see that the ITEM record was not being left NULL by the READ statement in this particular case. Over the holiday break I'm hoping I can come up with some sort of concise reproducible case that anyone can execute to see the issue. If it was happening everywhere, it would be pretty easy, but so far I can only see this scenario in one screen and with the combination of a COMMON variable and a READU statement. If I replace the variable being used with a local variable, the logic works as expected; leaving the ITEM null as it should. If I change the READU to a READ it works. Sounds like a runtime bug to me. -Troy -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Mecki Foerthmann Sent: Wednesday, December 23, 2009 12:34 AM To: U2 Users List Subject: Re: [U2] [UV] odd problem with read statement assigning variable with random data with else clause in pick flavor Hi Firstly READU will not execute the ELSE clause when the item is locked. It will just sit there and wait for the lock to be released. Regardless if it is a bug or not, your piece of code just doesn't make sense. What do you actually try to achieve? You try to read a record and when it doesn't exist you want to set the variable to null, right? So you use READU CITEM FROM FILE THEN ... END ELSE CITEM = '' instead of CITEM = '' READU CITEM FROM FILE THEN ... END and your problem is solved. I always use the ELSE clause with any READ BTW Regards Mecki _______________________________________________ U2-Users mailing list [email protected] http://listserver.u2ug.org/mailman/listinfo/u2-users
