|
-
Nov 22nd, 2000, 12:47 PM
#1
Ok..it has been so long since i have done this that i cant get it to work!!! AAAUUURRGGGHH!!!
this is the function:
Code:
Public Function MapPos(X As Integer, Y As Integer)
MyLoc.X = X * 217
MyLoc.Y = Y * 217
MyShip.Left = MyLoc.X
MyShip.Top = MyLoc.Y
End Function
trying to call the function:
Code:
Private Sub Command1_Click()
z = 1
g = 5
MapPos z, g
End Sub
I get a ByRef Type Mismatch and it points to the z???!!??
ok...Help PLEASE!
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
-
Nov 22nd, 2000, 12:52 PM
#2
Frenzied Member
Not sure but declare z and g as integer
-
Nov 22nd, 2000, 12:53 PM
#3
New Member
Declare Your Variables As An Int
You obviously do not have Option Explicit Turned On
for Variable Declaration.
Change To
Private SubCommand1_Click()
'Or Dim z As Integer, g As Integer if you prefer
Dim z%, g%
z = 1
g = 5
Call MapPos(z, g)
'Or Ret_Val = MapPos(z, g) if you want to get a
' a value returned
End Sub
Corby Nichols
[Edited by Corby on 11-22-2000 at 12:55 PM]
-
Nov 22nd, 2000, 12:59 PM
#4
oops!
oh yeah...
Dont I feel stupid. I did declare Z & G but i did this
Dim z,g as integer (not dim Z as intger, g as integer)
Y'know...sometime ya just blank on something that is staring you in the face!
THANKS! 
JPnyc rocks!! (Just ask him!)
If u have your answer please go to the thread tools and click "Mark Thread Resolved"
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
|