|
-
Jun 7th, 2000, 11:41 PM
#1
Thread Starter
New Member
Option Base 1
Sub program(choice As Integer)
Print "I"
If choice = 0 Then
Print "am"
Else
Print "drink"
End If
End Sub
Private Sub Command1_Click()
Dim x As Integer
Dim wArray(5) As String
wArray(1) = E
wArray(2) = V
wArray(3) = I
wArray(4) = A
wArray(5) = N
Call iysam(2)
For x = 1 To 5
Print wArray(x)
Next x
Call iyam(0)
For x = 5 To 1 Step -1
Print wArray(x)
End Sub
when i run it i get a error on the call iysam(2).And when i put iyam after Sub Program it gives me a error too.
like this :Sub program iyam(choice As Integer)-gets a error
Ummm now how do I do that?
-
Jun 7th, 2000, 11:48 PM
#2
Hyperactive Member
You need to drop the program from the sub call and name it iysam() like so:
Your code now =
Sub program (choice as integer)
Your code should =
Sub iyam(Choice!)
Then you can pass any variable of the specified type to that sub.
Either that or change the name in the call to
Call program(2)
instead of
Call iysam(2)
...later
-
Jun 8th, 2000, 12:02 AM
#3
Thread Starter
New Member
thank you for the help so far.Right now when i press the start command button it prints
I
drink
I
am
Its supose to also print the array after that.But the arrays aren't printing out.What did i do wrong?
Ummm now how do I do that?
-
Jun 8th, 2000, 12:39 AM
#4
Hyperactive Member
Change Dim wArray(5) as String
to
Public wArray(5) as String
Then try this in the Sub iysam(Choice!):
Print "I"
If choice = 0 Then
Print "am"
Print wArray(Choice!)
Else
Print "drink"
Print wArray(Choice!)
End If
End Sub
.......later
-
Jun 8th, 2000, 05:16 AM
#5
Thread Starter
New Member
nope it gets a error with -Public wArray(5) as String
Ummm now how do I do that?
-
Jun 8th, 2000, 09:11 AM
#6
Thread Starter
New Member
printing arrays is pretty hard
Ummm now how do I do that?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|