On 12 dec 2005, at 13:57, Micha Nelissen wrote:
It happens in more in Pascal. For example, single(longint_var) is
also not the same as single(pointer(longint_var)) (let's assume a
32bit system). In the former case, the longint is convert to a
floating point number with the same value. I
Jonas Maebe wrote:
It happens in more in Pascal. For example, single(longint_var) is also
not the same as single(pointer(longint_var)) (let's assume a 32bit
system). In the former case, the longint is convert to a floating point
number with the same value. In the latter case, you get a floa
On 12 dec 2005, at 13:30, Micha Nelissen wrote:
Taken from Delphi 7 help:
Mixing Delphi strings and null-terminated strings
* You can also use Pointer(S) to cast a long string to an untyped
pointer. But if S is empty, the typecast returns nil.
* PChar(S) always returns a pointer to a memory b
Graeme Geldenhuys wrote:
Taken from Delphi 7 help:
Mixing Delphi strings and null-terminated strings
* You can also use Pointer(S) to cast a long string to an untyped
pointer. But if S is empty, the typecast returns nil.
* PChar(S) always returns a pointer to a memory block; if S is empty, a
Jonas Maebe wrote:
Is that not also undocumented behaviour ?
I'm quite sure it isn't: afaik typecasting an ansistring to a pchar is
fully supported. This means that an empty ansistring must result in an
empty (as opposed to an invalid) pchar.
Taken from Delphi 7 help:
Mixing Delphi st
> -Original Message-
> From: [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED] Behalf Of Micha
> Nelissen
> Sent: 12 December 2005 11:18
> To: FPC developers' list
> Subject: Re: [fpc-devel] StrPos giving a access violation
>
>
> Jonas Maebe wrote:
> &
On Mon, 12 Dec 2005, Jonas Maebe wrote:
On 12 dec 2005, at 12:17, Micha Nelissen wrote:
strpos, I don't know about Delphi. If you typecast an ansistring to a
pchar, then the compiler makes sure that if the ansistring is empty (and
thus a null pointer), a valid pointer to an empty null-t
On 12 dec 2005, at 12:17, Micha Nelissen wrote:
strpos, I don't know about Delphi. If you typecast an ansistring
to a pchar, then the compiler makes sure that if the ansistring
is empty (and thus a null pointer), a valid pointer to an empty
null-terminated string is returned.
Is that
Jonas Maebe wrote:
strpos, I don't know about Delphi. If you typecast an ansistring to a
pchar, then the compiler makes sure that if the ansistring is empty
(and thus a null pointer), a valid pointer to an empty null-terminated
string is returned.
Is that not also undocumented behaviour ?
On 12 dec 2005, at 08:12, Graeme Geldenhuys wrote:
StrPos is expecting 2 PChar params and not a Pointer.
Please use PChar(lFrom) and PChar(lSearch) to let the compiler
make the proper string to PChar conversion.
You never ever can cast a string to a pchar using Pointer()
I see your point,
Marc Weustink wrote:
StrPos is expecting 2 PChar params and not a Pointer.
Please use PChar(lFrom) and PChar(lSearch) to let the compiler make the
proper string to PChar conversion.
You never ever can cast a string to a pchar using Pointer()
I see your point, and amended my code. Nonetheless
Jonas Maebe wrote:
No. I've fixed it and added a test. You can check whether something has
been reported as a bug by going to
http://www.freepascal.org/bugs.html
Thanks for that!
If possible, a copy of your unit tests would be nice addition to our
test suite.
I will go through the unit
Graeme Geldenhuys wrote:
Hi,
The 3rd unit test fails due to StrPos giving a access violation. I ran
this same unit test under Delphi 7 and it passed as StrPos returned a
nil value when passing two '' param values.
Has this been reported as a bug yet?
- CUT --
On 8 dec 2005, at 13:26, Graeme Geldenhuys wrote:
The 3rd unit test fails due to StrPos giving a access violation. I
ran this same unit test under Delphi 7 and it passed as StrPos
returned a nil value when passing two '' param values.
Has this been reported as a bug yet?
No. I've fixed
14 matches
Mail list logo