| Mirage Source http://web.miragesource.net/forums/ |
|
| binary classes http://web.miragesource.net/forums/viewtopic.php?f=201&t=3946 |
Page 1 of 2 |
| Author: | Ligaman [ Tue Jul 08, 2008 9:53 pm ] |
| Post subject: | binary classes |
I have problem with my binary classes , i got that error "wrong number of arguments or invalid property assignment" and highlights FileExist on saveclasses sub. Here is my code: loadclasses sub Code: Sub LoadClasses() Dim FileName As String Dim i As Long Dim nFileNum As Integer Call CheckClasses FileName = App.Path & "/classes.fcl" nFileNum = FreeFile Open FileName For Binary As #nFileNum Get #nFileNum, , Max_Classes ReDim Class(0 To Max_Classes) As ClassRec Call ClearClasses For i = 0 To Max_Classes Get #nFileNum, , Class(i) If (i Mod 5) = 0 Then DoEvents Next i Close #nFileNum End Sub saveclasses Code: Sub SaveClasses() Dim FileName As String Dim i As Long Dim nFileNum As Integer FileName = App.Path & "\classes.fcl" nFileNum = FreeFile If FileExist(FileName, True) Then Kill FileName Open FileName For Binary As #nFileNum Put #nFileNum, , Max_Classes For i = 0 To Max_Classes Put #nFileNum, , Class(i) Next i Close #nFileNum End Sub checkclasses Code: Sub CheckClasses()
If Not FileExist("\classes.fcl") Then Call ClearClasses Call SaveClasses End If End Sub |
|
| Author: | Dragoons Master [ Tue Jul 08, 2008 10:07 pm ] |
| Post subject: | Re: binary classes |
It's exacly what it says... "wrong number of arguments or invalid property assignment" Wrong number of arguments... There is needed only one argument not two, remove that ", True"... |
|
| Author: | Ligaman [ Tue Jul 08, 2008 10:39 pm ] |
| Post subject: | Re: binary classes |
now i have RTE 52 in this Code: Function FileExist(ByVal FileName As String) As Boolean
If Dir(App.Path & "\" & FileName) = "" Then FileExist = False Else FileExist = True End If End Function |
|
| Author: | Dragoons Master [ Tue Jul 08, 2008 10:48 pm ] |
| Post subject: | Re: binary classes |
At SaveClasses sub, replace "FileName = App.Path & "\classes.fcl"" with "FileName = App.Path & "classes.fcl"" Just remove the \, the function already adds it so your making a double \(\\) |
|
| Author: | Ligaman [ Tue Jul 08, 2008 11:03 pm ] |
| Post subject: | Re: binary classes |
still the same problem RTE 52"bad file or number" i also removed the / in loadclasses and checkclasses but same problem,,, |
|
| Author: | Dragoons Master [ Wed Jul 09, 2008 12:18 am ] |
| Post subject: | Re: binary classes |
No... only one of them... If that doesn't work, well... Oh, just saw... remove the App.Path from the "FileName = App.Path & "/classes.fcl"" Just use: FileName = "classes.fcl" That's how the function works |
|
| Author: | Ligaman [ Wed Jul 09, 2008 12:13 pm ] |
| Post subject: | Re: binary classes |
Thanks it works i dont have an error server loads normally.Should i change the loadclasses as well? |
|
| Author: | Dragoons Master [ Wed Jul 09, 2008 4:13 pm ] |
| Post subject: | Re: binary classes |
It will probably bug too... |
|
| Page 1 of 2 | All times are UTC |
| Powered by phpBB® Forum Software © phpBB Group https://www.phpbb.com/ |
|