On 02/08/2013 08:08 PM, Tom Eastep wrote:

>> One suggestion on your todo list if/when you have the time:
>>
>> Suppose I have this: action1 with, say, 2 parameters which in turn calls 
>> action2 with the same number of parameters. In other words:
>>
>> action1
>> ~~~~~
>> action2($1,$2)
>>
>> As things stand, if I execute action1(-,something), the first parameter 
>> doesn't have a value (and rightly so), but that in effect screws up the 
>> action2 call. So, what I currently have to do is this:
>>
>> action1
>> ~~~~~
>> IF $1
>>   ?SET p1 $1
>> ?ELSE
>>   ?SET p1 "-"
>> ?ENDIF
>> IF $2
>>   ?SET p2 $2
>> ?ELSE
>>   ?SET p2 "-"
>> ?ENDIF
>> action2($p1,$p2)
>>
>> The above isn't very nice. Perhaps you may thing of allowing a call like 
>> "action2(,something) (first parameter is not specified) to avoid this - 
>> just a suggestion.
> 
> Why don't you simply use the 'DEFAULTS' feature in action2?

Don't mind that.

Rather:

?set $p1 $1 ? $1 : '-'
?set $p2 $2 ? $2 : '-'
action2( $p1, $p2 )

Still not perfect but simpler than what you suggested.

-Tom
-- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________

Attachment: signature.asc
Description: OpenPGP digital signature

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Shorewall-devel mailing list
Shorewall-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/shorewall-devel

Reply via email to