Hello lists,

     LePhuronn, if I had offended your wide/expertise with VB by posting
such observation/comment of negative indexes sorry for that. As an expert
maybe you can well explained better the code below,  in a way helping me
understand better (if you want to help though :-) ).  I'm not much of a user
of VB and I'm not the one who made this VB code.  As for my minute knowledge
of VB, the first thing I can comment on this code declaration is that the
numbers inside the parentheses are  supposed to be the index of that array
and as I had  noticed  the values ranges from -n to n. There are  statements
in this which uses negative values as index.  Are these index values? Are
these array declarations? As what I have read from VB MSDN, ReDim Statements
are used to reallocate storage space for dynamic array variables. The
whatever user defined name after ReDim must be an array.

      By the way, thanks Jakob for telling me to use property list. Yes, it
did work now but I'm still comparing the result with the excel spreadsheet
result.


---segment code of the VB program

 ReDim v(-n To n) As Double    ' option price
 ReDim s(-n To n) As Double    ' stock price


 --this is the part where the problem starts

 s(0) = spot
 For j = 1 To n Step 1
   s(j) = s(j - 1) * up
   s(-j) = s(-j + 1) * dn
 Next j

 For j = -n To n Step 2
   v(j) = dmax(phi * (s(j) - strike), 0)
 Next j




still learning,
ellen


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/lingo-l.cgi  To post messages to the list,
email [EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED])
Lingo-L is for learning and helping with programming Lingo.  Thanks!]

Reply via email to