basic if else if statement

Discuss how to create custom stats, reports and HUD profiles and share your creations.

Moderators: WhiteRider, kraada, Flag_Hippo, morny, Moderators

basic if else if statement

Postby iatracker » Fri Jul 21, 2017 10:41 am

Hi ,

Can you fix my expression please and give me the basic typo for a simple if elseif structure ?!
i tried this one :? :

Code: Select all
if   (
(live_amt_stack / live_amt_bb) - 1 <= 2   , format('test 1') ,
else if (live_amt_stack / live_amt_bb) - 1 <= 3   , format('test 2') ,
'' )


thanx,
regards
iatracker
 
Posts: 91
Joined: Thu Jul 20, 2017 1:44 am

Re: basic if else if statement

Postby WhiteRider » Mon Jul 24, 2017 3:13 am

You don't need to use "else if" because "if" already has an else case; you can just nest "if" statements.
The basic IF is:
if( expression, "then", "else" )
..so you could nest is like this:
if( expression, "then", if( expression2, "then2", "else2" ) )

..so you want (I think):

if (
(live_amt_stack / live_amt_bb) - 1 <= 2 , format('test 1') ,
if ((live_amt_stack / live_amt_bb) - 1 <= 3 , format('test 2') ,'' )
)
WhiteRider
Moderator
 
Posts: 53972
Joined: Sat Jan 19, 2008 7:06 pm
Location: UK

Re: basic if else if statement

Postby iatracker » Mon Jul 24, 2017 6:49 am

thanx thats good
iatracker
 
Posts: 91
Joined: Thu Jul 20, 2017 1:44 am


Return to Custom Stats, Reports and HUD Profiles

Who is online

Users browsing this forum: No registered users and 31 guests

cron
highfalutin