B4R Tutorial Data types

The following data types are available in B4R:

Numeric types:

Byte: 0 - 255
Int (2 bytes): -32768 - 32768. Similar to Short type in other B4X tools.
UInt (2 bytes): 0 - 65535.
Long (4 bytes): -2,147,483,648 - 2,147,483,647. Similar to Int type in other B4X tools.
ULong (4 bytes): 0 - 4,294,967,295
Double (4 bytes): 4 bytes floating point. Similar to Float in other B4X tools.
Float is the same as Double. Short is the same as Int.

The above is true on all boards, including the Arduino Due.

Other types:
Boolean: True or False. Practically it is saved as a byte with the value of 1 or 0.
String: Strings are made from an array of bytes that end with a null byte (byte with the value of 0).
Object: Objects can hold other types of values.
 

peacemaker

Expert
Licensed User
Longtime User
The above is true on all boards, including the Arduino Due.
ESP32 family also ? General info is that ESP32 family Long is 8 bytes. How is in B4R ?
@Erel, maybe to update the old general rules posts regarding ESP32 or other MCU excepting pure AVR?
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
New version of B4R has been promised to be released "soon"... hopefully targeting all these newer arduino compatible modules
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
New version of B4R has been promised to be released "soon"
B4R indeed didn't got enough attention. I will release a small update with the code bundle and other IDE improvements. Code bundle can be particularly useful with B4R as it can also include the full generated C++ project.
 
Top