Dmitry Yemanov wrote:
> 16.10.2014 14:55, Geoff Worboys wrote:
>>
>> I've cut the problem down to the thing that's giving me
>> trouble: I want to return a non-null value when when the
>> input expression resolves to null. In the code below I'm
>> just trying to return a 0 (for the sake of the example).
>>
>> This executes but still gives me a null result:
>>
>> dsc* evlTestIt(Jrd::thread_db* tdbb, const SysFunction*,
>> Jrd::jrd_nod* args, Jrd::impure_value* impure)
>> {
>> fb_assert(args->nod_count == 1);
>> jrd_req* request = tdbb->getRequest();
>>
>> dsc* value = EVL_expr(tdbb, args->nod_arg[0]);
>> if (request->req_flags & req_null)
>> {
>> impure->vlu_desc.makeLong(0);
>> impure->vlu_desc.setNullable(false); // redundant??
> request->req_flags &= ~req_null;
>> return &impure->vlu_desc;
>> }
>> return value;
>> }
That did it. I knew I must be missing something obvious.
Thanks very much,
--
Geoff Worboys
Telesis Computing Pty Ltd
------------------------------------------------------------------------------
Comprehensive Server Monitoring with Site24x7.
Monitor 10 servers for $9/Month.
Get alerted through email, SMS, voice calls or mobile push notifications.
Take corrective actions from your mobile device.
http://p.sf.net/sfu/Zoho
Firebird-Devel mailing list, web interface at
https://lists.sourceforge.net/lists/listinfo/firebird-devel