IMJS
IMJS

Reputation: 891

Use of IF in a VB Macro function

I have encountered an Excel Macro (Excel VBA) code which is as shown below:

If(Param1<=0,ParamA,ParamB)

Assume that the input parameters Param1, ParamA and ParamB are already been calculated.

I need to know what exactly this code snippet do [or what kind of calculation is this?], so that I can implement the same logic in Java which I am supposed to do. Any idea on this would by highly appreciable.

Thanks in advance.

Upvotes: 0

Views: 55

Answers (1)

AlexR
AlexR

Reputation: 115328

Sounds like this is what ? operator of java does:

param1<=0 ? paramA : paramB

Upvotes: 1

Related Questions