TIP: Click on subject to list as thread! ANSI
echo: nthelp
to: Geo.
from: Paul Ranson
date: 2005-09-19 22:10:18
subject: Re: Programming help

From: "Paul Ranson" 

I don't see a problem. I assume that 'Format' is a VB native and is safe.
Everything else is taking floating points and the worst that can happen is
a divide by zero type exception, you should ask him to test it but I expect
that the VB COM (or is it .Net?) stuff can handle it politely.

I'd be more interested in seeing the ASP stuff that presumably goes along with this.

Paul

"Geo."  wrote in message
news:432ee5d9$1{at}w3.nls.net...
> I've got a user who want's a dll file loaded on a web server here, I asked
> him for the source to the dll so I could see what it's doing and he sent
> me
> the below. Since I'm a novice with C++ I figured I'd ask what some of the
> C
> types here think of this as far as internet security, it didn't appear to
> me
> to have a lot of input checking so passing bad info in order to crash it
> might be possible but I dunno, would appreciate your opinion.
>
> Geo.
>
>
>
> VERSION 1.0 CLASS
> BEGIN
>  MultiUse = -1  'True
>  Persistable = 0  'NotPersistable
>  DataBindingBehavior = 0  'vbNone
>  DataSourceBehavior  = 0  'vbNone
>  MTSTransactionMode  = 0  'NotAnMTSObject
> END
> Attribute VB_Name = "ClsFinance"
> Attribute VB_GlobalNameSpace = False
> Attribute VB_Creatable = True
> Attribute VB_PredeclaredId = False
> Attribute VB_Exposed = True
>
> Public Function GetPV(dblRate As Double, dblPer As Double, dblPmt As
> Double,
> dblFv As Double)
> 'GetPV = Format(PV(dblRate, dblPer, dblPmt, dblFv), "Currency")
> GetPV = PV(dblRate, dblPer, dblPmt, dblFv)
> End Function
>
> Public Function GetPmt(dblRate As Double, dblPer As Double, dblPv As
> Double,
> dblFv As Double)
> 'GetPmt = Format(Pmt(dblRate, dblPer, dblPV, dblFv), "Currency")
> GetPmt = Pmt(dblRate, dblPer, dblPv, dblFv)
> End Function
>
> Public Function DoFormat(varExpression As Variant, strFormat As Variant)
> DoFormat = Format(varExpression, strFormat)
> End Function
>
> Public Function GetIPmt(dblRate As Double, Per As Double, NPer As Double,
> dblPv As Double, dblFv As Double)
> GetIPmt = IPmt(dblRate, Per, NPer, dblPv, dblFv)
> End Function
>
>
> Public Function GetPPmt(dblRate As Double, Per As Double, NPer As Double,
> dblPv As Double, dblFv As Double)
> GetPPmt = PPmt(dblRate, Per, NPer, dblPv, dblFv)
>
> End Function
>
> Public Function GetNextIR(dblCurRate As Double, dblMargin As Double,
> dblIndex As Double, dblMaxRate As Double, dblMinRate As Double,
> dblMaxChange
> As Double)
>
> If (dblCurRate  dblMaxChange)
> Then
>    GetNextIR = dblCurRate + dblMaxChange
>    Exit Function
> End If
>
> If (dblCurRate > dblMaxRate) And (dblCurRate - dblMaxRate > dblMaxChange)
> Then
>    GetNextIR = dblCurRate - dblMaxChange
>    Exit Function
> End If
>
> If Abs(dblCurRate - (dblMargin + dblIndex)) > dblMaxChange Then
>    If dblCurRate < dblMargin + dblIndex Then
>        If dblCurRate + dblMaxChange > dblMaxRate Then
>            GetNextIR = dblMaxRate
>            Exit Function
>        Else
>            GetNextIR = dblCurRate + dblMaxChange
>            Exit Function
>        End If
>    Else
>        If dblCurRate - dblMaxChange < dblMinRate Then
>            GetNextIR = dblMinRate
>            Exit Function
>        Else
>            GetNextIR = dblCurRate - dblMaxChange
>            Exit Function
>        End If
>    End If
> Else
>    If dblMargin + dblIndex > dblMaxRate Then
>        GetNextIR = dblMaxRate
>        Exit Function
>    Else
>        If dblMargin + dblIndex < dblMinRate Then
>            GetNextIR = dblMinRate
>            Exit Function
>        Else
>            GetNextIR = dblIndex + dblMargin
>        End If
>    End If
> End If
>
>
> End Function
>
>

--- BBBS/NT v4.01 Flag-5
* Origin: Barktopia BBS Site http://HarborWebs.com:8081 (1:379/45)
SEEN-BY: 633/267 270 5030/786
@PATH: 379/45 1 106/2000 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.