[prev in list] [next in list] [prev in thread] [next in thread] 

List:       asterisk-dev
Subject:    Re: [asterisk-dev] [Code Review] Add FIELDNUM() function which
From:       Rod Dorman <rodd () polylogics ! com>
Date:       2010-07-30 17:47:07
Message-ID: 1404700198.20100730134707 () polylogics ! com
[Download RAW message or body]

On Friday, July 30, 2010, 12:23:04, Tilghman Lesher wrote:
> On Friday 30 July 2010 11:10:57 Rod Dorman wrote:
>> On Thursday, July 29, 2010, 22:03:54, Gareth Palmer wrote:
>> > On Thu, 2010-07-29 at 15:02 -0500, Tilghman Lesher wrote:
>> >> On Thursday 29 July 2010 14:51:22 Rod Dorman wrote:
>> >>> Why not use a -1 to signal an error?
>> >>
>> >> That would be fine, as well, as long as it's documented that way.
>> >
>> > The problem have with returning -1 is that constructs like
>> > GotoIf(${FIELDNUM(...)}?true:false) will take the 'true' path on error.
>>
>> That could be avoided by testing for greater than zero instead of for
>> true/false
>>
>> One thing I'm curious about is if LIST is just "apples" what would
>> ${FIELDNUM(LIST,/,apples)} return?
>>
>> I would argue that '1' is correct even though the delimiter isn't in
>> LIST.

> I don't see any reason why it wouldn't.

Which would mean that the delimiter not present in the string wouldn't
be considered an error.

> Have you tried it?

No I'm not tracking trunk at the moment.

-- 
rodd@polylogics.com     "The avalanche has already started, it is too
Rod Dorman              late for the pebbles to vote." - Ambassador Kosh



-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic