Any any of you see a reason this is not working right? Only one of the skills will not work correctly.
Character File:
VBCODE:Code:[SKILLS] character-skill = 0 99 23507590 character-skill = 1 99 13500000 character-skill = 2 99 14807330 character-skill = 3 99 16385611
Code:Dim TempLine1, FName1 As StringCode:Private Sub List1_DblClick() FName1 = App.Path & "\characters\" & List1.Text & ".txt" Open FName1 For Input As #2 Do While Not EOF(2) Line Input #2, TempLine1 Call processLine Loop Close #2 End SubCode:Public Sub processLine() If Left(TempLine1, Len("character-skill = 0")) = "character-skill = 0" Then skillsInfo$ = Trim(Mid(TempLine1, InStr(1, TempLine1, vbTab) + 1)) Call processSkills("attack", skillsInfo$) End If If Left(TempLine1, Len("character-skill = 1")) = "character-skill = 1" Then skillsInfo$ = Trim(Mid(TempLine1, InStr(1, TempLine1, vbTab) + 1)) Call processSkills("defence", skillsInfo$) End If If Left(TempLine1, Len("character-skill = 2")) = "character-skill = 2" Then skillsInfo$ = Trim(Mid(TempLine1, InStr(1, TempLine1, vbTab) + 1)) Call processSkills("strength", skillsInfo$) End If If Left(TempLine1, Len("character-skill = 3")) = "character-skill = 3" Then skillsInfo$ = Trim(Mid(TempLine1, InStr(1, TempLine1, vbTab) + 1)) Call processSkills("hitpoints", skillsInfo$) End If If Left(TempLine1, Len("character-skill = 4")) = "character-skill = 4" Then skillsInfo$ = Trim(Mid(TempLine1, InStr(1, TempLine1, vbTab) + 1)) Call processSkills("range", skillsInfo$) End If End SubThis is a screenshot of the output. See the strengthLv and strengthExp are both still "0" when they should not be.Code:Public Sub processSkills(ByVal skillName As String, ByVal incomingInfo As String) Dim skillInfo() As String Dim skillLv, skillExp As String skillInfo = Split(incomingInfo, vbTab) skillLv = skillInfo(0) skillExp = skillInfo(1) Select Case (skillName) Case "attack" attackLv.Text = skillLv attackExp.Text = skillExp Case "strength" strengthLv.Text = skillLv strengthExp.Text = skillExp Case "defence" defenceLv.Text = skillLv defenceExp.Text = skillExp Case "hitpoints" hitpointsLv.Text = skilllv hitpointsExp.text = skillExp End Select End Sub
![]()


Reply With Quote
