|
On Thu, 13 Dec 2001, Peter Dow wrote: > > However, none of that answers why the method shown doesn't work. And > although I will probably change how I do it, I'd still like to know. And > I'd like to know the basic difference between VALUE and CONST. > The diff between VALUE and CONST... With CONST, you're passing by reference. That is the calling procedure is passing a pointer to the string to the procedure that gets called. It marks that pointer as "constant" to tell the called procedure that it's not allowed to change the data. That's why if you do something that could change the data, you'll get a compiler error. If you try to pass it by reference (unless that's also const) you'll also get a compiler error. You can't change a const parameter. Value makes a whole new copy of the string in the subprocedure. So, any changes you make to the data are legal, but are only visible within the subprocedure itself. The performance difference is that with CONST, the system has to copy a pointer -- 16 bytes -- when starting the procedure. With VALUE, the system has to copy the entire 32k. So, in your circumstances, value will take about 2000 times as long :)
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.