Nov 28, 2002 #1 bigdad Programmer Jul 17, 2001 34 VE Hi every body I´ve a doubt with this fuction, My question is: Can I take the result of this fuction and send it to a variable??? hope some body help me please thanks bigdad
Hi every body I´ve a doubt with this fuction, My question is: Can I take the result of this fuction and send it to a variable??? hope some body help me please thanks bigdad
Nov 28, 2002 #2 CJWARNER Programmer Nov 23, 2002 26 US I assume you mean IIF() and not IFF(). Try this: nValue = 399 thisval = IIF(TYPE('nValue')='N',MONTH(DATE()),CMONTH(DATE())) ? thisval Yes, you can assign the result of that function to a variable and use it as you need. Upvote 0 Downvote
I assume you mean IIF() and not IFF(). Try this: nValue = 399 thisval = IIF(TYPE('nValue')='N',MONTH(DATE()),CMONTH(DATE())) ? thisval Yes, you can assign the result of that function to a variable and use it as you need.
Nov 28, 2002 #3 fluteplr Programmer Oct 23, 2000 1,599 US Sure why whould you think you could not? IIF is just like any other function it returns a value which can be used anyplace you would use any other function. Example lswitch = .t. x = iif(lswitch,'Blue','Red') the value of x is 'Blue' Upvote 0 Downvote
Sure why whould you think you could not? IIF is just like any other function it returns a value which can be used anyplace you would use any other function. Example lswitch = .t. x = iif(lswitch,'Blue','Red') the value of x is 'Blue'
Nov 29, 2002 #4 weedz Programmer Dec 5, 2000 718 NL IIF() or Immediate If is just a replacement for: IF COndition Result2 ELSE Result2 ENDIF I use the IIF a lot for checking types like f.i. LPARAMETERS tcParamaeter tcParameter = IIF(VARTYPE(tcParameter) = 'C', tcParameter, Space(0)) In this case I make sure the parameter is always of type character and is by default an empty string. HTH, Weedz (Edward W.F. Veld) My private project:http://www.crowncap.demon.nl\info\crwnbaseDownload the CrownBase source code !! Upvote 0 Downvote
IIF() or Immediate If is just a replacement for: IF COndition Result2 ELSE Result2 ENDIF I use the IIF a lot for checking types like f.i. LPARAMETERS tcParamaeter tcParameter = IIF(VARTYPE(tcParameter) = 'C', tcParameter, Space(0)) In this case I make sure the parameter is always of type character and is by default an empty string. HTH, Weedz (Edward W.F. Veld) My private project:http://www.crowncap.demon.nl\info\crwnbaseDownload the CrownBase source code !!