Lenton Posted December 26, 2008 Author Share Posted December 26, 2008 I have this code..```Dim UpdateNumberUpdateNumber = ReadINI("CONFIG", "Update", App.Path & "/config") + 1```..and I get an error on it. I have not a clue why do you? Link to comment Share on other sites More sharing options...
AdrianC Posted December 26, 2008 Share Posted December 26, 2008 "Config.ini" ?Dunno Link to comment Share on other sites More sharing options...
Tyr Posted December 26, 2008 Share Posted December 26, 2008 u use the statement totally wrong :pReadINI("HEADER", "KEY", PATH , DEFAULT VALUE)you just forgot a rec :) for an umber make default 0 should work. Link to comment Share on other sites More sharing options...
Lenton Posted December 26, 2008 Author Share Posted December 26, 2008 ```Function ReadINI(INISection As String, INIKey As String, INIFile As String)```Here's a random example found in the project that worked:```ReadINI("CONFIG", "Music", App.Path & "\config.ini")```EDIT: Also it was a runtime error "13" (type mismatch) Link to comment Share on other sites More sharing options...
AdrianC Posted December 26, 2008 Share Posted December 26, 2008 Lol, anyway, I'm not really into source. Link to comment Share on other sites More sharing options...
dg1423 Posted December 26, 2008 Share Posted December 26, 2008 put INT() around ReadINI Link to comment Share on other sites More sharing options...
Lenton Posted December 26, 2008 Author Share Posted December 26, 2008 You do it please becuse I don't really understand what you mean.Also what do I dim it as and what does it mean? Link to comment Share on other sites More sharing options...
Lenton Posted December 27, 2008 Author Share Posted December 27, 2008 Ok, I dimmed it as a "string" and took away the "+ 1". It worked fine…I need to add 1 to it but how?? Link to comment Share on other sites More sharing options...
Dark Crusade Posted December 27, 2008 Share Posted December 27, 2008 Lenton, next time use a normal topic name. thanks. Link to comment Share on other sites More sharing options...
Tyr Posted December 27, 2008 Share Posted December 27, 2008 @Lenton:> Ok, I dimmed it as a "string" and took away the "+ 1". It worked fine…> > I need to add 1 to it but how??so you mean it worked to get the data out of the ini?and you saved it into and integer or a long?if so, do this…gettting the VARIABLE...VARIABLE = VARIABLE + 1thats all :p Link to comment Share on other sites More sharing options...
cheatking Posted December 27, 2008 Share Posted December 27, 2008 Dim UpdateNumberUpdateNumber = ReadINI("CONFIG", "Update", App.Path & "/config")UpdateNumber = UpdateNumber + 1. Link to comment Share on other sites More sharing options...
Tyr Posted December 28, 2008 Share Posted December 28, 2008 what did i just say? oOanyhow does it works fine now? Link to comment Share on other sites More sharing options...
Lenton Posted December 29, 2008 Author Share Posted December 29, 2008 Lol, ok did it then I got the same error on this.. *sigh*```Dim Url as LongUrl = "http://www.mayhemonline.byethost5.com/patches/"```What do I dim it as and what do they mean? Long = ?, String = ?, interger = number?, etc.. Link to comment Share on other sites More sharing options...
cheatking Posted December 29, 2008 Share Posted December 29, 2008 String I think. Link to comment Share on other sites More sharing options...
Lenton Posted December 29, 2008 Author Share Posted December 29, 2008 Ty Sean, it worked.Also I fixed the first error by changing the code to this..Dim UpdateNumber as IntegerUpdateNumber = ReadINI("CONFIG", "Update", App.Path & "/config") **&** 1 Link to comment Share on other sites More sharing options...
emblem Posted January 3, 2009 Share Posted January 3, 2009 Dim UpdateNumber as IntegerUpdateNumber = Val(ReadINI("CONFIG", "Update", App.Path & "/config")) + 1Learn about your types.Integer is a number, ReadINI returns a string. You can't add a string to a number it's like trying to add a and 1 togeather.Val() turns a string into a number. Link to comment Share on other sites More sharing options...
Lenton Posted January 3, 2009 Author Share Posted January 3, 2009 Thanks. 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