Pack and memo field

Pack and memo field

Postby pawelu » Wed Nov 15, 2006 5:10 pm

Antonio,

It's look like Harbour for Pocket PC don't remove data from FPT memo file when PACK command is use. Below is sample code.

Regards
Pawel

Code: Select all  Expand view
#Include 'FwCe.Ch'

Function TestTr ()

  Local aStr := {}
  Local i := 0
  Local j := 0
  Local k := 0

  AppIni ()

  AAdd (aStr, {'F1', 'N',  5, 0})
  AAdd (aStr, {'F2', 'M', 10, 0})
  DbCreate (CurDir () + '\TESTTR', aStr)
  Use (CurDir () + '\TESTTR') New CodePage 'PLWIN'

  For i := 1 To 200
      TestTr->(DbAppend ())
      TestTr->F1 := i
      TestTr->F2 := PadL (i, 10, '0')
  Next

  TestTr->(DbGoTop ())
  Do While !TestTr->(Eof ())
     TestTr->(DbDelete ())

     TestTr->(DbSkip ())
  Enddo

  Select TestTr
  Copy To (CurDir () + '\TESTTRC') All // <-- this works ok

  Select TestTr
  Pack // <--- this don't remove data from memo file for deleted records
  TestTr->(DbCloseArea ())

  i := FOpen (CurDir () + '\TESTTR.FPT')
  j := FSeek (i, 0, 2)
  FClose (i)

  i := FOpen (CurDir () + '\TESTTRC.FPT')
  k := FSeek (i, 0, 2)
  FClose (i)

  MsgInfo (Str (j) + IIf (j == k, ' == ', ' != ') + Str (k))

Return .T.

Function AppIni ()

   Request DbfCdx
   Request DbfFpt
   RddSetDefault ('DbfCdx')
   Request Hb_Lang_PL852
   Request Hb_Lang_PLWIN
   Request Hb_CodePage_PL852
   Request Hb_CodePage_PLWIN

   Set Century On
   Set Epoch To 2000
   Set Date German
   Set Deleted On
   Hb_LangSelect ('PL')
   Hb_SetCodePage ('PLWIN')

Return .T.
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Wed Nov 15, 2006 5:46 pm

Pawel,

Have you tested the same code with Harbour on a PC ?
regards, saludos

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

Postby pawelu » Wed Nov 15, 2006 6:04 pm

Antonio,

In Harbour for PC PACK works exactly as in Pocket PC - wrong.

Pawel
pawelu
 
Posts: 126
Joined: Thu Oct 06, 2005 10:18 pm
Location: Poland

Postby Antonio Linares » Wed Nov 15, 2006 6:34 pm

Pawel,

Then it looks as a Harbour issue.

Could you please report it at the Harbour development list providing your sample ? thanks,
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
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