User Tools

Site Tools



The basics of the BASIC language

This course for beginner. so I won't explain everything about CUBLOC-BASIC. If you want more detail information about CUBLOC-BASIC, you should see CUBLOC online-Documentation.

I will explain 5 kinds BASIC grammer statement only.

  • Dim
  • Do, Loop
  • For, Next
  • If
  • Goto, Gosub

CUBLOC BASIC has a lot of feature, but at this moment most important thing is how to you understading about Basic of CUBLOC BASIC language. Trying to learn everything at once can tire you out quickly.

these 5 kind of grammer is most important at the BASIC language.


Dim is variable define command.

CUBLOC has 5 kinds of variable type.

  • Byte
  • Integer
  • Long
  • Single
  • String

Syntax :

Dim [Variable Name] As [Variable Type]

Example :

Dim Motor1 As Integer

The number that can be handled differs depending on the type.

  • Byte : 8 bit positive number, 0 to 255
  • Integer : 16 bit positive number, 0 to 65535
  • Long : 32 bit positive/negative number (-2147483648 to +2147483647)
  • Single : 32 bit floating point number (-3.402823E+38 to 3.402823E+38)

String type can store string up to 128 characters.

Charles's Blog

wikiblog/cublocstudy6/index.txt · Last modified: 2022/06/24 21:51 by COMFILE Technology