Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

I'm trying to use functions, I'm still pretty new to this. I have two function calls going to two different functions. No matter which one I call first, only the first one will work, not the second. I've switched them around and its always which ever one I put first that works. Any thoughts?

 

            lblQualify.Text = CalADPSPayOffDate(CreditorNameArray, BalanceArray, MinMoArray, PctArray, PriorityArray, numRecs, accMargin, totalIncome)
           lblQualify.Text = Format(lblQualify.Text, "fixed")

           lblPlusQualify.Text = CalADPSPlusPayOffDate(CreditorNameArray, BalanceArray, MinMoArray, PctArray, PriorityArray, numRecs, curADPSPlusAccMargin, totalIncome)
           lblPlusQualify.Text = Format(lblPlusQualify.Text, "fixed")

Posted
Try putting Option Strict On at the top of the source file and fix any errors it throws up' date=' also could you post the code for the 2 functions themseleves?[/quote']

 

It still didn't work, I would love to be able to post the function, but its a company calculation, and I signed a contract stating that I can't do that. Has this ever happen to you before?

Posted
could you post the declaration for the two functions then? Also when you say the second call is 0 do you mean it returns 0? If so are the parameters you passing in correct?

 

Yes the second one always returns 0, and yes I'm passing it the correct parameters.

 

 

Function CalADPSPlusPayOffDate(ByVal CreditorName() As String, ByVal Balances() As Double, ByVal MinPymt() As Double, ByVal Pct() As Double, ByVal Priority() As Double, ByVal NumRecs As Integer, ByVal StartAccMargin As Double, ByVal curCombIncome As Double) As String

 

This is the same for both of them.

Posted

Now i'm trying to put the values of the arrays into different arrays for the second call. All the arrays are getting zero'd out after the function.

 

            Dim BalanceArrayPlus() As Double = BalanceArray
           Dim MinMoArrayPlus() As Double = MinMoArray
           Dim PctArrayPlus() As Double = PctArray
           Dim PriorityArrayPlus() As Double = PriorityArray

           lblQualify.Text = CalADPSPayOffDate(CreditorNameArray, BalanceArray, MinMoArray, PctArray, PriorityArray, numRecs, accMargin, totalIncome)
           lblQualify.Text = Format(lblQualify.Text, "fixed")

           lblPlusQualify.Text = CalADPSPlusPayOffDate(CreditorNameArray, BalanceArrayPlus, MinMoArrayPlus, PctArrayPlus, PriorityArrayPlus, numRecs, curADPSPlusAccMargin, totalIncome)
           lblPlusQualify.Text = Format(lblPlusQualify.Text, "fixed")

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...