Re: [fpc-pascal] Re: Passing objects to libraries and back

2011-02-27 Thread Michael Van Canneyt
On Sun, 27 Feb 2011, Jonas Maebe wrote: On 27 Feb 2011, at 09:58, leledumbo wrote: Read the docs. If the size of the argument is greater than native pointer size, it would be passed by reference. If the docs say that somewhere, they are wrong. How a "const" parameter is passed is an imple

Re: [fpc-pascal] Re: Passing objects to libraries and back

2011-02-27 Thread Jonas Maebe
On 27 Feb 2011, at 09:58, leledumbo wrote: > Read the docs. If the size of the argument is greater than native pointer > size, it would be passed by reference. If the docs say that somewhere, they are wrong. How a "const" parameter is passed is an implementation detail (which hence could change

[fpc-pascal] Re: Passing objects to libraries and back

2011-02-27 Thread leledumbo
> this seems to be something that i'm learning about... it appears to be a > bit(???) different than what i am used to with TP/BP 6/7... > > in this case, does a const parameter point to the original or a copy of > the > original? Read the docs. If the size of the argument is greater than nat

Re: [fpc-pascal] Re: Passing objects to libraries and back

2011-02-26 Thread waldo kitty
On 2/26/2011 02:12, leledumbo wrote: is it allowed ? Yes, but watch out that is/as operator might not work as expected. can i pass ansistrings ? Yes, but only if you know what you're doing. NEVER modify the passed strings (it would confuse the reference counting). Use const parameter all th

Re: [fpc-pascal] Re: Passing objects to libraries and back

2011-02-26 Thread michael . vancanneyt
On Sat, 26 Feb 2011, Jonas Maebe wrote: On 26 Feb 2011, at 11:15, Michael Van Canneyt wrote: On Fri, 25 Feb 2011, leledumbo wrote: can i pass ansistrings ? Yes, but only if you know what you're doing. NEVER modify the passed strings (it would confuse the reference counting). Use const p

Re: [fpc-pascal] Re: Passing objects to libraries and back

2011-02-26 Thread Jonas Maebe
On 26 Feb 2011, at 11:15, Michael Van Canneyt wrote: > On Fri, 25 Feb 2011, leledumbo wrote: > >>> can i pass ansistrings ? >> >> Yes, but only if you know what you're doing. NEVER modify the passed strings >> (it would confuse the reference counting). Use const parameter all the time. > > It

Re: [fpc-pascal] Re: Passing objects to libraries and back

2011-02-26 Thread Michael Van Canneyt
On Fri, 25 Feb 2011, leledumbo wrote: is it allowed ? Yes, but watch out that is/as operator might not work as expected. can i pass ansistrings ? Yes, but only if you know what you're doing. NEVER modify the passed strings (it would confuse the reference counting). Use const parameter al

Re: [fpc-pascal] Re: Passing objects to libraries and back

2011-02-26 Thread Jonas Maebe
On 26 Feb 2011, at 08:12, leledumbo wrote: >> can i pass ansistrings ? > > Yes, but only if you know what you're doing. NEVER modify the passed strings > (it would confuse the reference counting). Use const parameter all the time. Or, alternatively, use the "cmem" unit in both the application a

[fpc-pascal] Re: Passing objects to libraries and back

2011-02-25 Thread leledumbo
> is it allowed ? Yes, but watch out that is/as operator might not work as expected. > can i pass ansistrings ? Yes, but only if you know what you're doing. NEVER modify the passed strings (it would confuse the reference counting). Use const parameter all the time. > i know that passing ansistr