A data type is a type of information that can be manipulated and processed by a programming language. Data types include numerical information, such as the amount of hit points a video game character has, to "text" (string) information such as the character's name.
At the processor level, all data is the same —- simple bytes. The actual data type is constructed using assembly language.
Data Type Sign
Some BASIC variants, such as PlayBasic, require that variables and arrays have a data type sign which determines their data type. These are :
- $ - string
- # - floating point number
An integer variable or array is not usually required to have a data type sign.
playerName$ = "Dave Ahl"
playerMoney = 100000
Explicit Data Type
Other BASIC dialects allow you to explicitly declare a variable's data type when you DIM the variable and therefore a data type sign is not needed. One example of a programming language that allows this is FreeBASIC.
dim playerName as string
dim playerMoney as integer
playerName = "Bob Albrecht"
playerMoney = 100000
Related Pages
Links
- Data Types at the PlayBasic Wiki
- Data Types at the thinBasic Wiki
| Categories: Computer Science : Data : Data Types : Programming |