---
url: >-
  /statelake/scripting-reference/functions-and-procedures/conversion-functions/bintoint.md
---

# BinToInt

**BinToInt** converts a **String** that represents a binary value into **Integer** data type.

This is used when you need to read into **Binary** type fields within a database or file.

Declaration: Function BinToInt( v : String) : LongInt;

An example.

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := BinToInt(BinaryField.Value);
end;
```
