Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

CLng(GetVar)


Synectics
 Share

Recommended Posts

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

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...