Valhalla Legends Forums Archive | Visual Basic Programming | Function Problem

AuthorMessageTime
BaDDBLooD
[code]

Public Characters() As CharacterInfo

Public Type CharacterInfo
    Name As String
    Prefix As String
    Class As Classes
    Level As Byte
    Expiration As Date
    Difficulty As String
    Flags As String
    Dead As Boolean
End Type

Public Enum Classes
    Amazon
    Assassin
    Barbarian
    Druid
    Necromancer
    Paladin
    Sorceress
    Unknown
End Enum

[/code]

Each Item in the Array is a Character i Recieve in 0x19, Each Character has it's own Stats, as you can see.

in 0x19

[code]

    Case MCP_CHARLIST2
        Dim Count As Byte, Position As Integer
        Dim Name As String, Statstring As String

        Count = Asc(Mid(Data, 6, 1))
        Position = 12
        For I = 1 To Count
            Characters(I).Expiration = GetDWORD(Mid(Data, Position, 4))
            Position = Position + 4
            Name = Mid(Data, Position, InStr(Mid(Data, Position), Chr(0)) - 1)
            Characters(I).Name = Name
            Position = Position + Len(Name) + 1
            Statstring = Mid(Data, Position, InStr(Mid(Data, Position), Chr(0)) - 1)
            'Some Function
            Position = Position + Len(Statstring) + 1
           
            AddChat frmMain.rtbChat, vbCyan, Characters(I).Name
            AddChat frmMain.rtbChat, vbCyan, Characters(I).Expiration
           
            'AddChat frmMain.rtbChat, vbCyan, Characters(I).Class
            'AddChat frmMain.rtbChat, vbCyan, Characters(I).Dead
            'AddChat frmMain.rtbChat, vbCyan, Characters(I).Difficulty
            'AddChat frmMain.rtbChat, vbCyan, Characters(I).Flags
            'AddChat frmMain.rtbChat, vbCyan, Characters(I).Level
            'AddChat frmMain.rtbChat, vbCyan, Characters(I).Prefix
        Next I

[/code]

How would i go about writing a function like this:

Modified Statstring as an Argument, than Parses the Statstring into

EX:
Level
Class
Difficulty

( I can do this myself )

Than Export the Parsed Info, Back into the Array i had in 0x19

Characters(I).Level
Characters(I).Class
Characters(I).Difficulty

Thank you SO VERY Much

October 10, 2004, 6:28 AM
LivedKrad
Clarify your statements by using transitional words in the place of comparison words.

e.g.: "than" becomes "then"
October 14, 2004, 5:17 PM

Search