Comparative data types

ThinBASIC uses BASIC convention for data type naming, which is incompatible with most non-BASIC languages.

The following table will help you with matching the correct thinBASIC type with the correct type in the targetted language:

Data typeMeaning
INTEGER16 bit signed integer
LONG32 bit signed integer
QUAD64 bit signed integer
BYTE8 bit unsigned integer
WORD16 bit unsigned integer
DWORD32 bit unsigned integer
SINGLE32 bit floating point
DOUBLE64 bit floating point
EXTENDED80 bit floating point
NUMBER80 bit floating point
STRINGBSTR
ASCIIZNull-terminated buffer of characters

With this knowledge, you may translate thinBASIC UDT:

TYPE Point2D
  x AS SINGLE
  y AS SINGLE
END TYPE

...as the following in C:

struct Point2D {
  float x;
  float y;
};

...as the following in Rust:


#![allow(unused)]
fn main() {
struct Point2D {
  pub x: f32,
  pub y: f32,
}
}