RE: [U2] UV basic assignment error ?
As far as I can tell, UD doesn't have a BASIC runtime-error log. Oops - haphazard reading on my part. You're correct, of course. I actually get a lot of good information from the UniData logs that do exist, but then those are things that pertain more to what I normally do. And, as you pointed out, you shouldn't be making programming errors, anyway. ;-) OK - administering self-imposed cyber-spanking... Tim Snyder Consulting I/T Specialist U2 Lab Services Information Management, IBM Software Group --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] UV basic assignment error ?
Hi Scott, You need to initialise Y to null at the start too. Y = Regards, Jeff Marcos -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Scott Ballinger Sent: Tuesday, 11 September 2007 11:35 AM To: u2-users@listserver.u2ug.org; Dana Moore Subject: [U2] UV basic assignment error ? Here is a weird UV error condition that I just spent way too long debugging: CT BP SB SB 0001 X = 0002 IF X EQ THEN X = Y 0003 PRINT ONE 0004 PRINT TWO 0005 PRINT THREE 0006 PRINT X 0007 Y = A RUN BP SB ONE TWO THREE Program SB: Line 6, Variable X previously undefined. Empty string used. Why does the run-time error happen in line 6 instead of line 2? This is _not_ what I was expecting. In D3: :run bp sb [B10] in program sb, Line 2: Variable has not been assigned a value; zero used. ONE TWO THREE 0 I like the way D3 reports this better. Is this a normal, known UV thing? Perhaps this is just the first time I have ever tripped over it... /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] UV basic assignment error ?
REPOSTED FOR NON-MEMBER ADDRESS: Louie Bergsagel [EMAIL PROTECTED] Bounce Notice: If you read this list through Indexfocus, Nabble, or any other replicator - and you would like to be able to participate - sign up directly with us. Here's all you need to know: To subscribe or resubscribe please visit http://listserver.u2ug.org/. UniVerse only displays undefined errors when the variable is used. Probably to frustrate programmers who are used to other compilers. -- Louie Bergsagel North Coast Electric Seattle, WA -Original Message- From: [EMAIL PROTECTED] Program SB: Line 6, Variable X previously undefined. Empty string used. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] UV basic assignment error ?
All For anyone who didn't pick up on Charles' timely plug (thanks Charles): The U2UG have published a new Wiki. It's waiting for your content to turn this into the most complete resource for the IBM U2 community. You can find the Wiki on the U2UG website. Registration is separate, and all U2-ers are invited to contribute. Even if you can't write find the time to contribute a whole article, give us your thoughts and experiences or help to enhance the pages as they arrive. This is an exciting opportunity to harness and pass on the knowledge and expertise in this list for the community. Brian Scott, This is a known behavior. It is by design, so I won't even call it a bug, although it sure can be misleading, as you've found out! It's an excellent question ought to go under some sort of FAQ, in the new U2UG Wiki maybe. --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] UV basic assignment error ?
Chuck: Too bad UD doesn't feel the same way. :-( Bill -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stevenson, Charles Sent: Monday, September 10, 2007 10:00 PM To: u2-users@listserver.u2ug.org Cc: Dana Moore; Scott Ballinger Subject: RE: [U2] UV basic assignment error ? [snipped] Learn to routinely monitor uv/errlog for runtime errors like this that might slip by your users. You can catch these latent bugs and fix them at their source, rather than waiting for users to complain about bad data and wondering how it got that way. I've promised to add a Wiki article on monitoring uv/errlog, including some programs to do so. Chuck Stevenson --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] UV basic assignment error ?
Too bad UD doesn't feel the same way. :-( I'm not sure what this references, but UniData does have a series of log files. They're text files ($UDTBIN/*.log and $UDTBIN/*.errlog), and the information doesn't scroll away if you don't catch the entries quickly enough. Tim Snyder Consulting I/T Specialist U2 Lab Services Information Management, IBM Software Group 717-545-6403 [EMAIL PROTECTED] --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] UV basic assignment error ?
Tim: As far as I can tell, UD doesn't have a BASIC runtime-error log. All of the other logs rarely interest me, but they occasionally do, but this one is a must (or so I thought). I was told all previous UD developers don't make any BASIC coding errors, so I am the first to request such logging; I moved our application from D3 and you know D3 developers can't program. :-) Bill -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Timothy Snyder Sent: Tuesday, September 11, 2007 12:29 PM To: u2-users@listserver.u2ug.org Subject: RE: [U2] UV basic assignment error ? Too bad UD doesn't feel the same way. :-( I'm not sure what this references, but UniData does have a series of log files. They're text files ($UDTBIN/*.log and $UDTBIN/*.errlog), and the information doesn't scroll away if you don't catch the entries quickly enough. Tim Snyder Consulting I/T Specialist U2 Lab Services Information Management, IBM Software Group 717-545-6403 [EMAIL PROTECTED] --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
[U2] UV basic assignment error ?
Here is a weird UV error condition that I just spent way too long debugging: CT BP SB SB 0001 X = 0002 IF X EQ THEN X = Y 0003 PRINT ONE 0004 PRINT TWO 0005 PRINT THREE 0006 PRINT X 0007 Y = A RUN BP SB ONE TWO THREE Program SB: Line 6, Variable X previously undefined. Empty string used. Why does the run-time error happen in line 6 instead of line 2? This is _not_ what I was expecting. In D3: :run bp sb [B10] in program sb, Line 2: Variable has not been assigned a value; zero used. ONE TWO THREE 0 I like the way D3 reports this better. Is this a normal, known UV thing? Perhaps this is just the first time I have ever tripped over it... /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] UV basic assignment error ?
Scott, This is a known behavior. It is by design, so I won't even call it a bug, although it sure can be misleading, as you've found out! It's an excellent question ought to go under some sort of FAQ, in the new U2UG Wiki maybe. Here's the question, with an answer below: Here is a weird UV error condition that I just spent way too long debugging: CT BP SB SB 0001 X = 0002 IF X EQ THEN X = Y 0003 PRINT ONE 0004 PRINT TWO 0005 PRINT THREE 0006 PRINT X 0007 Y = A RUN BP SB ONE TWO THREE Program SB: Line 6, Variable X previously undefined. Empty string used. Why does the run-time error happen in line 6 instead of line 2? In an assignment like X = Y, all that happens is that X is pointed to the same address in the user's memory that Y is at. This is really nice when Y is a very long string. Rather than duplicating the string in memory, both X Y point to the same spot until one of them changes. At that point there are 2 strings. The problem here is that Y has never been assigned. So X is made to point to Y, which is just fine, until X actually gets used. At that point it tries to read what is in X (i.e., what is in Y) and yields an Undefined variable error. Solutions: * Correctly initialize Y. Obviously, Y should be initialized before it is used in X = Y. * If this is a subroutine where Y is an input argument that you have no control over, test it using ASSIGNED(Y) or UNASSIGNED(Y) functions before relying on it. * When debugging, look back to how the variable was assigned, realizing that simple assignments like X=Y mean the problem is with Y, not X. A Terrible, Horrible, Disgusting, but Common (Non)Solution: Do NOT BLINDLY INITIALIZE ALL VARIABLES at the top of a program. Initialize them intelligently exactly when needed, limiting their scope. I see this so often! I think it is because of programmers who are used to other languages with strongly typed variables that need to be DECLAREd at the top of the routine have an uncontrollable urge to declare variables in MV basic, but the closest they can come is to indiscriminately add Y='' or Y=0 to initialization. This actually HIDES BUGS! It is better to have the runtime bug that shows up the error, than have it run wrong silently. Suppose in the little test demo program below Y=0 was indiscriminately inserted at line 1. Maybe Y should be zero, maybe not. But we'd never see the runtime error that points out the bad logic. The bad logic remains, running silently in the background, the latent bug corrupting processing and data. Learn to routinely monitor uv/errlog for runtime errors like this that might slip by your users. You can catch these latent bugs and fix them at their source, rather than waiting for users to complain about bad data and wondering how it got that way. I've promised to add a Wiki article on monitoring uv/errlog, including some programs to do so. Chuck Stevenson --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] UV basic assignment error ?
Wow, looks like an error in the error reporting...wouldn't be the first time I've seen something like that -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Scott Ballinger Sent: Monday, September 10, 2007 18:35 To: u2-users@listserver.u2ug.org; Dana Moore Subject: [U2] UV basic assignment error ? Here is a weird UV error condition that I just spent way too long debugging: CT BP SB SB 0001 X = 0002 IF X EQ THEN X = Y 0003 PRINT ONE 0004 PRINT TWO 0005 PRINT THREE 0006 PRINT X 0007 Y = A RUN BP SB ONE TWO THREE Program SB: Line 6, Variable X previously undefined. Empty string used. Why does the run-time error happen in line 6 instead of line 2? This is _not_ what I was expecting. In D3: :run bp sb [B10] in program sb, Line 2: Variable has not been assigned a value; zero used. ONE TWO THREE 0 I like the way D3 reports this better. Is this a normal, known UV thing? Perhaps this is just the first time I have ever tripped over it... /Scott Ballinger Pareto Corporation Edmonds WA USA 206 713 6006 --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/ --- u2-users mailing list u2-users@listserver.u2ug.org To unsubscribe please visit http://listserver.u2ug.org/