2 nested IIFs: I don't get it!

Hi,

I don't get it! I have a memo field with the following "OnBeforePrint" handler:
 if <frxMySource."TEXT1"> = '' then
    Memo19.Text := <frxMySource."TEXT2">
  else if <frxMySource."TEXT3"> = '' then
    Memo19.Text := <frxMySource."TEXT1">
  else
    Memo19.Text := <frxMySource."TEXT3"> + ' / ' + <frxMySource."TEXT1">;

Works fine, is elegant!

But I'd like to pack this into two nested IIF expressions.
I always get an "invalid variant operation" error...

my try was:
[IIF(<frxMySource."TEXT1"> = '',
  <frxMySource."TEXT2">,
  [IIF(<frxMySource."TEXT3"> = '',
    <frxMySource."TEXT1">,
    <frxMySource."TEXT3"> + ' / ' + <frxMySource."TEXT1">
  )]
)]

What's wrong here?

Thanks!

Daniel

Comments

  • edited 2:10PM
    Improper use of inner '[]' symbols. Correct way is:
    [IIF(<frxMySource."TEXT1"> = '',
     <frxMySource."TEXT2">,
     IIF(<frxMySource."TEXT3"> = '',
       <frxMySource."TEXT1">,
       <frxMySource."TEXT3"> + ' / ' + <frxMySource."TEXT1">
     )
    )]
    
  • edited September 2004
    exactly! Thanks a lot!

Leave a Comment

Rich Text Editor. To edit a paragraph's style, hit tab to get to the paragraph menu. From there you will be able to pick one style. Nothing defaults to paragraph. An inline formatting menu will show up when you select text. Hit tab to get into that menu. Some elements, such as rich link embeds, images, loading indicators, and error messages may get inserted into the editor. You may navigate to these using the arrow keys inside of the editor and delete them with the delete or backspace key.