lokome Posted June 24, 2009 Author Share Posted June 24, 2009 Please help me find whats wrong here (It says: Excpected Array) when i try to compile. Problem is somewhere in MOVES!```Function load_moves() On Error Resume Next Dim files() As String Dim filess As Integer Dim i As Integer Dim Moves As Boolean files = GetAllFilesInDir(App.Path & "\CyMoves\") filess = UBound(files) If filess < 3 Then MsgBox "Error loading moves, only " & filess & " files found!" End End If ReDim Moves(filess + 1) As MoveRec For i = 1 To filess Call SetStatus("Loading " & filess & " moves... " & Round(i / filess * 100) & "%") If InStrB(files(i), ".ini") Then Call load_move(files(i), i) End If ModDoEvents Next i If Err.number <> 0 Then MsgBox "Error loading: #" & Err.number & " (" & Err.Description & ")" End IfEnd Function``` Link to comment Share on other sites More sharing options...
lokome Posted June 24, 2009 Author Share Posted June 24, 2009 Ahh… C`mon be more active pls :D Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 24, 2009 Share Posted June 24, 2009 Wait, this isn't scripting; are you trying to modify the source (VB6), or the Main.txt in the Server\Scripts\ directory?PS: Do not double-post, bumping your topic so quickly (within two hours?); most users providing support usually check the oldest topics first, so it's first-come, first-serve; if you bump your topic, it takes longer. Link to comment Share on other sites More sharing options...
lokome Posted June 24, 2009 Author Share Posted June 24, 2009 Well yes. Modify source. Adding some things Link to comment Share on other sites More sharing options...
Admiral Refuge Posted June 24, 2009 Share Posted June 24, 2009 @lokome:> Well yes. Modify source. Adding some thingsOkay, sorry, thought you were asking about a _script_; anyway, I'll move this to where it should have been posted in the first place, the http://www.touchofdeathforums.com/smf/index.php/board,93.0.html board.Also, please try to have alittle patience; people from all over the world come to this forum, and most have entirely differnet timezones. Link to comment Share on other sites More sharing options...
lokome Posted June 24, 2009 Author Share Posted June 24, 2009 Help!! Link to comment Share on other sites More sharing options...
balliztik1 Posted June 24, 2009 Share Posted June 24, 2009 GetAllFilesInDir is of type Variant. You are dimming Files() as String. Maybe that could be cause for error? Link to comment Share on other sites More sharing options...
lokome Posted June 25, 2009 Author Share Posted June 25, 2009 Maybe Moves are defined incorrectly ? Link to comment Share on other sites More sharing options...
Akselj Posted June 25, 2009 Share Posted June 25, 2009 Why is it an function but theres not any return value? Link to comment Share on other sites More sharing options...
balliztik1 Posted June 25, 2009 Share Posted June 25, 2009 Yes, moves is declared incorrectly. It must be an array. Link to comment Share on other sites More sharing options...
lokome Posted June 25, 2009 Author Share Posted June 25, 2009 And how should it be right?Dim Moves As Array(filess + 1) ? Link to comment Share on other sites More sharing options...
balliztik1 Posted June 25, 2009 Share Posted June 25, 2009 Just:Dim Moves() Link to comment Share on other sites More sharing options...
lokome Posted June 25, 2009 Author Share Posted June 25, 2009 Should look like this?? :```Function load_moves() On Error Resume Next Dim files() As String Dim filess As Integer Dim I As Integer Dim Moves() files = GetAllFilesInDir(App.Path & "\CyMoves\") filess = UBound(files) If filess < 3 Then MsgBox "Error loading moves, only " & filess & " files found!" End End If ReDim Moves(filess + 1) For I = 1 To filess Call SetStatus("Loading " & filess & " moves... " & Round(I / filess * 100) & "%") If InStrB(files(I), ".ini") Then Call load_move(files(I), I) End If ModDoEvents Next I If Err.number <> 0 Then MsgBox "Error loading: #" & Err.number & " (" & Err.Description & ")" End IfEnd Function ```But then again.. It shows "Error loading acidpalace.ini #9: Subscript out of range)"And all files that he tries to load from moves map gives this error.. Link to comment Share on other sites More sharing options...
Akselj Posted June 25, 2009 Share Posted June 25, 2009 Add Moves = filess + 1 Link to comment Share on other sites More sharing options...
lokome Posted June 25, 2009 Author Share Posted June 25, 2009 When i add Moves = Files + 1Gives me error: "Can`t assign to array" Link to comment Share on other sites More sharing options...
lokome Posted June 25, 2009 Author Share Posted June 25, 2009 Again no one ? :D Link to comment Share on other sites More sharing options...
balliztik1 Posted June 25, 2009 Share Posted June 25, 2009 @lokome:> Should look like this?? :> ```> Function load_moves()> On Error Resume Next> Dim files() As String> Dim filess As Integer> Dim I As Integer> Dim Moves()> files = GetAllFilesInDir(App.Path & "\CyMoves\")> filess = UBound(files)> If filess < 3 Then> MsgBox "Error loading moves, only " & filess & " files found!"> End> End If> ReDim Moves(filess + 1)> For I = 1 To filess> Call SetStatus("Loading " & filess & " moves... " & Round(I / filess * 100) & "%")> If InStrB(files(I), ".ini") Then> Call load_move(files(I), I)> End If> ModDoEvents> Next I> If Err.number <> 0 Then> MsgBox "Error loading: #" & Err.number & " (" & Err.Description & ")"> End If> End Function > ```> But then again.. It shows "Error loading acidpalace.ini #9: Subscript out of range)"> And all files that he tries to load from moves map gives this error..What's the load_move sub look like? Because this function isn't set up to return that error. It's not in this procedure. Link to comment Share on other sites More sharing options...
Akselj Posted June 26, 2009 Share Posted June 26, 2009 Still wondering,@AkselJ:> Why is it an function but theres not any return value? Link to comment Share on other sites More sharing options...
lokome Posted June 26, 2009 Author Share Posted June 26, 2009 Had it Fixed thank you.. I forgot to define some things.. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now