Skip to content

Modern Finance CashFlowAt

Paul Squires edited this page Oct 19, 2026 · 4 revisions

Home › Finance › Finance › CashFlowAt

CashFlowAt

Returns a cash flow with no date, placed by its period number.

Syntax

CashFlowAt( amount, period )

Examples

#import "std/money"
using money

'' A period-indexed flow: Date_ is Invalid, deliberately, because the
'' POSITION in the caller's array already carries the period.  The
'' 'period' argument is for readability at the call site.
dim as CashFlow c = CashFlowAt( DecimalParse( "-1000" ).Value( ), 0 )

print c.Amount_.ToString( )              '' -1000
print c.Date_.IsValid                    '' false

'' Handing one to a DATED function is a named refusal rather than a
'' silent treatment of day zero.
dim as CashFlow f( 0 to 1 )
f( 0 ) = CashFlowAt( DecimalParse( "-100" ).Value( ), 0 )
f( 1 ) = CashFlowAt( DecimalParse( "200" ).Value( ), 1 )
print InternalRateOfReturnOnDates( f( ), DAYCOUNT_ACTUAL_365_FIXED ).Failure( ).Message( )

Library: Finance
Category: Finance
Documented under: Nothing Becomes A Keyword
Source: pkg/std/money/fincash.tiko in the tiko repository.

Clone this wiki locally