To the OP: are you using the AnsiString as a buffer (that contains
"several" strings)? Otherwise, using "MyString <> '' " would do
because #0 is only valid as terminator in UTF-8 too.
BTW, IIRC Delphi would generate faster code for the above construction
instead of "Length(MyString) <> 0" because
On Wed, Mar 5, 2008 at 7:29 PM, Vincent Snijders <[EMAIL PROTECTED]> wrote:
> Currently fpc 2.3.1 cannot build lazarus anymore. It fails on lines like
> MyStream.Write(' ',1);
One idea to solve this in a good way might be:
MyStream.Write(' ', SizeOf(Char));
or multiples of sizeof(char) for many
On 06 Mar 2008, at 22:22, Vincent Snijders wrote:
Peter Vreman schreef:
1. It is passed by value and not by reference.
The compile could decide to pass by reference, couldn't it.
That's what it did in the past, but that's a hack (because it's
passing a value without an address by refere
Peter Vreman schreef:
Currently fpc 2.3.1 cannot build lazarus anymore. It fails on lines like
MyStream.Write(' ',1);
The write method is declared as
function Write(const Buffer; Count: Longint): Longint
Why isn't passing literal constant to a formal const parameter allowed
anymore?
I se
> Marco van de Voort wrote:
> >
> > You can't. This is more like trying to do generics with macro's on C level.
> > And since FPC macro's afaik have no parameter syntax, this is not possible.
> >
> >
> Hmm, what about (+/-):
>
> type_of_elts_entry(type_ptr(integer(ary.elts ) + i *
> sizeof(typ
Marco van de Voort wrote:
I've started binding libsvn to FPC, and I have encountered the
following macro that I do not know how to translate:
#define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i])
The usage of such macro is as follows: APR_ARRAY_IDX (new_entries, i,
const char *);
How ca
I thought string should be accessed from 1 not 0 for compatibility.
And it is what I am doing.
for i := 1 to length(s) do ...
so I am not sure that using s[0] is safe
If memory serves, the [0] element was originally used to hold a byte that
was equivalent to the string length. This was in t
Le Mar 6, 2008 à 5:26 PM, Lucas Vasconcelos a écrit :
You can try access a UTF8String lika a array.
So, you can replace your test by
if mystringvar[0] <> '' then ...
I thought string should be accessed from 1 not 0 for compatibility.
And it is what I am doing.
for i := 1 to length(s) do
El Thu, 06 Mar 2008 13:09:34 +0100
"Lukas Gebauer" <[EMAIL PROTECTED]> escribió:
> It is IMHO bug in FPC, just because Synapse code working in
> Delphi/Kylix threads perfectly. It have a problem on FPC threads
> only, and as I see in this discussion, problem have other programs
> too, not just
You can try access a UTF8String lika a array.
So, you can replace your test by
if mystringvar[0] <> '' then ...
--
Lucas Vasconcelos
___
fpc-pascal maillist - fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal
> Currently fpc 2.3.1 cannot build lazarus anymore. It fails on lines like
> MyStream.Write(' ',1);
>
> The write method is declared as
>function Write(const Buffer; Count: Longint): Longint
>
> Why isn't passing literal constant to a formal const parameter allowed
> anymore?
1. It is passed b
> Changing my "procedure PError(msg:string)" to "procedure PError(const
> msg:string)" in TSocketThread.Execute in project2 also fixes the
> problem. This smells like a bug somewhere in fpc/rtl, since I don't
> think it should make a difference. Anyway, this gives me no clue on
> how to "fix" synap
> I've started binding libsvn to FPC, and I have encountered the
> following macro that I do not know how to translate:
> #define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i])
>
> The usage of such macro is as follows: APR_ARRAY_IDX (new_entries, i,
> const char *);
>
> How can I translat
Hello,
I've started binding libsvn to FPC, and I have encountered the
following macro that I do not know how to translate:
#define APR_ARRAY_IDX(ary,i,type) (((type *)(ary)->elts)[i])
The usage of such macro is as follows: APR_ARRAY_IDX (new_entries, i,
const char *);
How can I translate the "t
14 matches
Mail list logo