|
On Tue, Jun 19, 2001 at 12:53:56PM -0700, Chris Rehm wrote: > Consider this: > x=3; > array[x] = x = 1; This is an undefined operation in C (right up there with 'array[x] = x++'), and no one reasonably familiar with the language would do it. I can't think of anything off the top of my head, but I would be very surprised if RPG were devoid of any statements whose behavior was officially undefined. > But more common, in your string of var1 = var2 = var3 = ... I have run > into this on occasion with dismay. That is because I am usually at that > point because I have to change the assignment to var6. Because the > original programmer took his cute little shortcut, my maintenance job is > peskier. So will the guy's job who must change assignments to var2 and > var9. I think the 'var1 = var2 = var3 = x' syntax is pretty clear. All of the variables are being set to the same value (that value which is rightmost in the chain). Want to set var2 to something else? Just take it out of the chain and put it in a separate statement. +--- | This is the RPG/400 Mailing List! | To submit a new message, send your mail to RPG400-L@midrange.com. | To subscribe to this list send email to RPG400-L-SUB@midrange.com. | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.