Dim clicks As Integer
clicks = 0
If clicks >= 10000000000000000000 Then
a19.ForeColor = Color.FromArgb(0, 153, 0)
End If
10000000000000000000 and above gives the error. Is there any way to have unlimited large length numbers?
Dim clicks As Integer
clicks = 0
If clicks >= 10000000000000000000 Then
a19.ForeColor = Color.FromArgb(0, 153, 0)
End If
10000000000000000000 and above gives the error. Is there any way to have unlimited large length numbers?
You can use Long instead of Integer to allow you to go up to about 9 * 10E18 (9 followed by 18 zeros). Use the L suffix on literals if they are Long
Dim bigNumber as Long = 5000000000000000000L
If you want integers that can be any size at all, look at the BigInteger Structure. For example (the following requires a reference to the System.Numerics DLL as well as the statement Imports System.Numerics
Dim clicks As BigInteger = 0
'Code that updates click goes here
Dim limit As BigInteger = BigInteger.Parse("10000000000000000000")
If clicks >= limit Then
a19.ForeColor = Color.FromArgb(0, 153, 0)
End If
You can also use Double to hold number as large as 1E308, but it can't hold 308 decimal digits, so the numbers will only be approximations.
In Computer Science a number is most often represented as an integer. An integer is most often defined as a 32-bit signed integer, which means that the value can only hold up to a value from -(2^31) to (2^31)-1. To use bigger numbers, you might want to check other integer types. The most commonly used bigger integer, is the 64-bit integer, which can hold a value from -(2^63) to (2^63)-1.