Newbie Needs Help with Arrays

I need some help withinitializing, read in value, & writing valueof Arrays, I am a college staudent and basically i am trying to make a algorithm in visual basic using these pseudocode from a school book. Does anyone know anything about turning these pseudocode into a working Visual basic code.

Basically this psuedocode code is suppose to initialize a one-dimensional

array called List

PSEUDOCODE:Initialize One-Dimensional Array

Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
List(sub)
ENDDO
Stop

Basically this psuedocode code is suppose to Input the value of sub into one-dimensional array called(List)

PSEUDOCODE:Input One-Dimensional Array

Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
READ List(sub)
ENDDO
Stop

Basically this psuedocode code is suppose to write the value of a one-dimensional array called(List)

PSEUDOCODE:Output One-Dimensional Array

Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
WRITE List(sub)
ENDDO
Stop

Basically this is what i came up with but no success each are sepparate program that are meant to run independantly from one another I was just saving time and space, I designed this to just run one at a time by calling each module from the main module.

Module A000
Public sub1 As Integer = 0
Public list As Array
Sub Main()
Call initialize()'these do not run together uncomment to

'call one module at one time
'Call Input()'these do not run together
'Call Output()'these do not run together
End Sub

End Module

Module B000
Public Function initialize() As Integer
Do While sub1 < 10
sub1 += 1
list(sub1) = 0
Loop
Return sub1

End Function
End Module

Module B010
Private Function input()
Do While sub1 < 10
sub1 += 1

Loop
Return sub1
End Function
End Module

Module B020
Private Function output()
Do While sub1 < 10
sub1 += 1
Console.WriteLine(list(sub1))
Loop
Return sub1

End Function
End Module

[2999 byte] By [lew26] at [2008-2-3]
# 1
lew26 wrote:

PSEUDOCODE: Initialize One-Dimensional Array

Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
List(sub)
ENDDO
Stop

Sub Initialize (ByVal Size As Integer)
Redim List(Size) 'List elements will automatically be set to 0
End Sub

lew26 wrote:

PSEUDOCODE: Input One-Dimensional Array

Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
READ List(sub)
ENDDO
Stop

Sub Input ()
Dim i As Integer
For i = LBound(List) to UBound(List)
List(i) = InputBox("Please enter a value for element " & i & ".")
Next i
End Sub


lew26 wrote:

PSEUDOCODE: Output One-Dimensional Array

Start
sub = 0
DOWHILE sub < 10
sub = sub + 1
WRITE List(sub)
ENDDO
Stop


Sub Output ()
Dim i As Integer
For i = LBound(List) to UBound(List)
MsgBox List(i)
Next i
End Sub
MikeBarker at 2007-9-8 > top of Msdn Tech,Visual Basic,Visual Basic Language...