|
JT >> That's in the C-world. CPF checks number of parms, Sorry but you are wrong, the system doesn't do checks. The compilers can generate code to check and some do - to some extent. But they can only count number of parms which is only part of the story. For example, CL programs check for the right number of parms, but in RPG400 the compiler checks only for too many parms - not for too few. RPG IV doesn't check anything and will happily accept too many or too few. Try calling this RPG program with 1, 2, or 3 parameters and see what happens. C *entry PList C parm P1 1 C parm P2 1 C P1 Dsply C P2 Dsply p2 C Eval *InLR = *On >> and programs that pass wrong data types consistently error off. They don't corrupt data, generally speaking. If it is a data type mismatch then it _may_ blow up - but not always, and not predictably. A packed field will appear perfectly valid for character operations, but introduce (say) spaces into it in the called routine and you'll have lots of fun later. If you have never experienced this then all I can say is that you have been lucky. However, we are not just talking about data types. In fact corruption is more likely to occur with mismatched lengths - e.g. passing a ten character field to a routine that expects 20. The critical point is that if you are expecting the system to check for you then you are in for a nasty surprise at some point in time. Given that this conversation is about subprocedures - which means bound calls - we should also consider them here. They work differently and there is far less likelihood of a "missing" parm causing an immediate error since there may well be a valid pointer on the stack - it just won't be to the right data! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ >> OTOH: >> | Only nasty >> | explosions if you are lucky, and corrupted data if you are not. >> Is that why my posts are, apparently, being moderated by some group(s) of >> people, besides David?? I have absolutely no idea what you are talking about nor do I understand the relevance to this topic of the rant that follows so I'm going to pass on that. Jon Paris Partner400 www.Partner400.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.