Synectics Posted September 2, 2009 Author Share Posted September 2, 2009 As I've recently learned (thanks Balliztik!), GetVar ALWAYS returns Strings.Glancing through some tutorials, I noticed CLng(). Its purpose is to convert strings to integers. So with that in mind, would this return an integer?```CLng(GetVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "AwesomePoints", "Amount"))```Further, could I do this?```Epic = CLng(GetVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "AwesomePoints", "Amount")) + 20```Or…```If CLng(GetVar("Scripts\Charextras\" & GetPlayerName(index) & ".ini", "AwesomePoints", "Amount")) >= 99 Then``` Link to comment Share on other sites More sharing options...
Godlord Posted September 2, 2009 Share Posted September 2, 2009 CLng converts the given parameter to a Long and CInt converts the given parameter to an Integer, you can use both, however that is when the result returned by GetVar isn't vbNullString, otherwise it'll most likely error.Regards, Godlord. Link to comment Share on other sites More sharing options...
Synectics Posted September 2, 2009 Author Share Posted September 2, 2009 Thanks for the fast reply. :)And fortunately, so far, I'd done most, if not all, of my checks like so:```If GetVar("Scripts\Charextras\" & GetPlayerTargetNPC(index) & " " & GetPlayerMap(index) & ".ini", "STATUS", "DeityMark") = "" Then Else DeityMarkMod = CInt(GetVar("Scripts\Charextras\" & GetPlayerTargetNPC(index) & " " & GetPlayerMap(index) & ".ini", "STATUS", "DeityMark"))```So I won't have to go back and do a TON of recoding. I'll just have to add CInt() to where I'm calling a number with GetVar. Link to comment Share on other sites More sharing options...
Godlord Posted September 2, 2009 Share Posted September 2, 2009 From LoadSettings.ess:``` If GetVar("Data.ini", "MAX", "MAX_MAPS") <> vbNullString Then MAX_MAPS = CInt(GetVar("Data.ini", "MAX", "MAX_MAPS")) Else MAX_MAPS = 0 End If```Regards, Godlord. 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