Re: How to dynamically pass operators to if?
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.tcl archive

Re: How to dynamically pass operators to if?

From: Helmut Giese <hgiese@ratiosoft.com>
Date: Wed Mar 08 2006 - 17:16:57 CET

On Wed, 08 Mar 2006 08:54:56 -0700, Andrew Falanga <not_real@hp.com>
wrote:

>Hi,
>
>I have a situation where I'm trying to pass the comparison operator
>dynamically to a conditional. Something like this,
>
>proc myproc { args } {
> # pull out of args what I need which, among other things will be
> # a couple of values for a comparison operation in an if conditional
>
> if { $val1 $oper $val2 } {
> # do lots of important stuff
> }
>}
>
Hi Andrew,
looks good to me.
I would put a
    puts "'$args'"
at the very beginning to see what exactly gets passed in (and maybe
another puts right before the 'if' to see exactly what 'if' sees.)
HTH
Helmut Giese
Received on Sun Apr 30 02:27:42 2006