Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Why isn't this IIF expression working?
Message
From
17/08/2000 10:42:42
 
 
To
17/08/2000 08:13:50
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00406009
Message ID:
00406090
Views:
24
>IIF (THISFORM.text18.VALUE <0,THISFORM.text18.FORECOLOR=RGB(255,0,0) , THISFORM.text18.FORECOLOR=RGB(0,0,0))

What your code is doing is evaluating if the current forecolor equals read, and then returning the logical value to nothing. IIF() evaluates and returns the 2nd and 3rd parameters, it doesn't execute them.

So, what you want is this:

THISFORM.text18.FORECOLOR = IIF (THISFORM.text18.VALUE <0, RGB(255,0,0) ,RGB(0,0,0))

BTW, the space after the IIF doesn't make a difference.
Previous
Reply
Map
View

Click here to load this message in the networking platform