|
hey all, now that i'm about as deep as i've ever been into this ile stuff, i'd really like some closure on some of the things i've learned. The discussions here on binding, C functions etc. the last couple of weeks have increased my understanding by leaps and bounds (as it seems others too, judging by the responses). I'm THIS CLOSE to having that little light in my head quit blinking and finally stay on to the point that I could do my procedures right the first time, without dinking with them to see what works best. could we have a discussion of the reasons for using const and/or value keywords for procedure parameters? I know what the manual says, but the light is still dim... here's what I THINK I know so far: 1. const means you are passing the value and don't expect it to change or need it to be returned when the function ends. 2. you specify value if you want it passed by value, if you don't specify, you pass by reference. 3. if you pass by reference, it takes up the same space in memory, so there is no 'moving' of data - the proc doesn't allocate it's own space for it, rather it uses the space allocated by the calling pgm. (I assume the caller passes a pointer to the procedure) that's about it. most of the above seems so simple, but there are gaps in my understanding of why THIS, and not THAT, unless THE OTHERTHING. under what circumstances is passing by value better than by reference? would you always specify const if you don't need or want the proc to change the data sent? in what instances would you not specify const for these types of parameters? can you mix value and const on the same parameter? thanks again to everyone who's contributed to these discussions. Rick
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.