Welcome to Pete's QBASIC Site!


QB FAQ
What are the different types of variables available in QB?

The table below shows the different types of variables available in QBasic:
Data TypesSuffix
Single-precision!
Integer%
Double-precision#
Long-integer&
String$

  • The first 4 types are used to store numbers:
    • The Single-precision and double-precision types store floating point numbers. (ie: 45.68474, 38389.3946)
    • The integer and long-integer types store integers, or numbers without decimal points. (ie: 40, 2, 345678)
  • The String variables store characters, letters, texts, sentences. (ie: "Hello!")
  • If no suffix is assigned, a variable is automatically classified by QB as single-precision.

Data are stored in memory variables, or constants. In QBasic variables should respect the following rules:

  • The length should not be greater than 40 characters
  • They should start with a letter
  • They should not contain spaces
  • They do not support certain characters such as (

Submitted by: Pete on June 22, 2004

Return to the FAQ


Copyright © Pete's QBASIC / QuickBasic Site, 1998-2018.
All rights reserved. Site owned and operated by Pete Berg. Programs and submitted content are property of their creators, and appear on this site by direct or implied permission. Pete's QBasic Site is powered by Coranto. This site was created entirely in Notepad.