Hola a todos
A partir de este momento quiero decirles que por falta de tiempo trabajare unicamente en mi blog http://blog.williamsmolina.info incluyendo los temas relacionados con VB
Muchas gracias a todos, los espero en mi blog personal
Atentamente Williams Molina
Noviembre 17, 2009 a las 10:01 pm
Hola soy estudiante de Ing industrial y de sistemas. Me ayudarona programar un simulador del triangulo de pascal en visual basic. Me pueden ayudar a decirme como funciona esta programacion?
Gracias.
Public Function leeLinea(ByVal row As Integer, ByVal column As Integer, ByVal cantidad As Integer) As Long()
Dim i As Integer
ReDim buf(0 To cantidad – 1) As Long
For i = 0 To cantidad
buf(i) = Cells(row, column)
column = column + 2
Next i
leeLinea = buf
End Function
Public Function obtenSiguienteLinea(ByRef arreglo() As Long, ByVal cantidad As Integer) As Long()
Dim res(0 To cantidad) As Integer
Dim temp1(0 To cantidad) As Integer
Dim temp2(0 To cantidad) As Integer
Dim i As Integer
For i = 0 To cantidad – 1
temp1(i) = arreglo(i)
Next i
For i = 1 To cantidad
temp1(i) = arreglo(i – 1)
Next i
For i = 0 To cantidad
res(i) = temp1(i) + temp(i)
Next i
obtenSiguienteLinea = res
End Function
Public Sub imprimeLinea(ByVal pos As Integer)
End Sub
Sub pascal()
Dim currentSize As Integer
Dim buffer() As Long
Dim i As Integer
Dim j As Integer
Dim value As Integer
Dim sangria As Integer
sangria = 20
Cells(1, sangria) = 1
buffer = leeLinea(0, sangria, 1)
buffer = obtenSiguienteLinea(buffer, 1)
currentSize = 0
End Sub