---------------------------------------------------------------------
                        [BUG/PRB.] VFP 9.0 FIX - FIX THE GRID.DELETEMARK PROPERTY
                                November 2026
                 ---------------------------------------------------------------------
                                     CCB



1. BUG:

     In vfp9 (and vfp6, vfp7, vfp8), when we clicking the delete mark in the Grid control, and the clicked record is not fully visible,
     VFP will scroll up the clicked record, and then the clicked record is fully visible,
     VFP will toggle the delete mark for the clicked record, but VFP will not refresh the delete mark.

     The bug was reported by Gamaliel Perez Yanez.

     In VFP Advanced, when we clicking the delete mark in the Grid control, and the clicked record is not fully visible,
     VFP will scroll up the clicked record, and then the clicked record is fully visible,
     VFP will not toggle the delete mark for the clicked record.


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Fun67b92b :: ; proc near
             push ebp                                                        ;0x0067b92b :        55
             mov ebp , esp                                                   ;0x0067b92c :        8bec
             sub esp , 040h                                                  ;0x0067b92e :        83ec40
             push ebx                                                        ;0x0067b931 :        53
             push esi                                                        ;0x0067b932 :        56
             mov  esi , dword ptr [ ebp + 8 ]                                ;0x0067b933 :        8b7508
             push edi                                                        ;0x0067b936 :        57
             xor edi , edi                                                   ;0x0067b937 :        33ff
             push edi                                                        ;0x0067b939 :        57
             push edi                                                        ;0x0067b93a :        57
             pushd 01h                                                       ;0x0067b93b :        6a01
             push edi                                                        ;0x0067b93d :        57
             mov ebx , eax                                                   ;0x0067b93e :        8bd8
             mov  eax , dword ptr [esi]                                      ;0x0067b940 :        8b06
             lea ecx ,  dword ptr [ ebp - 60 ]                               ;0x0067b942 :        8d4dc4
             push ecx                                                        ;0x0067b945 :        51
             mov  dword ptr [ ebp - 32 ] , eax                               ;0x0067b946 :        8945e0
             mov  eax , dword ptr [ ebx + 06D0h ]                            ;0x0067b949 :        8b83d0060000
             pushd 06Ch                                                      ;0x0067b94f :        6a6c
             push eax                                                        ;0x0067b951 :        50
             call Fun43c117                                                  ;0x0067b952 :        e8c007dcff
             cmp eax , 010h                                                  ;0x0067b957 :        83f810
             je Label67ba97                                                  ;0x0067b95a :        0f8437010000
             test  byte ptr [ ebx + 88 ] , 08h                               ;0x0067b960 :        f6435808
             jne Label67ba92                                                 ;0x0067b964 :        0f8528010000
             mov  eax , dword ptr [ ebx + 12 ]                               ;0x0067b96a :        8b430c
             test  byte ptr [ eax + 16 ] , 040h                              ;0x0067b96d :        f6401040
             jne Label67ba92                                                 ;0x0067b971 :        0f851b010000
             mov  eax , dword ptr [esi]                                      ;0x0067b977 :        8b06
             cmp  eax , dword ptr [ ebx + 0530h ]                            ;0x0067b979 :        3b8330050000
             je Label67ba92                                                  ;0x0067b97f :        0f840d010000
             push esi                                                        ;0x0067b985 :        56
             call Fun519a5f                                                  ;0x0067b986 :        e8d4e0e9ff
             mov  ecx , dword ptr [ ebx + 053Ch ]                            ;0x0067b98b :        8b8b3c050000
             mov edx , esi                                                   ;0x0067b991 :        8bd6
             mov eax , ebx                                                   ;0x0067b993 :        8bc3
             call Fun51b871                                                  ;0x0067b995 :        e8d7fee9ff
             test eax , eax                                                  ;0x0067b99a :        85c0
             je Label67b9d1                                                  ;0x0067b99c :        7433
             mov  eax , dword ptr [ ebx + 88 ]                               ;0x0067b99e :        8b4358
             mov edi , eax                                                   ;0x0067b9a1 :        8bf8
             and eax , 0FFFFFFFBh                                            ;0x0067b9a3 :        83e0fb
             shr edi , 02h                                                   ;0x0067b9a6 :        c1ef02
             mov esi , ebx                                                   ;0x0067b9a9 :        8bf3
             and edi , 01h                                                   ;0x0067b9ab :        83e701
             mov  dword ptr [ ebx + 88 ] , eax                               ;0x0067b9ae :        894358
             call Fun67b730                                                  ;0x0067b9b1 :        e87afdffff
             mov ecx , edi                                                   ;0x0067b9b6 :        8bcf
             shl ecx , 02h                                                   ;0x0067b9b8 :        c1e102
             xor  ecx , dword ptr [ ebx + 88 ]                               ;0x0067b9bb :        334b58
             mov  dword ptr [ ebp - 8 ] , eax                                ;0x0067b9be :        8945f8
             and ecx , 04h                                                   ;0x0067b9c1 :        83e104
             xor  dword ptr [ ebx + 88 ] , ecx                               ;0x0067b9c4 :        314b58
             test eax , eax                                                  ;0x0067b9c7 :        85c0
             je Label67ba97                                                  ;0x0067b9c9 :        0f84c8000000
             jmp Label67ba3a                                                 ;0x0067b9cf :        eb69

     Label67b9d1 ::
             pushd 01h                                                       ;0x0067b9d1 :        6a01
             pushd 01h                                                       ;0x0067b9d3 :        6a01
             xor edx , edx                                                   ;0x0067b9d5 :        33d2
             mov ecx , ebx                                                   ;0x0067b9d7 :        8bcb
             call Fun51e9aa                                                  ;0x0067b9d9 :        e8cc2feaff
             test eax , eax                                                  ;0x0067b9de :        85c0
             je Label67ba97                                                  ;0x0067b9e0 :        0f84b1000000


     ;
     ;                 --------------------------------------------------------
     ;                      VFP 9.0 FIX - FIX THE GRID.DELETEMARK PROPERTY
     ;                                November 2026
     ;                 --------------------------------------------------------
     ;                                     CCB
     ;
     ; Fix the Grid.DeleteMark property.
     ;
     ; 2026/11/12, by ccb
     ;

             mov dword ptr vfpa_deletemark_recordisnotfullyvisible,00h


             mov  edx , dword ptr [ ebx + 20 ]                               ;0x0067b9e6 :        8b5314
             push edi                                                        ;0x0067b9e9 :        57
             push edi                                                        ;0x0067b9ea :        57
             push  dword ptr [ ebx + 090h ]                                  ;0x0067b9eb :        ffb390000000
             mov ecx , ebx                                                   ;0x0067b9f1 :        8bcb
             push esi                                                        ;0x0067b9f3 :        56
             call Fun67f5a0                                                  ;0x0067b9f4 :        e8a73b0000
             mov  eax , dword ptr [ ebx + 12 ]                               ;0x0067b9f9 :        8b430c
             call Fun41a81e                                                  ;0x0067b9fc :        e81deed9ff
             test eax , eax                                                  ;0x0067ba01 :        85c0
             jne Label67ba0c                                                 ;0x0067ba03 :        7507
             mov esi , ebx                                                   ;0x0067ba05 :        8bf3
             call Fun67b730                                                  ;0x0067ba07 :        e824fdffff

     Label67ba0c ::
             mov  eax , dword ptr [ ebx + 88 ]                               ;0x0067ba0c :        8b4358
             mov edi , eax                                                   ;0x0067ba0f :        8bf8
             and eax , 0FFFFFFFBh                                            ;0x0067ba11 :        83e0fb
             shr edi , 02h                                                   ;0x0067ba14 :        c1ef02
             mov esi , ebx                                                   ;0x0067ba17 :        8bf3
             and edi , 01h                                                   ;0x0067ba19 :        83e701
             mov  dword ptr [ ebx + 88 ] , eax                               ;0x0067ba1c :        894358
             call Fun67b730                                                  ;0x0067ba1f :        e80cfdffff
             mov ecx , edi                                                   ;0x0067ba24 :        8bcf
             shl ecx , 02h                                                   ;0x0067ba26 :        c1e102
             xor  ecx , dword ptr [ ebx + 88 ]                               ;0x0067ba29 :        334b58
             and ecx , 04h                                                   ;0x0067ba2c :        83e104
             xor  dword ptr [ ebx + 88 ] , ecx                               ;0x0067ba2f :        314b58
             test eax , eax                                                  ;0x0067ba32 :        85c0
             je Label67ba97                                                  ;0x0067ba34 :        7461
             and  dword ptr [ ebp - 8 ] , 00h                                ;0x0067ba36 :        8365f800

     Label67ba3a ::
             mov  eax , dword ptr [ ebx + 12 ]                               ;0x0067ba3a :        8b430c
             test  byte ptr [ eax + 48 ] , 01h                               ;0x0067ba3d :        f6403001
             je Label67ba48                                                  ;0x0067ba41 :        7405
             mov  esi , dword ptr [ eax + 28 ]                               ;0x0067ba43 :        8b701c
             jmp Label67ba4d                                                 ;0x0067ba46 :        eb05

     Label67ba48 ::
             mov  ecx , dword ptr [ eax + 28 ]                               ;0x0067ba48 :        8b481c
             mov  esi , dword ptr [ecx]                                      ;0x0067ba4b :        8b31

     Label67ba4d ::
             mov  ecx , dword ptr [ eax + 36 ]                               ;0x0067ba4d :        8b4824
             xor edx , edx                                                   ;0x0067ba50 :        33d2
             cmp  byte ptr [ esi + ecx ] , 02Ah                              ;0x0067ba52 :        803c0e2a
             setne dl                                                        ;0x0067ba56 :        0f95c2


     ;
     ;                 --------------------------------------------------------
     ;                      VFP 9.0 FIX - FIX THE GRID.DELETEMARK PROPERTY
     ;                                November 2026
     ;                 --------------------------------------------------------
     ;                                     CCB
     ;
     ; Fix the Grid.DeleteMark property.
     ;
     ; 2026/11/12, by ccb
     ;

     vfpa_deletemark_start:
             cmp dword ptr vfpa_sys9214_data,00h
             je vfpa_deletemark_end
             mov  ecx , dword ptr [ ebx + 20 ]
             imul ecx , ecx , 074h
             lea ecx ,  dword ptr [ ecx + ebx + 0138h ]
             ;; #define FOXGRID_DELETEMARK            00000200h
             test dword ptr [ ecx + 8 ] , 00000200h
             je vfpa_deletemark_end
             cmp dword ptr vfpa_deletemark_recordisnotfullyvisible,00h
             je vfpa_deletemark_end
             mov dword ptr vfpa_deletemark_recordisnotfullyvisible,00h
             neg edx
             inc edx
             jmp Label67ba59
     vfpa_deletemark_end:


     Label67ba59 ::
             push edx                                                        ;0x0067ba59 :        52
             call Fun52403d                                                  ;0x0067ba5a :        e8de85eaff
             mov  esi , dword ptr [ ebx + 12 ]                               ;0x0067ba5f :        8b730c
             call Fun41abc0                                                  ;0x0067ba62 :        e859f1d9ff
             cmp  dword ptr [ ebp - 8 ] , 00h                                ;0x0067ba67 :        837df800
             push  dword ptr [ ebp + 8 ]                                     ;0x0067ba6b :        ff7508
             je Label67ba79                                                  ;0x0067ba6e :        7409
             mov ecx , ebx                                                   ;0x0067ba70 :        8bcb
             call Fun45d228                                                  ;0x0067ba72 :        e8b117deff
             jmp Label67ba7f                                                 ;0x0067ba77 :        eb06

     Label67ba79 ::
             push ebx                                                        ;0x0067ba79 :        53
             call Fun51e049                                                  ;0x0067ba7a :        e8ca25eaff

     Label67ba7f ::
             or  byte ptr [ ebx + 91 ] , 040h                                ;0x0067ba7f :        804b5b40
             cmp  dword ptr [ ebp - 8 ] , 00h                                ;0x0067ba83 :        837df800
             je Label67ba97                                                  ;0x0067ba87 :        740e
             xor ecx , ecx                                                   ;0x0067ba89 :        33c9
             call Fun425165                                                  ;0x0067ba8b :        e8d596daff
             jmp Label67ba97                                                 ;0x0067ba90 :        eb05

     Label67ba92 ::
             call Fun7bddda                                                  ;0x0067ba92 :        e843231400

     Label67ba97 ::


     ;
     ;                 --------------------------------------------------------
     ;                      VFP 9.0 FIX - FIX THE GRID.DELETEMARK PROPERTY
     ;                                November 2026
     ;                 --------------------------------------------------------
     ;                                     CCB
     ;
     ; Fix the Grid.DeleteMark property.
     ;
     ; 2026/11/12, by ccb
     ;

             mov dword ptr vfpa_deletemark_recordisnotfullyvisible,00h


             pop edi                                                         ;0x0067ba97 :        5f
             pop esi                                                         ;0x0067ba98 :        5e
             pop ebx                                                         ;0x0067ba99 :        5b
             leave                                                           ;0x0067ba9a :        c9
             ret 04h                                                         ;0x0067ba9b :        c20400


4. APPLIES TO:

     VFP 6.0.8167.0
     VFP 6.0.8961.0 (SP5)

     VFP 7.0.0.9262
     VFP 7.0.0.9465 (SP1)

     VFP 8.0.0.2521
     VFP 8.0.0.3117 (SP1)

     VFP 9.0.0.2412
     VFP 9.0.0.3504 (SP1)
     VFP 9.0.0.4611 (SP2)
     VFP 9.0.0.5015 (SP2)
     VFP 9.0.0.5411 (SP2)
     VFP 9.0.0.5721 (SP2)
     VFP 9.0.0.5815 (SP2)
     VFP 9.0.0.6303 (SP2)
     VFP 9.0.0.6602 (SP2)
     VFP 9.0.0.7423 (SP2)

     The bug has been fixed in VFP Advanced.


5. REFERENCE WEBSITES:

     1, baiyujia.com:
     http://www.baiyujia.com
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix431.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix14.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix141.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix398.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix399.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix433.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix434.asp


6. OTHER:

     For reference only, there is no guarantees.

     Any questions or suggestions, please send me an email at ccb2000@163.com.