Meaning of cint and clng:
You can forcibly convert an expression to a data type.
Cint and clng:
CInt Integer-32,768 to 32,767, rounded to the decimal part.
CLng Long-2,147,483,648 to 2,147,483,647, rounded to the decimal part.
Overflow refers to a code that is out of the scope of data processing. The following code processes data to prevent data overflow. You can check it for yourself:
'Check whether it is a short integer
Copy codeThe Code is as follows: sub Is_Int (string)
If len (abs (string)> 10 then response. write "Data overflow": response. end
If instr (string, "-") <1 then
If cint (left (string, 4)> 3276 and cint (right (string, 1)> 7 then response. write "Data overflow": response. end
Else
If cint (left (abs (string), 4)> 3276 and cint (right (string, 1)> 8 then response. write "Data overflow": response. end
End if
End sub
'Check whether it is a long integer
Copy codeThe Code is as follows: sub Is_Lng (string)
If len (abs (string)> 10 then response. write "Data overflow": response. end
If instr (string, "-") <1 then
If clng (left (string, 9)> 214748364 and clng (right (string, 1)> 7 then response. write "Data overflow": response. end
Else
If clng (left (abs (string), 9)> 21478364 and clng (right (string, 1)> 8 then response. write "Data overflow": response. end
End if
End sub