Harbour Samples

Here you will find some programming examples in Harbour language. These examples compiled various sources by courtesy of original authors and doesn’t have any promotional purpose. Only intention is being helpful to who wants to learn.

All examples are about console (text) mode. Primary goal of this way is keeping theme as soon as simple for easy understanding.

For building, plaise refer here.

Basic

A typical Harbour Program 

Arrays

Array Basics

          Copy and compare Arrays

Multi-Dimensional Arrays

Uniform arrays

CURSORs

Fill a two dimensional array

Control Structures

Loops

FOR .. NEXT Loop

WHILE..ENDDO Loop 

Decision making

IF..ENDIF

DO CASE..ENDCASE

Environment

Environment Variables 

Data Retrieve

TBrowse

Data Management

Constants

Variables

Files and Directories

       ADir() Function

       DirChange() Function

       Directory() Function

       DiskChange() Function

Extract Lines

FileSeek() Function

FileCopy() Function

Volum Info

Text File Processing

Strings

Remove a line from a text file

First + Last words in a string

Parsing Text – FParse()

Parsing Text – Tokens()

UDFs

Calling by reference

Defining and calling 

Extended

Data types &  syntax extensions

Extended Field Types in Harbour 

FOR EACH..NEXT loop

Hashes

          Hash Basics

Hash Details – 1

Hash Details – 2

Hash vs Table

Nested Hashes

          Memo File Extention

Operator overloading

Strings as Array

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s