I encounter another problem while trying to use DELEGATE Class method to perform calculation to return the result to the Calling FORM FrmMain.cs
Here are the error message:
Error 1 The left-hand side of an assignment must be a variable, property or indexer
this is the coding that generate the above error
dblTotalAmt=((this.dblLoanAmt*=this.dblInterest)/= 100);
------------------------------------------------
Class Delegate Coding:
Expand|Select|Wrap|Line Numbers
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace CSharpDelegate
- {
- class ClassDelegateCalculate
- {
- //declare the DelegateCalculatonClass
- public delegate double DelegateCalculate(double LoanAmt, double interest);
- //declare variables
- public double dblLoanAmt;
- public double dblInterest;
- public double dblTotalAmt;
- //constructor override
- public ClassDelegateCalculate(double Loan, double YearInt)
- {
- this.dblLoanAmt = Loan;
- this.dblInterest=YearInt;
- }
- //class methods - calculate interest on loan amount
- public Double propCalculate()
- //return variable back to calling Program
- {
- dblTotalAmt = (( this.dblLoanAmt *= this.dblInterest) /= 100);<--- error here return (dblTotalAmt);
- }
- }
- }