On 25 Apr 2012, at 23:53, Amir wrote:
>> The reason is that ansistring is an implicit pointer type, unlike
>> shortstring. Assigning a constant ansistring to Result means simply that a
>> pointer to that series of spaces is copied into the Result pointer. If you
>> then start modifying Result
The reason is that ansistring is an implicit pointer type, unlike shortstring.
Assigning a constant ansistring to Result means simply that a pointer to that
series of spaces is copied into the Result pointer. If you then start modifying
Result by hacking behind the compiler's back (which is
On 25/04/2012 21:11, Amir wrote:
I am not sure what you mean be "your program is not valid". I am
initializing Result. Modify its content and ...
I already observed that if I use either shortstring or use indices to
modify Result, this problem does not occur. But still I can't see what
caus
On 25 Apr 2012, at 22:11, Amir wrote:
> I am not sure what you mean be "your program is not valid".
This is not valid when Result is an ansistring (or unicodestring), at least if
you afterwards start writing to Result via the CurDigits pointer:
> Result:= '';
>
> CurDigit:=
At 01:11 PM 4/25/2012, Amir wrote:
I am not sure what you mean be "your program is not valid". I am
initializing Result. Modify its content and ...
I already observed that if I use either shortstring or use indices
to modify Result, this problem does not occur. But still I can't see
what cau
I am not sure what you mean be "your program is not valid". I am
initializing Result. Modify its content and ...
I already observed that if I use either shortstring or use indices to
modify Result, this problem does not occur. But still I can't see what
causes this problem. And I believe it
You program isn't valid. You're assigning a constant (a global
variable) to Result, so you shouldn't change it's contents through a
pointer (if you change it normally the compiler+RTL will COW the
value).
You can use a shortstring or:
Result := StringOfChar(' ', 16);
-Flávio
On Tue, Apr 24, 2012
Hi,
I have encountered a strange problem. I developed the following function
as a faster implementation for IntToStr:
function MyIntToStr (n: Int64): AnsiString;
const
MaxLength= 16;
var
CurDigit: PChar;
Sign: Boolean;
begin
Result:= '';
CurDigit:= @(Result [MaxLe
Thanks for the quick reply, I'll make bug-report immediately.
On Mon, Sep 22, 2008 at 14:00, Michael Van Canneyt
<[EMAIL PROTECTED]> wrote:
>
>
> On Mon, 22 Sep 2008, Aleksa Todorovic wrote:
>
>> Hi!
>>
>>
>> As you can see, in the third case string is interpreted as
>> ShortString, not AnsiString
On Mon, 22 Sep 2008, Aleksa Todorovic wrote:
> Hi!
>
>
> As you can see, in the third case string is interpreted as
> ShortString, not AnsiString. Is this intended behaviour of compiler,
> or command-line processing bug?
This is intended behaviour.
The Mode switch resets some other switches.
Hi!
I've just hit this problem, and wanted to report it, so someone can
tell me if this is FPC or Lazarus bug.
==
Compiler version: 2.2.2
Lazarus version: svn trunk (revision 16671)
Description: If -Sh is used before -Mobjfpc on command-line, string is
interpreted as ShortString,
11 matches
Mail list logo