Subject Re: [firebird-support] Empty strings in API
Author Ivan Prenosil
>> Can empty string be represented both as
>> - pointer to zero
>> - zero pointer
>> or is the later one illegal ?
>>
>> I am aksing because isc_dsql_prepare() and isc_dsql_execute_immediate()
>> functions crash with access violation when empty statement is passed as zero pointer.
>
> I think in Delphi you should use NIL (str := nil) to empty pointers or
> PChar terminators (str := #0) for empty strings.
> I'm not sure if the first one will work, can you test it and give the
> result, please?

Delphi's long strings are always valid pointers, i.e. empty string
is represented as valid pointer pointing to zero, which is exactly
what Firebird needs.
It is unassigned PChar that causes troubles, i.e. "mypchar := nil"
will cause access violation.

Ivan