Bug in PACK command

Bug in PACK command

Postby Enrico Maria Giordano » Sun May 20, 2007 11:51 am

This is the sample:

Code: Select all  Expand view
#include "Fwce.ch"


FUNCTION MAIN()

    DBCREATE( CURDIR() + "\TMPTEST", { { "TEST", "C", 10, 0 } } )

    USE ( CURDIR() + "\TMPTEST" )

    APPEND BLANK

    REPLACE FIELD -> test WITH "Test 1"

    APPEND BLANK

    REPLACE FIELD -> test WITH "Test 2"

    DELETE

    PACK

    CLOSE

    MSGINFO( "Done!" )

    RETURN NIL


It seems that PACK recovers deleted flag instead of to remove the deleted record.

Probably it is a bug in Harbour_CE. It is working fine with current Harbour from CVS.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: Bug in PACK command

Postby Richard Chidiak » Sun May 20, 2007 3:42 pm

Enrico

Pack works OK you have to add

SET DELETE ON

Regards

Richard :)
http://www.cbati.com

Uestudio
Fwh 13.05 Harbour 3.2 MSVC 2013
User avatar
Richard Chidiak
 
Posts: 946
Joined: Thu Oct 06, 2005 7:05 pm
Location: France

Re: Bug in PACK command

Postby Enrico Maria Giordano » Sun May 20, 2007 4:20 pm

No, SET DELETED ON is not required for PACK to work. Anyway, I just tried with SET DELETED ON and found the same result.

I'm using FWPPC 7.02.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sun May 20, 2007 5:09 pm

Enrico,

Changing your code this way:

PACK

MsgInfo( RecCount() )

It shows 1, which it seems correct
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41461
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sun May 20, 2007 5:52 pm

Yes, but now try to open TMPTEST.DBF and you will see that there are two records.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Enrico Maria Giordano » Sun May 20, 2007 6:33 pm

This is the modified sample showing that the record is not removed:

Code: Select all  Expand view
#include "Fwce.ch"


FUNCTION MAIN()

    SET DELETED ON

    DBCREATE( CURDIR() + "\TMPTEST", { { "TEST", "C", 10, 0 } } )

    USE ( CURDIR() + "\TMPTEST" )

    APPEND BLANK

    REPLACE FIELD -> test WITH "Test 1"

    APPEND BLANK

    REPLACE FIELD -> test WITH "Test 2"

    DELETE

    PACK

    CLOSE

    USE ( CURDIR() + "\TMPTEST" )

    MSGINFO( RECCOUNT() )

    CLOSE

    MSGINFO( "Done!" )

    RETURN NIL


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sun May 20, 2007 6:50 pm

Enrico,

It is related to the SD memory card. Copy the EXE to the Pocket PC root path and it works fine there
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41461
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sun May 20, 2007 6:56 pm

Sorry, I haven't a pocket PC. How can I do the same using the emulator?

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Sun May 20, 2007 7:15 pm

Enrico,

Keep the mouse pressed on top of the EXE until a popup is shown, then select copy. Then select "My Device" from the top menu of the file explorer and right click and select paste. Then run it there.
Image
Image
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41461
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Postby Enrico Maria Giordano » Sun May 20, 2007 10:31 pm

Yes, this way it works. Unfortunately, this makes the emulator much less useful. I wonder if there is a way to get the program to run correctly on the storage card...

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8408
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Postby Antonio Linares » Mon May 21, 2007 5:31 am

Enrico,

Harbour uses the same functions to manage files when it runs on the memory card, so its a difference on the Windows Mobile OS
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41461
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain


Return to FiveWin for Pocket PC

Who is online

Users browsing this forum: No registered users and 7 guests