Harbour Data Types

447 views
Skip to first unread message

clipper6

unread,
Feb 4, 2014, 4:38:43 AM2/4/14
to harbou...@googlegroups.com
Where can I find the specifications of different data types below. I mean like for a string/char data type, how many bytes is it capable of storing. For an array, what is the max number of elements and dimension?

    Nil: NIL
    String: "hello", 'hello', [hello]
    Date
    Logical: .T., .F.
    Number: 1, 1.1, −1, 0xFF

   Array

Massimo Belgrano

unread,
Feb 4, 2014, 4:54:21 AM2/4/14
to harbou...@googlegroups.com


2014-02-04 clipper6 <arl...@gmail.com>:

--
--
You received this message because you are subscribed to the Google
Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: http://groups.google.com/group/harbour-users
 
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



--
Massimo Belgrano
Delta Informatica S.r.l. (Cliccami per scoprire 

clipper6

unread,
Feb 4, 2014, 9:25:07 PM2/4/14
to harbou...@googlegroups.com
Could not not find any definitive description of HB data types.

Massimo Belgrano

unread,
Feb 5, 2014, 5:34:01 AM2/5/14
to harbou...@googlegroups.com
Please help harbour project 
writing a better documentation starting from your need

number of array element is unlimited (limited only by os memory who allowing swapping is unlimited)





2014-02-05 clipper6 <arl...@gmail.com>:

Qatan

unread,
Feb 5, 2014, 3:12:10 PM2/5/14
to harbou...@googlegroups.com
Hello Clipper6,
 
>Where can I find the specifications of different data types below.
>I mean like for a string/char data type, how many bytes is it capable
>of storing. For an array, what is the max number of elements and dimension?
>
>    Nil: NIL
>    String: "hello", 'hello', [hello]
>    Date
>    Logical: .T., .F.
>    Number: 1, 1.1, −1, 0xFF
>
>   Array
What I did I just Googled this expression: “Clipper datatype” and got good results.
You can find it on Clipper’s docs or here:
 
The limit for an array is the computer’s memory.
I don’t have any idea what it means in terms or number of cells but maybe you could create a test to see what is the limit in your computer and post here the results with the code and configuration of your computer?
Just an idea.
Also it’s a good idea to read xhb-diff.txt for more interesting information on Harbour
I hope it will help you, at least a little bit...
Regards,
 
Qatan
 

Nenad Batocanin

unread,
Feb 5, 2014, 11:02:17 PM2/5/14
to harbou...@googlegroups.com

I want to help but do not know how?

clipper6

unread,
Feb 6, 2014, 12:55:28 AM2/6/14
to harbou...@googlegroups.com
The links you provided refers to CA-Clipper. So far I could not find any info for HB on what's the biggest and smallest (precision) value a numeric type can hold, etc.

Przemyslaw Czerpak

unread,
Feb 6, 2014, 3:02:27 AM2/6/14
to harbou...@googlegroups.com
On Wed, 05 Feb 2014, clipper6 wrote:

Hi,

> The links you provided refers to CA-Clipper. So far I could not find any
> info for HB on what's the biggest and smallest (precision) value a numeric
> type can hold, etc.

It was many times discussed on Harbour related forums.

In case of numeric values it's the same as in Clipper and
most of other languages - on platforms you are using it's
limited by IEEE758 double value specification.

The date ranges and internal representation is the same as
in Clipper too. In conversions between strings and date values
Harbour supports years in range 0-9999 but Clipper 1-2999.

Harbour has four data types unsupported by Clipper:
HASH ARRAYS
TIMESTAMPS
SYMBOLS
POINTERS

HASH ARRAYS are arrays which can be indexed by user defined values
of different types (numbers, dates, timestamps, strings, pointers)
For more information read "HASH ARRAYS" in doc/xhb-diff.txt.

TIMESTAMPS are datetime values which contain date and time in
milliseconds (see "DATETIME/TIMESTAMP VALUES" in doc/xhb-diff.txt)

SYMBOLS are references to functions (procedures) or methods.
(see SYMBOL ITEMS AND FUNCTION REFERENCES in doc/xhb-diff.txt)

POINTER items are defined by some subsystems and 3-rd party code
at C level and usually they refers to some low level resources
or memory addresses. In short words it's type of handle returned
to PRG level. Unlike numeric handles pointer item value is protected
and cannot be changed by PRG code so they are much safer. In C code
using pointer items it's possible to verify if given pointer item was
defined by the same subsystem and protect against wrong pointers.
Finally C code author can bound with pointer item destructor which is
executed automatically when variable is out of scope and can release
resources allocated for given item.

Maximum size of strings and arrays is limited only by available memory
(I will use "unlimited" in such case).

Maximum number of symbols in single module (compiled PRG file) is 65536.
Maximum number of symbols registered in HVM from all modules and RDD
subsystems is 65536.
The maximum number of symbols reduces number of different names which
can be used for function/procedure/alias/field/public/private/class/method
names. All such names are registered in HVM in single global symbol table.
Anyhow the maximum size of global symbol table does not mean that it
sets limit for maximum number of given constructions. Some of them like
private variables can share the same name.

There is no limit for number of memvars (public and private variables)
and fields but please remember about maximum size of global symbol table
and number of symbols in single module.
Maximum number of workareas is 65534.
Maximum number of local variables in a single function is 32767.
Maximum number of local parameters in a single function is 32767.
Maximum number of static variables in single module is 65535
(in whole application is unlimited).

The maximum size of literal string defined in PRG code is 16MB.
The maximum size of literal array defined in PRG code is 65535.

The size of PCODE generated for single function is unlimited.
Anyhow maximum size of conditional and unconditional jump in
Harbour is 8388607. It may introduce limits in some construction
so we can only define minimum fully supported size of PCODE generated
for single function or code block as 8MB. Longer code can be generated
if it does not exploit jump size limit.
Macro compiler has exactly the same limits as compiler. For more
info look at section "MACRO COMPILER" in doc/xhb-diff.txt.

Things like maximum number of open files, maximum file size, etc.
are limited only by operating system and used data structures.
Harbour does not introduce any new limits here.
You may find my messages about limits defined by DBF* structures
or read about them in doc/xhb-diff.txt, section "NATIVE RDDs"

best regards,
Przemek

clipper6

unread,
Feb 6, 2014, 4:34:41 AM2/6/14
to harbou...@googlegroups.com
Thanks.

Qatan

unread,
Feb 6, 2014, 7:00:58 AM2/6/14
to harbou...@googlegroups.com
Hello Massimo,
 
Maybe you could add Przemek’s information on your blog to keep as documentation?
Thanks
 
Qatan
 

Massimo Belgrano

unread,
Feb 6, 2014, 9:08:46 AM2/6/14
to harbou...@googlegroups.com

Qatan

unread,
Feb 6, 2014, 9:30:56 AM2/6/14
to harbou...@googlegroups.com
Hello Massimo,
 
Thank you.
Your blog is becoming a very good source of information.
Regards,
 
Qatan
 

cruz...@gmail.com

unread,
Feb 8, 2014, 8:47:52 PM2/8/14
to harbou...@googlegroups.com
Enviado desde mi dispositivo movil BlackBerry® de Digitel.

From: "Nenad Batocanin" <nbato...@wings.rs>
Date: Thu, 6 Feb 2014 05:02:17 +0100
Subject: RE: [harbour-users] Harbour Data Types

--
Reply all
Reply to author
Forward
0 new messages