Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

[EO] Method or data member not found (SOLVED)


Jaiden
 Share

Recommended Posts

I'm having some trouble compiling code. I looked around the forums and found similar problems but I'm not really sure on how to fix the issue.

I added "Sex Based Requirements for Equips" to the source.
http://www.touchofdeathforums.com/smf/index.php/topic,68906.0.html

The game runs in VB6 fine but I can't compile it due to the error "Compile Error: Method or data member not found."

The function is:
```
Function GetPlayerSex(ByVal Index As Long) As Long
    ' If debug mode, handle error then exit out
    If Options.Debug = 1 Then On Error GoTo errorhandler

    If Index > MAX_PLAYERS Then Exit Function
    GetPlayerSex = Player(Index).Sex

    ' Error handler
    Exit Function
errorhandler:
    HandleError "GetPlayerSex", "modDatabase", Err.Number, Err.Description, Err.Source, Err.HelpContext
    Err.Clear
    Exit Function
End Function
```
It highlights .sex in the following line. I'm assuming something is undeclared.

```
GetPlayerSex = Player(Index).Sex
```
Link to comment
Share on other sites

Well, I went back and looked it over and I got the same problem on compile. I took that function out entirely and it fixed the problem, from what I can tell. It seems that there's a lot of loose code in my tutorial. I'll have to go back and clean that up. If you could try it and let me know what you get that would be appreciated.
Link to comment
Share on other sites

You didn't add it to the UDT.

Of course, removing that line of code _makes the function completely useless and will destroy the system._

It's just a dodgy tutorial. You get those around. Post on the thread and hope someone helps you. In the mean time learn to do things for yourself.
Link to comment
Share on other sites

@Robin:

> You didn't add it to the UDT.
>
> Of course, removing that line of code _makes the function completely useless and will destroy the system._
>
> It's just a dodgy tutorial. You get those around. Post on the thread and hope someone helps you. In the mean time learn to do things for yourself.

Thank you, I was afraid it was something like that.

Yes I need to learn to do things for myself, I suppose my method of learning is asking questions though. I don't have a problem working with the source, I just don't have a complete understanding of how everything works and where to find what I need to find.

@aℓνιη:

> You must add to PlayerRec this:
>
> Sex As Byte
>
> …in modTypes

I believe this is what I was looking for. I'll try it out, thanks!
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...