IIF() returns the evaluation of the expressions in the 2nd and 3rd parameters, in your example, it would either
1) return .T. or .F., depending on the existing value of m.delegated,
2) or throw and error that m.delegated didn't exist
To get what you want with IIF(), do
m.delegated = IIF(org.delegated, 'Y', 'N')
m.contract = IIF(org.contract, 'Y', 'N')
>What's wrong here?
>
>IIF(org.delegated,m.delegated='Y',m.delegated='N')
>IIF(org.contract,m.contract='Y',m.contract='N')
>
>
>This below works, but why not IIF?
>
>IF org.delegated
> m.delegated='Y'
>ELSE
> m.delegated='N'
>ENDIF
>IF org.contract
> m.contract='Y'
>ELSE
> m.contract='N'
>ENDIF
>
>
>Chuck
Insanity: Doing the same thing over and over and expecting different results.