Re: [Harbour] Autoincrement fields

2008-01-09 Thread Francesco Saverio Giudice

Przemek,

- Original Message - 
From: Przemyslaw Czerpak [EMAIL PROTECTED]

To: Harbour Project Main Developer List. harbour@harbour-project.org
Sent: Tuesday, January 08, 2008 3:04 PM
Subject: Re: [Harbour] Autoincrement fields



On Thu, 27 Dec 2007, Francesco Saverio Giudice wrote:

Hi All,
how may I use an autoincrement field ?
I would like to have a numeric value, but at the moment if I create a dbf
with below command, I got a datetime field.
dbcreate( test, { {USERID, +, 12, 0 }, { NAME, C, 20, 0 } },
DBFCDX )
I have tried with some combinations of len and dec values, but without
success.
I have also seen that at the moment there is a commented out DBS_FLAG, 
but

it should be for future extension.
Is autoinc already full implemented or is it at devel stage ?


AFAIK is working and it is fully functional. If you think that sth is
wrong then please create self contain example which illustrates the
problem. This example shows that AUTOINC fields works without any
problems:

   proc main()
   local i
   rddsetdefault( DBFCDX )
   dbcreate( test, { {USERID, +, 4, 0 }, { NAME, C, 20, 0 } } )
   use test
   for i:=1 to 10
  dbappend()
  if i % 3 == 0
 field-name := NAME: + ltrim( str( i ) )
  endif
   next
   dbgotop()
   browse()
   close
   return




I have retested as your sample and obviously it works, I have to check again 
to remember how it didn't work.

Sorry for wasting your time.

Best Regards
Francesco 


___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour


Re: [Harbour] Autoincrement fields

2008-01-08 Thread Przemyslaw Czerpak
On Thu, 27 Dec 2007, Francesco Saverio Giudice wrote:
 Hi All,
 how may I use an autoincrement field ?
 I would like to have a numeric value, but at the moment if I create a dbf 
 with below command, I got a datetime field.
 dbcreate( test, { {USERID, +, 12, 0 }, { NAME, C, 20, 0 } }, 
 DBFCDX )
 I have tried with some combinations of len and dec values, but without 
 success.
 I have also seen that at the moment there is a commented out DBS_FLAG, but 
 it should be for future extension.
 Is autoinc already full implemented or is it at devel stage ?

AFAIK is working and it is fully functional. If you think that sth is
wrong then please create self contain example which illustrates the
problem. This example shows that AUTOINC fields works without any
problems:

proc main()
local i
rddsetdefault( DBFCDX )
dbcreate( test, { {USERID, +, 4, 0 }, { NAME, C, 20, 0 } } )
use test
for i:=1 to 10
   dbappend()
   if i % 3 == 0
  field-name := NAME: + ltrim( str( i ) )
   endif
next
dbgotop()
browse()
close
return

best regards,
Przemek
___
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour