If Statement/Operator Question

Jan Schenkel janschenkel at yahoo.com
Thu Jul 23 09:31:26 EDT 2009


Try using the 'value' or 'merge' functions to evaluate such dynamic expressions.
##
put "(item tField1 of line x of tdata)" && tCondition1 && "(field " & quote & "S1 Compare 1 Field" & quote & ")") into tExpression
if value(tExpression) is true then...
##

HTH,

Jan Schenkel
=====
Quartam Reports & PDF Library for Revolution
<http://www.quartam.com>

=====
"As we grow older, we grow both wiser and more foolish at the same time."  (La Rochefoucauld)


--- On Thu, 7/23/09, Warren Kuhl <warrenkuhl at gmail.com> wrote:

> From: Warren Kuhl <warrenkuhl at gmail.com>
> Subject: If Statement/Operator Question
> To: "Revolution" <use-revolution at lists.runrev.com>
> Date: Thursday, July 23, 2009, 6:20 AM
> Is it possible to pass the operator
> as a variable. When I try, the code
> doesn't seem to work. When I hardcode the operator,
> everything works fine.
> The problem is the operator can be different depending on
> what the user
> selects and I don't want to hardcode each condition if I
> don't have to.
> 
> Here is an example where tCondition1 could be =, >,
> >=, <, <=, etc.
> 
> When I try the following (tCondition1 is "="), I get no
> results....
> 
> if (item tField1 of line x of tdata) & tCondition1
> & (field "S1 Compare 1
> Field") then
> Answer "This works"
> delete line x of tdata
> end if
> 
> When I try the following, I get results...
> 
> if (item tField1 of line x of tdata) = (field "S1 Compare 1
> Field") then
> Answer "This works"
> delete line x of tdata
> end if
> 
> Thanks for any help!
> Warren
> _______________________________________________
> use-revolution mailing list
> use-revolution at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 


      



More information about the use-livecode mailing list