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: Andrew Falanga <not_real@hp.com>
Date: Wed Mar 08 2006 - 18:22:01 CET

Bryan Oakley wrote:
> Andrew Falanga wrote:
>> Hi,
>>
>> I have a situation where I'm trying to pass the comparison operator
>> dynamically to a conditional. Something like this,
>> ...
>> when this executes, I get this error.
>>
>> syntax error in expression " $val1 $oper $val2 ": extra tokens at end of
>> expression
>>
>> So, how would I make this happen?
>
> One way is this:
>
> if "\$val1 $oper \$val2" {
>
>

Bryan,

Thanks. Your respons leaves the possibility that there are other ways
to accomplish this. What would they be?

---------------------------------------------
Andrew R. Falanga (a non-HP employee)
Hewlett-Packard Company
11311 Chinden Blvd.
Boise, Idaho
---------------------------------------------
Please note: The e-mail address is purposely
mangled. I do not wish my account at HP to
become a spam haven.
Received on Sun Apr 30 02:27:50 2006