FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Pocket PC Bug in PACK command
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in PACK command
Posted: Sun May 20, 2007 11:51 AM
This is the sample:

#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
Posts: 946
Joined: Thu Oct 06, 2005 07:05 PM
Re: Bug in PACK command
Posted: Sun May 20, 2007 03: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: Bug in PACK command
Posted: Sun May 20, 2007 04: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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in PACK command
Posted: Sun May 20, 2007 05: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in PACK command
Posted: Sun May 20, 2007 05:52 PM

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

EMG

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in PACK command
Posted: Sun May 20, 2007 06:33 PM
This is the modified sample showing that the record is not removed:

#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
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in PACK command
Posted: Sun May 20, 2007 06: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
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in PACK command
Posted: Sun May 20, 2007 06:56 PM

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

EMG

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in PACK command
Posted: Sun May 20, 2007 07: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.

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Bug in PACK command
Posted: 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

Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Bug in PACK command
Posted: Mon May 21, 2007 05: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

Continue the discussion