Jump to content
Sign in to follow this  

Parameter Function With Input Validation

Recommended Posts

In this function I have created some input validations.

MsgBox(262144,'Debug_Loan_Amortisation',_Loan_Amortisation(10000,3,24));### Debug MSGBOX
Func _Loan_Amortisation($A,$B,$C)
    Local $D, $E
    If BitAND(IsNumber($A),$A>0) And BitAND(IsNumber($B),$B>0,$B<=100) And BitAND(IsInt($C),$C>0) Then
            Return $D
        Return 0

As you can see the If BtAND( ... does the validation to check if it's a number, integer and some values must be <=100,etc.

I am wondering if this is the only way to do it ?

I would like to see some alternatives if possible.


Share this post

Link to post
Share on other sites


Thanks for the feedback and noticing the typo !!

the " 1-1 " can also be presented as, this reads better but has more brackets to plough throught.


Both giving the same result

Share this post

Link to post
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
Sign in to follow this  

  • Create New...