AYUDA EN LÍNEA
 WINDEVWEBDEV Y WINDEV MOBILE

Ayuda / WLanguage / Funciones WLanguage / Funciones estándar / Funciones de valores numéricos / Funciones financieras
  • Amortization matrix
FinRedemption (Example)
Amortization matrix
The following code is used to return an amortization matrix. The type of amortization is selected by the user via a radio button (RADIO_AmortType). The amount, the rate and the duration of the loan are entered by the user in edit controls (EDT_Amount, EDT_Rate, EDT_Duration). The amortization matrix is displayed in a memory table (TABLE_MatrixTable).
// -- Click code on BTN_Amortization
// Declare the variables
ResAmortization is boolean
ResAmortType is int // Retrieves the type of amortization
ResAdd is boolean
Index is int
// Retrieve the type of amortization
SWITCH RADIO_AmortType
CASE 1: ResAmortType = finInFine
CASE 2: ResAmortType = finConstantRedemption
CASE 3: ResAmortType = finConstantAnnualPayment
END
// Calculate the amortization
ResAmortization = FinRedemption("AmortMatrix", ResAmortType, EDT_Amount, EDT_Rate, EDT_Duration)
// Calculation error?
IF ResAmortization = False THEN
// Display the error message
Error(ErrorInfo(errMessage))
ELSE
// Display the matrix in a memory table
FOR Subscript = 1 TO MatNbLine("AmortMatrix") THEN
ResAdd = TableAdd(TABLE_MatrixTable, MatReadLine("AmortMatrix", Subscript))
END
END
Versión mínima requerida
  • Versión 9
Esta página también está disponible para…
Comentarios
Haga clic en [Agregar] para publicar un comentario

Última modificación: 06/04/2023

Señalar un error o enviar una sugerencia | Ayuda local