extended type problem: Y (currency) assumes I (integer)

333 views
Skip to first unread message

Hurricane

unread,
Aug 6, 2025, 12:15:59 AMAug 6
to harbou...@googlegroups.com, harbou...@googlegroups.com
Hi
When creating tables with fields of type Y, it will assume I (integer)

// extended type problem: Y (currency) assumes I (integer)
function main
   CLS
   MakeDBF()

   USE EDS
   ? FIELDTYPE('MONEY84'), FIELDLEN('MONEY84'), FIELDDEC('MONEY84')
   ? FIELDTYPE('MONEY30'), FIELDLEN('MONEY30'), FIELDDEC('MONEY30') // without RTE, another problem will occur 
   ? ' '
   ASCAN( DBSTRUCT(), {|a| iF( a[1] == 'MONEY84', QOUT(a[2], a[3], a[4]), ) } )
   return nil

function MakeDBF()
   LOCAL aStr[0]

   IF ! FILE('EDS.DBF')
      AADD( aStr, { 'MONEY84', 'Y', 8, 4 } )
      AADD( aStr, { 'MONEY30', 'Y', 3, 0 } ) // RTE?
      DBCREATE( 'EDS', aStr )
   ENDIF

   RETURN NIL

Regards,
Hurricane

paul.smi...@gmail.com

unread,
Aug 8, 2025, 10:08:38 PMAug 8
to Harbour Users
Hi Hurricane
As I understand it ,the field data type-must contain a proper value: C (Character), D (Date), L (Logical), M (Memo) or N (Numeric) It is possible to use additional letters for clarity (e.g., 'Numeric' for 'N'): however, the first letter of this array element must be a proper value. There is no 'Y' field type in a dbf
Cheers
Paul

marcos...@gmail.com

unread,
Aug 9, 2025, 2:09:40 AMAug 9
to Harbour Users
Hello

Harbour has expanded the data types a table can have. I've attached a list of all the options.

  Code   Name     Width (Bytes)                             Description
  ----         ------       -----------------                   -------------------------------------------------------------------
   D         Date           3, 4 or 8         Date
   M       Memo        4 or 8              Memo
   +        AutoInc      4                       Auto increment
   =        ModTime    8                      Last modified date & time of this record
   ^        RowVers     8                       Row version number; modification count of this record
   @      DayTime     8                      Date & Time
   I        Integer     1, 2, 3, 4 or 8      Signed Integer ( Width :  )" },;
   T      Time         4 or 8                   Only time (if width is 4 ) or Date & Time (if width is 8 ) (?)
   V      Variant     3, 4, 6 or more    Variable type Field
   Y      Currency  8                           64 bit integer with implied 4 decimal
   B     Double    8                            Floating point / 64 bit binary

 
  Current field type mappings are:
        C; Character,n      HB_FT_STRING,n                        ADS_STRING
        N; Numeric,n,d      HB_FT_LONG,n,d                      ADS_NUMERIC
        D; Date,n                HB_FT_DATE,3 or 4 or 8          ADS_COMPACTDATE; ADS_DATE
        ShortDate              HB_FT_DATE,3                         ADS_COMPACTDATE
        L; Logical              HB_FT_LOGICAL,1                     ADS_LOGICAL
        M; Memo,n           HB_FT_MEMO,4 or 9 or 8          ADS_MEMO
        B; Double,,d          HB_FT_DOUBLE,8,d                    ADS_DOUBLE
        I; Integer,n            HB_FT_INTEGER, 2 or 4 or 8      ADS_SHORTINT; ADS_INTEGER; ADS_LONGLONG
        ShortInt                HB_FT_INTEGER,2                      ADS_SHORTINT
        Longlong              HB_FT_INTEGER,8                     ADS_LONGLONG
        P; Image               HB_FT_IMAGE,9 or 10               ADS_IMAGE
        W; Binary             HB_FT_BLOB,4 or 9 or 10           ADS_BINARY
        Y; Money              HB_FT_CURRENCY,8,4                ADS_MONEY
        Z; CurDouble,,d    HB_FT_CURDOUBLE,8,d             ADS_CURDOUBLE
        T,4; Time               HB_FT_TIME,4                             ADS_TIME
        @; T,8; TimeStamp  HB_FT_TIMESTAMP,8            ADS_TIMESTAMP
        +; AutoInc             HB_FT_AUTOINC,4                     ADS_AUTOINC
        ^; RowVersion      HB_FT_ROWVER,8                      ADS_ROWVERSION
        =; ModTime         HB_FT_MODTIME,8                     ADS_MODTIME
        Raw,n                   HB_FT_STRING,n (+HB_FF_BINARY)      ADS_RAW
        Q; VarChar,n        HB_FT_VARLENGTH,n                             ADS_VARCHAR; ADS_VARCHAR_FOX
        VarBinary,n          HB_FT_VARLENGTH,n (+HB_FF            _BINARY)   ADS_VARBINARY_FOX; ADS_RAW
        CICharacter,n      HB_FT_STRING,n                                       ADS_CISTRING

I attach an example

Regards,
Marcos
test.prg

Francesco Perillo

unread,
Aug 9, 2025, 3:28:13 AMAug 9
to harbou...@googlegroups.com
From the list you published, Y can only be 8 char long.

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://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.
To view this discussion visit https://groups.google.com/d/msgid/harbour-users/933510131.2414427.1754453737299%40mail.yahoo.com.

Hurricane

unread,
Aug 12, 2025, 1:03:23 PMAug 12
to Harbour Users
Hi Paul,
This is for Clipper, but here is Harbour 😊
You don't need to be familiar with a specific topic, but you should recognize certain basic terms: affirmative and informative words.
In our profession, we are eternal learners; question yourself and test what you can.
If the text is confusing, run my code; it will show you things you didn't know.

Em sábado, 9 de agosto de 2025 às 04:28:13 UTC-3, Francesco Perillo escreveu:
From the list you published, Y can only be 8 char long.
 
Again, I think you misunderstood.
Sometimes you want to comment on something contrary, even in messages that are merely "affirmative/informative."
To avoid this, I recommend asking first, commenting later...
Quick reading isn't suitable for many technical topics.

Regards,
Hurricane

Francesco Perillo

unread,
Aug 12, 2025, 1:43:26 PMAug 12
to harbou...@googlegroups.com
I admit,I absolutely have no clue what you were trying to tell us !!! :-))))

From your sample code I can see that:
- despite what you put into 
aAdd( a, { "MONEY1", "Y", 5, 0 } )
aAdd( a, { "MONEY2", "Y", 8, 8 } )
the fields are defined as 
8.4
- dbstruct() returns type I

So were you trying to tell us there is a bug ?

Why do you refer to a RTE ?

 

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://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.

Hurricane

unread,
Aug 12, 2025, 3:35:30 PMAug 12
to Harbour Users
Still at it?! You don't need to understand, and no one wants to tell you anything, just ignore it. Do you understand now?! I'm sorry, I can't do anything more for you. 
Your insistence is just ridiculous. That was the last attention you'll get, you can carry on alone. ;))))
Thank you.

Em terça-feira, 12 de agosto de 2025 às 14:43:26 UTC-3, Francesco Perillo escreveu:
I admit,I absolutely have no clue what you were trying to tell us !!! :-))))

pete....@gmail.com

unread,
Aug 13, 2025, 3:55:21 PMAug 13
to Harbour Users
Hi,

On Tuesday, 12 August 2025 at 22:35:30 UTC+3 Hurricane wrote:
Still at it?! You don't need to understand, and no one wants to tell you anything,
 
However, I do want to tell you some things that you need (hopefully) to understand:
You've posted a rather naive sample code with a confusing (almost incomprehensible) title, 
in an attempt to "affirm and inform" about a "problem" you thought you discovered. 
Members of the group, have taken the time to respond you and what they received are 
implied or direct insults. What are you supposedly trying to achieve with this reaction?
You failed to communicate your "learned knowledge" in a clear way, you just spent your time 
and our time in useless suggestions and offensive comments.    
Please revise your attitude and try to make better contributions. Any unprovoked aggression 
and offensive words are unacceptable and unwelcome here (as well as, in any other public forum, I think)
and do not help at all.
 
regards,

Reply all
Reply to author
Forward
0 new messages