[fpc-pascal] PWideChar vs. ^

2009-03-13 Thread Marc Santhoff
Hi, maybe this is a dumb question, but: If I have a variable declared as var s: PWideString; why is an exception (AV) thrown when using something := s^; but not when using something := PWideChar(s); ? Maybe this is special behaviour of the routine getting the variable, it is

Re: [fpc-pascal] PWideChar vs. ^

2009-03-13 Thread Jonas Maebe
On 13 Mar 2009, at 17:46, Marc Santhoff wrote: maybe this is a dumb question, but: If I have a variable declared as var s: PWideString; why is an exception (AV) thrown when using something := s^; but not when using something := PWideChar(s); ? Maybe this is special behaviour of

Re: [fpc-pascal] PWideChar vs. ^

2009-03-13 Thread Marc Santhoff
Am Freitag, den 13.03.2009, 18:14 +0100 schrieb Jonas Maebe: > > Please always include a compilable sample program when asking > questions about code behaviour. Without it, all that can be done is > hand waving. I was more interested in some general guidelines about using (pointers to) widest

Re: [fpc-pascal] PWideChar vs. ^

2009-03-13 Thread Jonas Maebe
On 13 Mar 2009, at 19:05, Marc Santhoff wrote: Am Freitag, den 13.03.2009, 18:14 +0100 schrieb Jonas Maebe: Please always include a compilable sample program when asking questions about code behaviour. Without it, all that can be done is hand waving. I was more interested in some general gu

Re: [fpc-pascal] PWideChar vs. ^

2009-03-13 Thread Marc Weustink
Marc Santhoff wrote: Hi, maybe this is a dumb question, but: If I have a variable declared as var s: PWideString; why is an exception (AV) thrown when using something := s^; but not when using something := PWideChar(s); ? You're mixing things up. A Widestring is a dynamic