12-17-2022, 05:55 PM
I can not comprehend why a type declaration has to be attached to the function name here:
. . . but not here:
Code: (Select All)
Declare Function externesProgramm(extern As String) As String
. . .
Function externesProgramm$ (extern As String)
Dim As String pfad
pfad = extern
externesProgramm = pfad
End Function
. . . but not here:
Code: (Select All)
Option _Explicit
Declare Function endkapital (einzahlung as double, q as double, zeit as integer) As Double
Dim As Double einzahlung, zinssatz, q
Dim zeit As Integer
einzahlung = 2400.00 'Pro Jahr
zinssatz = 3.5
zeit = 21
'Zinsfaktor berechnen
q = (1 + (zinssatz / 100))
Locate 3, 3
Print Using "Das Endkapital betraegt nach ### Jahren: ###,###.## Euro"; zeit, endkapital(einzahlung, q, zeit)
End
Function endkapital (einzahlung As Double, q As Double, zeit As Integer)
Dim kapital As Double
kapital = (einzahlung * ((q ^ zeit) - 1) / (q - 1))
endkapital = kapital
End Function