Jump to content

Need help with this


Recommended Posts

I am trying to build a list from a query run against a sybase db. This part works fine. My problem is this, I want to display values in a list depending 

on the value of certain fields  i.e. See below which works for two. Unfortunately, I need it to work for 3 values.  I don't know how I can do this for 3.  I did try doing a select case but I was getting errors.

 

i.e. if value =0  then "Card Check" if Value = - Then "Card Spend" Else "Money Added"

The below immediate iif works brilliantly for two but as I say I need to build this with 3 different values. 

 

 

$idItem = GUICtrlCreateListViewItem( _iif($adoRs.Fields("TransactionAmount").value =0, "Card check","Money Added") 

 

Any help appreciated.

Link to comment
Share on other sites

A few thoughts --

1) The _iif function is going away. Please read the help file entry on the Ternary operator

2) This is a good place where you could use Switch...EndSwitch. Again the help file is your friend here.

3) Please give your threads meaningful titles. Everyone needs help with something. ;)

4) You posted this in the wrong section.

Link to comment
Share on other sites

  • Moderators

@Ambient as mentioned please pay attention to where you post. The Examples forum disclaimer is kind of hard to miss:

Quote

Do not post general support questions here, instead use the AutoIt Help and Support forums

 

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...