HexLibraryHexLibrary
</> HexCodeSign inSign up
PythonJavaScriptTypeScriptCC++JavaPHPGoRustRubyBashSQLLuaPerlCOBOLPascalDelphiFortranDartSwiftC#JuliaGroovyRElixirHaskellKotlinScalaClassic ASPClipperMS-DOS
LESSONS
Introduction to ClipperVariablesStringsConditions (IF / DO CASE)Loops (FOR / DO WHILE)DBF Database
REFERENCE
📖 Overview
🖥️ Output
📦 Variables
✍️ Text & Number
🔁 Condition & Loop
🗃️ Functions & Database
Clipper›Introduction to Clipper

Introduction to Clipper

First program, printing to the screen with QOut and program structure.

Simple enough for a 5-year-old to understand

Your first program

A Clipper program starts with a procedure (PROCEDURE). QOut prints the value you give to the screen and moves to the next line.

Hello
1
PROCEDURE Main()
The program starts here.
FunctionThe program starts here.
2
QOut("Hello!")
Prints to the screen and moves to the next line.
Output / InputPrints to the screen and moves to the next line.
3
RETURN
End of the procedure.
FunctionEnd of the procedure.
FunctionOutput / Input
💡 Hint: Source files are saved with the .prg extension.

QQOut: without moving to the next line

Example code
1
QQOut("A")
Does not move to the next line.
Output / InputDoes not move to the next line.
2
QQOut("B")
Writes right next to it.
Output / InputWrites right next to it.
Output / Input
💡 Hint: QOut moves to the next line, while QQOut does not. That's the difference of the extra Q at the beginning.

🎯 Exercise & Practice

Test what you've learned — answer, write code, check instantly. (2 left)

1.Which command prints to the screen and moves to the next line in Clipper?
2.What is the extension of Clipper source files?

About this topic

Clipper emerged in 1985 as a compiler for the dBASE world. At that time, database applications were written in interpreted dBASE; Clipper compiled the same language to produce much faster programs and quickly became the standard.

The language family is known as xBase. The data file format, indexing logic, and command syntax are similar across all members of this family. Version 5 of the language moved far beyond classic dBASE by adding arrays, code blocks, and object-like structures.

A significant portion of accounting, inventory, and invoicing programs written in Turkey during the 1990s was built with Clipper. Some of these programs are still running; thanks to open-source compilers like Harbour, they can also be compiled on modern systems.

What you will learn

  • Program structure
  • Printing to the screen
  • writing comments
  • Compilation and linking steps
  • The relationship with Harbour

Who is this for?

  • Maintainers of legacy accounting programs
  • Developers entering the xBase family
  • Those migrating with Harbour

When to use?

Clipper is learned to understand, fix, and expand ongoing xBase-based business applications.

It is not chosen for new projects; its data file format and multi-user access model fall short of today's requirements.

Common mistakes

Wrong

PROCEDURE Main()
   ? "Hello"

Procedure termination is missing; in Clipper, every procedure ends with a return statement. The compiler may issue a warning and continue in some versions, but for readability and maintenance, the closing should always be written.

Correct

PROCEDURE Main()
   ? "Hello"
   RETURN

Wrong

PROCEDURE Main()
   Response "Hello"
   RETURN

Clipper has its own commands for printing to the screen; a single question mark prints and moves to a new line, while two question marks continue on the same line. If an unrecognized command is typed, the compiler treats it as an undefined function call, and the error appears at the linking stage.

Correct

PROCEDURE Main()
   ? "Hello"
   RETURN

Wrong

PROCEDURE Main()
   // Print the username
   ? "Hello"  // this line is commented
   # this place should also be a comment
   RETURN

In Clipper, comment markers are double slashes, a slash and an asterisk pair for blocks, and an asterisk character at the beginning of a line. The hash sign does not start a comment; it is interpreted as a preprocessor directive and generates a meaningless error.

Correct

PROCEDURE Main()
   // Print the username
   ? "Hello"  // this line is commented
   * this place is also a comment
   RETURN

Frequently asked questions

What is the difference between Clipper and Harbour?

Harbour is an open-source compiler compatible with the Clipper language and runs on modern operating systems. It compiles most legacy Clipper code without modification while adding new data types and libraries.

Is Clipper case-sensitive?

It is not case-sensitive for commands and variable names. Traditionally, commands are written in uppercase, while functions and variables are written in mixed case. However, string comparisons are case-sensitive; these two should not be confused.

How is a program compiled?

First, the compiler generates an object file from the source file, and then a linker combines this with libraries to create an executable file. Harbour has a helper tool that performs both steps with a single command.

Summary

Clipper is the compiled member of the xBase family.

The question mark is the command for printing to the screen.

Procedures are closed with a return statement.

Comments are written with double slashes or asterisks.

Harbour compiles Clipper code on modern systems.

HexLibraryHexLibrary

Learn programming more clearly. Every command is explained line by line with colors, reinforced with runnable exercises, test your code instantly — all in one place, free.

Learn

  • Home
  • Languages & Lessons
  • HexCode

Company

  • About
  • Contact

Legal

  • Privacy Policy
  • Terms of Use

Other Projects

  • HexToolz
  • Free Service Manuals
© 2026 HexLibrary · The clearest way to learn code