--------------------------------------------------------------------------------------------------
                      [ENHANCED] VFP 9.0 FIX - DISPLAY MORE ERROR MESSAGES FOR THE ERROR EXPRESSION IS INVALID
                                January 2024
                 --------------------------------------------------------------------------------------------------
                                     CCB



1. BUG:

     In vfp9 (and vfp6, vfp7, vfp8), if the expression you entered for a grid property is not valid,
     it will display the error message "Expression is invalid. Use a valid expression for name property".

     Please refer to the picture testdynamicforecolor-vfp9.png:

     In VFP Advanced, if the expression you entered for a grid property is not valid,
     it will display the error message "Expression is invalid. Use a valid expression for name property. <more error messages>".

     Please refer to the picture testdynamicforecolor-vfpa.png:


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Fun519682 :: ; proc near
             push ebp                                                        ;0x00519682 :        55
             lea ebp ,  dword ptr [ esp + 0FFFFFDD4h ]                       ;0x00519683 :        8dac24d4fdffff


     ;
     ;                 ---------------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - DISPLAY MORE ERROR MESSAGES FOR THE ERROR EXPRESSION IS INVALID
     ;                                  March 2023
     ;                 ---------------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property".
     ; In VFP Advanced, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property. ".
     ;
     ; 2023/3/18, by ccb
     ;

     ;         sub esp , 02B8h                                                 ;0x0051968a :        81ecb8020000

             sub esp , 02C8h                                                 ;0x0051968a :        81ecb8020000
             xor eax , eax
             mov  dword ptr [ ebp - 09Ch ][00h] , eax ;; vfpa_invalidexpression_ppcode.
             mov  dword ptr [ ebp - 09Ch ][04h] , eax ;; vfpa_invalidexpression_ppcode_old.
             mov  dword ptr [ ebp - 09Ch ][08h] , eax
             mov  dword ptr [ ebp - 09Ch ][0Ch] , eax


             mov eax ,  dword ptr [ Data937090 ]                             ;0x00519690 :        a190709300
             mov  dword ptr [ ebp + 0228h ] , eax                            ;0x00519695 :        898528020000
             mov eax ,  dword ptr [ Data9370f8 ]                             ;0x0051969b :        a1f8709300
             mov  eax , dword ptr [eax]                                      ;0x005196a0 :        8b00
             mov  ecx , dword ptr [ eax + 0158h ]                            ;0x005196a2 :        8b8858010000
             mov  eax , dword ptr [ eax + 24 ]                               ;0x005196a8 :        8b4018
             push ebx                                                        ;0x005196ab :        53
             push esi                                                        ;0x005196ac :        56
             mov  esi , dword ptr [ ebp + 023Ch ]                            ;0x005196ad :        8bb53c020000
             push edi                                                        ;0x005196b3 :        57
             mov  edi , dword ptr [ ebp + 0234h ]                            ;0x005196b4 :        8bbd34020000
             mov  dword ptr [ ebp + 0 ] , eax                                ;0x005196ba :        894500
             mov  eax , dword ptr [ edi + 06D0h ]                            ;0x005196bd :        8b87d0060000
             mov  dword ptr [ ebp + 12 ] , eax                               ;0x005196c3 :        89450c
             mov  eax , dword ptr [ esi + 0120h ]                            ;0x005196c6 :        8b8620010000
             test eax , eax                                                  ;0x005196cc :        85c0
             mov  dword ptr [ ebp - 8 ] , ecx                                ;0x005196ce :        894df8
             mov  ecx , dword ptr [ edi + 12 ]                               ;0x005196d1 :        8b4f0c
             mov  dword ptr [ ebp + 4 ] , ecx                                ;0x005196d4 :        894d04
             je Label5196ec                                                  ;0x005196d7 :        7413
             mov  edx , dword ptr [ Data9388dc ]                             ;0x005196d9 :        8b15dc889300
             lea eax ,  dword ptr [ eax + 4 * eax ]                          ;0x005196df :        8d0480
             shl eax , 05h                                                   ;0x005196e2 :        c1e005
             test  byte ptr [ eax + edx + 48 ] , 02h                         ;0x005196e5 :        f644103002
             jne Label51970a                                                 ;0x005196ea :        751e

     Label5196ec ::
             test ecx , ecx                                                  ;0x005196ec :        85c9
             je Label51970a                                                  ;0x005196ee :        741a
             mov  eax , dword ptr [ ebp + 0240h ]                            ;0x005196f0 :        8b8540020000
             lea eax ,  dword ptr [ esi + 4 * eax + 112 ]                    ;0x005196f6 :        8d448670
             mov  ebx , dword ptr [eax]                                      ;0x005196fa :        8b18
             test ebx , ebx                                                  ;0x005196fc :        85db
             mov  dword ptr [ ebp + 8 ] , eax                                ;0x005196fe :        894508
             mov  dword ptr [ ebp - 12 ] , ebx                               ;0x00519701 :        895df4
             jne Label452466                                                 ;0x00519704 :        0f855c8df3ff

     Label51970a ::
             xor eax , eax                                                   ;0x0051970a :        33c0

     Label51970c ::


     ;
     ;                 ---------------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - DISPLAY MORE ERROR MESSAGES FOR THE ERROR EXPRESSION IS INVALID
     ;                                  March 2023
     ;                 ---------------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property".
     ; In VFP Advanced, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property. ".
     ;
     ; 2023/3/18, by ccb
     ;

     ;         lea esp ,  dword ptr [ ebp + 0FFFFFF68h ]                       ;0x0051970c :        8da568ffffff
             lea esp ,  dword ptr [ ebp + 0FFFFFF68h ][-10h]                       ;0x0051970c :        8da568ffffff


             mov  ecx , dword ptr [ ebp + 0228h ]                            ;0x00519712 :        8b8d28020000
             call Fun42bf1d                                                  ;0x00519718 :        e80028f1ff
             pop edi                                                         ;0x0051971d :        5f
             pop esi                                                         ;0x0051971e :        5e
             pop ebx                                                         ;0x0051971f :        5b
             add ebp , 022Ch                                                 ;0x00519720 :        81c52c020000
             leave                                                           ;0x00519726 :        c9
             ret 014h                                                        ;0x00519727 :        c21400

     Label452466 ::
             cmp ebx , 01h                                                   ;0x00452466 :        83fb01
             mov  eax , dword ptr [ edi + 8 ]                                ;0x00452469 :        8b4708
             mov  dword ptr [ ebp + 20 ] , eax                               ;0x0045246c :        894514
             je Label56b85a                                                  ;0x0045246f :        0f84e5931100
             xor eax , eax                                                   ;0x00452475 :        33c0
             call Fun42c118                                                  ;0x00452477 :        e89c9cfdff
             mov eax , esp                                                   ;0x0045247c :        8bc4
             sub  eax , dword ptr [ Data9370c4 ]                             ;0x0045247e :        2b05c4709300
             cmp eax , ebx                                                   ;0x00452484 :        3bc3
             jle Label56b86f                                                 ;0x00452486 :        0f8ee3931100
             mov eax , ebx                                                   ;0x0045248c :        8bc3
             add eax , 07h                                                   ;0x0045248e :        83c007
             and eax , 0FFFFFFF8h                                            ;0x00452491 :        83e0f8
             call Fun42c118                                                  ;0x00452494 :        e87f9cfdff
             mov  dword ptr [ ebp + 24 ] , esp                               ;0x00452499 :        896518

     Label45249c ::
             cmp  dword ptr [ ebp + 24 ] , 00h                               ;0x0045249c :        837d1800
             mov ebx , 0134h                                                 ;0x004524a0 :        bb34010000
             je Label56b878                                                  ;0x004524a5 :        0f84cd931100
             xor eax , eax                                                   ;0x004524ab :        33c0
             call Fun42c118                                                  ;0x004524ad :        e8669cfdff
             mov  eax , dword ptr [ edi + 0524h ]                            ;0x004524b2 :        8b8724050000
             mov ecx , esp                                                   ;0x004524b8 :        8bcc
             sub  ecx , dword ptr [ Data9370c4 ]                             ;0x004524ba :        2b0dc4709300
             shl eax , 02h                                                   ;0x004524c0 :        c1e002
             cmp ecx , eax                                                   ;0x004524c3 :        3bc8
             jle Label56b87f                                                 ;0x004524c5 :        0f8eb4931100
             add eax , 07h                                                   ;0x004524cb :        83c007
             and eax , 0FFFFFFF8h                                            ;0x004524ce :        83e0f8
             call Fun42c118                                                  ;0x004524d1 :        e8429cfdff
             mov  dword ptr [ ebp + 16 ] , esp                               ;0x004524d6 :        896510

     Label4524d9 ::
             cmp  dword ptr [ ebp + 16 ] , 00h                               ;0x004524d9 :        837d1000
             je Label56b888                                                  ;0x004524dd :        0f84a5931100
             mov  eax , dword ptr [ ebp + 0240h ]                            ;0x004524e3 :        8b8540020000
             mov  ecx , dword ptr [ esi + 4 * eax + 40 ]                     ;0x004524e9 :        8b4c8628
             mov  edx , dword ptr [ ebp + 24 ]                               ;0x004524ed :        8b5518
             mov eax , edi                                                   ;0x004524f0 :        8bc7
             call Fun51980c                                                  ;0x004524f2 :        e815730c00
             mov  ebx , dword ptr [ ebp + 8 ]                                ;0x004524f7 :        8b5d08
             xor eax , eax                                                   ;0x004524fa :        33c0
             inc eax                                                         ;0x004524fc :        40
             mov  dword ptr [ebx] , eax                                      ;0x004524fd :        8903
             test  byte ptr [ esi + 012Eh ] , 02h                            ;0x004524ff :        f6862e01000002
             push eax                                                        ;0x00452506 :        50
             jne Label56b88f                                                 ;0x00452507 :        0f8582931100
             mov  ecx , dword ptr [ edi + 12 ]                               ;0x0045250d :        8b4f0c

     Label452510 ::
             call Fun52da49                                                  ;0x00452510 :        e834b50d00
             mov eax ,  dword ptr [ Data9393ac ]                             ;0x00452515 :        a1ac939300
             mov  dword ptr [ ebp - 20 ] , eax                               ;0x0045251a :        8945ec
             mov  eax , dword ptr [ ebp + 24 ]                               ;0x0045251d :        8b4518
             mov dword ptr [ Data9393ac ] ,  eax                             ;0x00452520 :        a3ac939300
             mov eax , esi                                                   ;0x00452525 :        8bc6
             sub eax , edi                                                   ;0x00452527 :        2bc7
             xor edx , edx                                                   ;0x00452529 :        33d2
             sub eax , 0740h                                                 ;0x0045252b :        2d40070000
             mov ecx , 0158h                                                 ;0x00452530 :        b958010000
             div ecx                                                         ;0x00452535 :        f7f1
             lea ecx ,  dword ptr [ ebp - 24 ]                               ;0x00452537 :        8d4de8
             push ecx                                                        ;0x0045253a :        51
             lea ecx ,  dword ptr [ ebp + 28 ]                               ;0x0045253b :        8d4d1c
             push ecx                                                        ;0x0045253e :        51
             push edi                                                        ;0x0045253f :        57
             lea edx ,  dword ptr [ ebp - 28 ]                               ;0x00452540 :        8d55e4
             lea ecx ,  dword ptr [ ebp - 16 ]                               ;0x00452543 :        8d4df0
             call Fun4521b6                                                  ;0x00452546 :        e86bfcffff
             inc  dword ptr [ edi + 0104h ]                                  ;0x0045254b :        ff8704010000
             xor esi , esi                                                   ;0x00452551 :        33f6
             cmp  dword ptr [ edi + 12 ] , esi                               ;0x00452553 :        39770c
             je Label452560                                                  ;0x00452556 :        7408
             push  dword ptr [ ebp + 16 ]                                    ;0x00452558 :        ff7510
             call Fun519c4f                                                  ;0x0045255b :        e8ef760c00

     Label452560 ::
             mov eax ,  dword ptr [ Data9370f8 ]                             ;0x00452560 :        a1f8709300
             mov  ecx , dword ptr [ ebp + 12 ]                               ;0x00452565 :        8b4d0c
             cmp ecx , esi                                                   ;0x00452568 :        3bce
             mov  dword ptr [ebx] , esi                                      ;0x0045256a :        8933
             mov  eax , dword ptr [eax]                                      ;0x0045256c :        8b00
             mov  dword ptr [ eax + 0158h ] , esi                            ;0x0045256e :        89b058010000
             je Label452584                                                  ;0x00452574 :        740e
             mov eax ,  dword ptr [ Data93e77c ]                             ;0x00452576 :        a17ce79300
             mov  dword ptr [ Data93e77c ] , ecx                             ;0x0045257b :        890d7ce79300
             mov  dword ptr [ ebp - 32 ] , eax                               ;0x00452581 :        8945e0

     Label452584 ::


     ;
     ;                 ---------------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - DISPLAY MORE ERROR MESSAGES FOR THE ERROR EXPRESSION IS INVALID
     ;                                  March 2023
     ;                 ---------------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property".
     ; In VFP Advanced, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property. ".
     ;
     ; 2023/3/18, by ccb
     ;

             mov  eax , dword ptr [ ebp + 0238h ]
             mov  byte ptr [eax] , 043h
             mov  dword ptr [ eax + 04h ] , 00h
             mov  dword ptr [ eax + 08h ] , 00h
             mov  byte ptr [ eax + 2Ch ] , 00h
             mov  eax , dword ptr [ Data9393ac ]
             mov  dword ptr [ ebp - 09Ch ][00h] , eax
             mov dword ptr vfpa_invalidexpression_errornumber,00h
             mov byte ptr vfpa_invalidexpression_errormessage,00h
             mov byte ptr vfpa_invalidexpression_errorsource,00h
             mov byte ptr vfpa_invalidexpression_errortext,00h


             lea edx ,  dword ptr [ ebp + 8 ]                                ;0x00452584 :        8d5508
             lea eax ,  dword ptr [ ebp + 0FFFFFF78h ]                       ;0x00452587 :        8d8578ffffff
             call Fun42c27f                                                  ;0x0045258d :        e8ed9cfdff
             push esi                                                        ;0x00452592 :        56
             push eax                                                        ;0x00452593 :        50
             call Fun42c2be                                                  ;0x00452594 :        e8259dfdff
             pop ecx                                                         ;0x00452599 :        59
             cmp eax , esi                                                   ;0x0045259a :        3bc6
             mov  esi , dword ptr [ ebp + 0238h ]                            ;0x0045259c :        8bb538020000
             pop ecx                                                         ;0x004525a2 :        59
             mov  dword ptr [ ebp + 24 ] , eax                               ;0x004525a3 :        894518
             jne Label4525bf                                                 ;0x004525a6 :        7517
             mov eax ,  dword ptr [ Data9393ac ]                             ;0x004525a8 :        a1ac939300
             cmp  byte ptr [eax] , 0FCh                                      ;0x004525ad :        8038fc
             jne Label56b896                                                 ;0x004525b0 :        0f85e0921100
             push esi                                                        ;0x004525b6 :        56
             pushd 08h                                                       ;0x004525b7 :        6a08
             pop ebx                                                         ;0x004525b9 :        5b
             call Fun52a938                                                  ;0x004525ba :        e879830d00

     Label4525bf ::
             lea eax ,  dword ptr [ ebp + 8 ]                                ;0x004525bf :        8d4508
             push eax                                                        ;0x004525c2 :        50
             lea eax ,  dword ptr [ ebp + 0FFFFFF78h ]                       ;0x004525c3 :        8d8578ffffff
             call Fun42d200                                                  ;0x004525c9 :        e832acfdff


     ;
     ;                 ---------------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - DISPLAY MORE ERROR MESSAGES FOR THE ERROR EXPRESSION IS INVALID
     ;                                  March 2023
     ;                 ---------------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property".
     ; In VFP Advanced, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property. ".
     ;
     ; 2023/3/18, by ccb
     ;

             cmp dword ptr vfpa_sys9124_data,0FFFFFFFFh
             je Label4525ce
             cmp dword ptr vfpa_sys9124_data,00h
             je Label4525ce
             mov eax , dword ptr [ ebp + 24 ]
             cmp eax,00h
             je Label4525ce
             mov dword ptr vfpa_invalidexpression_errornumber,eax
             mov byte ptr vfpa_invalidexpression_errormessage,00h
             mov byte ptr vfpa_invalidexpression_errorsource,00h
             mov byte ptr vfpa_invalidexpression_errortext,00h
             push 0F0h
             lea eax,byte ptr vfpa_invalidexpression_errormessage
             mov byte ptr [eax],20h
             inc eax
             push eax
             push dword ptr vfpa_invalidexpression_errornumber
             call vfpa_geterrormessage
             mov  eax , dword ptr [ ebp - 09Ch ][00h]
             cmp  byte ptr [eax] , 0FCh
             jne Label4525ce
             mov  eax , dword ptr [ Data9393ac ]
             mov  dword ptr [ ebp - 09Ch ][04h] , eax
             mov  eax , dword ptr [ ebp - 09Ch ][00h]
             mov  dword ptr [ Data9393ac ] , eax
             lea ecx,byte ptr vfpa_invalidexpression_errorsource
             mov byte ptr [ecx],20h
             inc ecx
             mov edx , 01F0h
             push 01h
             push edx
             push ecx
             call vfpa_geterrorsource
             mov  eax , dword ptr [ ebp - 09Ch ][04h]
             mov  dword ptr [ Data9393ac ] , eax


     Label4525ce ::
             mov  ebx , dword ptr [ ebp + 12 ]                               ;0x004525ce :        8b5d0c
             test ebx , ebx                                                  ;0x004525d1 :        85db
             je Label4525dd                                                  ;0x004525d3 :        7408
             mov  eax , dword ptr [ ebp - 32 ]                               ;0x004525d5 :        8b45e0
             mov dword ptr [ Data93e77c ] ,  eax                             ;0x004525d8 :        a37ce79300

     Label4525dd ::
             cmp  dword ptr [ ebp + 24 ] , 00h                               ;0x004525dd :        837d1800
             mov eax ,  dword ptr [ Data9370f8 ]                             ;0x004525e1 :        a1f8709300
             mov  eax , dword ptr [eax]                                      ;0x004525e6 :        8b00
             mov  ecx , dword ptr [ ebp - 8 ]                                ;0x004525e8 :        8b4df8
             mov  dword ptr [ eax + 0158h ] , ecx                            ;0x004525eb :        898858010000
             mov  eax , dword ptr [ ebp + 023Ch ]                            ;0x004525f1 :        8b853c020000
             mov  ecx , dword ptr [ ebp + 0240h ]                            ;0x004525f7 :        8b8d40020000
             lea edi ,  dword ptr [ eax + 4 * ecx + 112 ]                    ;0x004525fd :        8d7c8870
             mov  eax , dword ptr [ ebp - 20 ]                               ;0x00452601 :        8b45ec
             mov  dword ptr [edi] , 01h                                      ;0x00452604 :        c70701000000
             mov dword ptr [ Data9393ac ] ,  eax                             ;0x0045260a :        a3ac939300
             jne Label56b8b4                                                 ;0x0045260f :        0f859f921100

     Label452615 ::
             mov  al , byte ptr [esi]                                        ;0x00452615 :        8a06
             cmp al , 04Dh                                                   ;0x00452617 :        3c4d
             je Label56b914                                                  ;0x00452619 :        0f84f5921100
             cmp al , 057h                                                   ;0x0045261f :        3c57
             je Label56b92b                                                  ;0x00452621 :        0f8404931100

     Label452627 ::
             push  dword ptr [ ebp - 16 ]                                    ;0x00452627 :        ff75f0
             mov  ecx , dword ptr [ ebp - 28 ]                               ;0x0045262a :        8b4de4
             lea eax ,  dword ptr [ ebp + 28 ]                               ;0x0045262d :        8d451c
             push eax                                                        ;0x00452630 :        50
             mov  eax , dword ptr [ ebp - 24 ]                               ;0x00452631 :        8b45e8
             call Fun452422                                                  ;0x00452634 :        e8e9fdffff
             mov  eax , dword ptr [ ebp + 4 ]                                ;0x00452639 :        8b4504
             test eax , eax                                                  ;0x0045263c :        85c0
             je Label56b957                                                  ;0x0045263e :        0f8413931100
             test  byte ptr [ eax + 16 ] , 020h                              ;0x00452644 :        f6401020
             je Label56b957                                                  ;0x00452648 :        0f8409931100
             mov ecx , ebx                                                   ;0x0045264e :        8bcb
             call Fun53eaa2                                                  ;0x00452650 :        e84dc40e00
             test eax , eax                                                  ;0x00452655 :        85c0
             je Label56b961                                                  ;0x00452657 :        0f8404931100
             mov  ecx , dword ptr [ Data9388dc ]                             ;0x0045265d :        8b0ddc889300
             lea eax ,  dword ptr [ ebx + 4 * ebx ]                          ;0x00452663 :        8d049b
             shl eax , 05h                                                   ;0x00452666 :        c1e005
             mov  eax , dword ptr [ eax + ecx + 108 ]                        ;0x00452669 :        8b44086c
             cmp  eax , dword ptr [ ebp + 20 ]                               ;0x0045266d :        3b4514
             jne Label56b961                                                 ;0x00452670 :        0f85eb921100
             mov  ecx , dword ptr [ ebp + 0 ]                                ;0x00452676 :        8b4d00
             call Fun52a6f6                                                  ;0x00452679 :        e878800d00
             mov  eax , dword ptr [ ebp + 20 ]                               ;0x0045267e :        8b4514
             mov  ebx , dword ptr [eax]                                      ;0x00452681 :        8b18
             call Fun519640                                                  ;0x00452683 :        e8b86f0c00
             dec  dword ptr [ ebx + 0104h ]                                  ;0x00452688 :        ff8b04010000
             cmp  dword ptr [ ebp + 0240h ] , 00h                            ;0x0045268e :        83bd4002000000
             mov  eax , dword ptr [ ebp - 12 ]                               ;0x00452695 :        8b45f4
             mov  dword ptr [edi] , eax                                      ;0x00452698 :        8907
             je Label56b96b                                                  ;0x0045269a :        0f84cb921100

     Label4526a0 ::
             push  dword ptr [ ebp + 16 ]                                    ;0x004526a0 :        ff7510
             call Fun519a5f                                                  ;0x004526a3 :        e8b7730c00
             call Fun43e4fe                                                  ;0x004526a8 :        e851befeff
             test eax , eax                                                  ;0x004526ad :        85c0
             jne Label56b97c                                                 ;0x004526af :        0f85c7921100

     Label4526b5 ::
             xor eax , eax                                                   ;0x004526b5 :        33c0
             cmp  dword ptr [ ebp + 24 ] , eax                               ;0x004526b7 :        394518
             jne Label56b986                                                 ;0x004526ba :        0f85c6921100

     Label4526c0 ::
             xor eax , eax                                                   ;0x004526c0 :        33c0
             inc eax                                                         ;0x004526c2 :        40
             jmp Label51970c                                                 ;0x004526c3 :        e944700c00

     Label56b85a ::
             pushd 00h                                                       ;0x0056b85a :        6a00
             xor edx , edx                                                   ;0x0056b85c :        33d2
             mov ecx , edi                                                   ;0x0056b85e :        8bcf
             call Fun51eadb                                                  ;0x0056b860 :        e87632fbff
             mov ecx , 0A4h                                                  ;0x0056b865 :        b9a4000000
             call Fun544742                                                  ;0x0056b86a :        e8d38efdff

     Label56b86f ::
             and  dword ptr [ ebp + 24 ] , 00h                               ;0x0056b86f :        83651800
             jmp Label45249c                                                 ;0x0056b873 :        e9246ceeff

     Label56b878 ::
             mov ecx , ebx                                                   ;0x0056b878 :        8bcb
             call Fun544742                                                  ;0x0056b87a :        e8c38efdff

     Label56b87f ::
             and  dword ptr [ ebp + 16 ] , 00h                               ;0x0056b87f :        83651000
             jmp Label4524d9                                                 ;0x0056b883 :        e9516ceeff

     Label56b888 ::
             mov ecx , ebx                                                   ;0x0056b888 :        8bcb
             call Fun544742                                                  ;0x0056b88a :        e8b38efdff

     Label56b88f ::
             mov  ecx , dword ptr [esi]                                      ;0x0056b88f :        8b0e
             jmp Label452510                                                 ;0x0056b891 :        e97a6ceeff

     Label56b896 ::
             pushd 0FFFFFFFFh                                                ;0x0056b896 :        6aff
             mov edx , 01000h                                                ;0x0056b898 :        ba00100000
             lea ecx ,  dword ptr [ ebp - 56 ]                               ;0x0056b89d :        8d4dc8
             call Fun421184                                                  ;0x0056b8a0 :        e8df58ebff
             lea edx ,  dword ptr [ ebp - 56 ]                               ;0x0056b8a5 :        8d55c8
             mov eax , esi                                                   ;0x0056b8a8 :        8bc6
             call Fun4503a9                                                  ;0x0056b8aa :        e8fa4aeeff
             jmp Label4525bf                                                 ;0x0056b8af :        e90b6deeff

     Label56b8b4 ::
             cmp  dword ptr [ ebp + 0244h ] , 00h                            ;0x0056b8b4 :        83bd4402000000
             je Label452615                                                  ;0x0056b8bb :        0f84546deeff
             mov  eax , dword ptr [ ebp + 4 ]                                ;0x0056b8c1 :        8b4504
             test eax , eax                                                  ;0x0056b8c4 :        85c0
             je Label56b90c                                                  ;0x0056b8c6 :        7444
             test  byte ptr [ eax + 16 ] , 020h                              ;0x0056b8c8 :        f6401020
             je Label56b90c                                                  ;0x0056b8cc :        743e
             mov ecx , ebx                                                   ;0x0056b8ce :        8bcb
             call Fun53eaa2                                                  ;0x0056b8d0 :        e8cd31fdff
             test eax , eax                                                  ;0x0056b8d5 :        85c0
             je Label56b90c                                                  ;0x0056b8d7 :        7433
             mov  ecx , dword ptr [ Data9388dc ]                             ;0x0056b8d9 :        8b0ddc889300
             mov  edx , dword ptr [ ebp + 20 ]                               ;0x0056b8df :        8b5514
             lea eax ,  dword ptr [ ebx + 4 * ebx ]                          ;0x0056b8e2 :        8d049b
             shl eax , 05h                                                   ;0x0056b8e5 :        c1e005
             cmp  dword ptr [ eax + ecx + 108 ] , edx                        ;0x0056b8e8 :        3954086c
             jne Label56b90c                                                 ;0x0056b8ec :        751e
             mov  ecx , dword ptr [ ebp + 0 ]                                ;0x0056b8ee :        8b4d00
             call Fun52a6f6                                                  ;0x0056b8f1 :        e800eefbff
             mov  eax , dword ptr [ ebp + 20 ]                               ;0x0056b8f6 :        8b4514
             call Fun519640                                                  ;0x0056b8f9 :        e842ddfaff
             mov  eax , dword ptr [ ebp + 20 ]                               ;0x0056b8fe :        8b4514
             mov  ecx , dword ptr [eax]                                      ;0x0056b901 :        8b08
             pushd 00h                                                       ;0x0056b903 :        6a00
             xor edx , edx                                                   ;0x0056b905 :        33d2
             call Fun51eadb                                                  ;0x0056b907 :        e8cf31fbff

     Label56b90c ::
             mov  ecx , dword ptr [ ebp + 24 ]                               ;0x0056b90c :        8b4d18
             call Fun544742                                                  ;0x0056b90f :        e82e8efdff

     Label56b914 ::
             lea eax ,  dword ptr [ esi + 44 ]                               ;0x0056b914 :        8d462c
             push eax                                                        ;0x0056b917 :        50
             mov ebx , 0FFh                                                  ;0x0056b918 :        bbff000000
             call Fun43627b                                                  ;0x0056b91d :        e859a9ecff
             and  dword ptr [ esi + 4 ] , 00h                                ;0x0056b922 :        83660400
             mov  byte ptr [esi] , 043h                                      ;0x0056b926 :        c60643
             jmp Label56b943                                                 ;0x0056b929 :        eb18

     Label56b92b ::
             lea eax ,  dword ptr [ esi + 44 ]                               ;0x0056b92b :        8d462c
             push eax                                                        ;0x0056b92e :        50
             mov ebx , 0FFh                                                  ;0x0056b92f :        bbff000000
             call Fun43627b                                                  ;0x0056b934 :        e842a9ecff
             mov  byte ptr [esi] , 051h                                      ;0x0056b939 :        c60651
             mov  dword ptr [ esi + 4 ] , 01h                                ;0x0056b93c :        c7460401000000

     Label56b943 ::
             mov  eax , dword ptr [ esi + 12 ]                               ;0x0056b943 :        8b460c
             cmp eax , ebx                                                   ;0x0056b946 :        3bc3
             jle Label56b94c                                                 ;0x0056b948 :        7e02
             mov eax , ebx                                                   ;0x0056b94a :        8bc3

     Label56b94c ::
             mov  ebx , dword ptr [ ebp + 12 ]                               ;0x0056b94c :        8b5d0c
             mov  dword ptr [ esi + 8 ] , eax                                ;0x0056b94f :        894608
             jmp Label452627                                                 ;0x0056b952 :        e9d06ceeff

     Label56b957 ::
             mov ecx , 0A3h                                                  ;0x0056b957 :        b9a3000000
             call Fun544742                                                  ;0x0056b95c :        e8e18dfdff

     Label56b961 ::
             mov ecx , 0A4h                                                  ;0x0056b961 :        b9a4000000
             call Fun544742                                                  ;0x0056b966 :        e8d78dfdff

     Label56b96b ::
             movzx eax ,byte ptr [esi]                                       ;0x0056b96b :        0fb606
             mov  ecx , dword ptr [ ebp + 023Ch ]                            ;0x0056b96e :        8b8d3c020000
             mov  dword ptr [ ecx + 8 ] , eax                                ;0x0056b974 :        894108
             jmp Label4526a0                                                 ;0x0056b977 :        e9246deeff

     Label56b97c ::
             call Fun901c42                                                  ;0x0056b97c :        e8c1623900
             jmp Label4526b5                                                 ;0x0056b981 :        e92f6deeff

     Label56b986 ::
             cmp  dword ptr [ ebp + 0244h ] , eax                            ;0x0056b986 :        398544020000
             jne Label4526c0                                                 ;0x0056b98c :        0f852e6deeff
             mov  esi , dword ptr [ ebp + 0240h ]                            ;0x0056b992 :        8bb540020000
             mov  dword ptr [edi] , eax                                      ;0x0056b998 :        8907
             mov  edi , dword ptr [ ebp + 023Ch ]                            ;0x0056b99a :        8bbd3c020000
             mov  eax , dword ptr [ edi + 4 * esi + 40 ]                     ;0x0056b9a0 :        8b44b728
             cmp eax , 0FFFFFFFFh                                            ;0x0056b9a4 :        83f8ff
             je Label56b9ca                                                  ;0x0056b9a7 :        7421
             test  byte ptr [ edi + 012Eh ] , 020h                           ;0x0056b9a9 :        f6872e01000020
             push eax                                                        ;0x0056b9b0 :        50
             je Label56b9bb                                                  ;0x0056b9b1 :        7408
             mov  eax , dword ptr [ ebx + 0134h ]                            ;0x0056b9b3 :        8b8334010000
             jmp Label56b9c0                                                 ;0x0056b9b9 :        eb05

     Label56b9bb ::
             mov eax ,  dword ptr [ Data93d290 ]                             ;0x0056b9bb :        a190d29300

     Label56b9c0 ::
             call Fun43ed40                                                  ;0x0056b9c0 :        e87b33edff
             or  dword ptr [ edi + 4 * esi + 40 ] , 0FFFFFFFFh               ;0x0056b9c5 :        834cb728ff

     Label56b9ca ::
             mov  ecx , dword ptr [ 4 * esi + offset Data945508 ]                     ;0x0056b9ca :        8b0cb508559400
             test ecx , ecx                                                  ;0x0056b9d1 :        85c9
             je Label56b9f6                                                  ;0x0056b9d3 :        7421
             mov  eax , dword ptr [ edi + 0120h ]                            ;0x0056b9d5 :        8b8720010000
             test eax , eax                                                  ;0x0056b9db :        85c0
             je Label56b9f6                                                  ;0x0056b9dd :        7417
             push eax                                                        ;0x0056b9df :        50
             mov bx , 0Ch                                                    ;0x0056b9e0 :        66bb0c00
             mov esi , ecx                                                   ;0x0056b9e4 :        8bf1
             call Fun5075ad                                                  ;0x0056b9e6 :        e8c2bbf9ff
             call Fun73f215                                                  ;0x0056b9eb :        e825381d00
             mov  esi , dword ptr [ ebp + 0240h ]                            ;0x0056b9f0 :        8bb540020000

     Label56b9f6 ::
             pushd 00h                                                       ;0x0056b9f6 :        6a00
             lea eax ,  dword ptr [ ebp + 011Ch ]                            ;0x0056b9f8 :        8d851c010000
             push eax                                                        ;0x0056b9fe :        50
             pushd 02F7h                                                     ;0x0056b9ff :        68f7020000
             call Fun4ce6c0                                                  ;0x0056ba04 :        e8b72cf6ff


     ;
     ;                 ---------------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - DISPLAY MORE ERROR MESSAGES FOR THE ERROR EXPRESSION IS INVALID
     ;                                  March 2023
     ;                 ---------------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property".
     ; In VFP Advanced, if the expression you entered for a grid property is not valid,
     ; it will display the error message "Expression is invalid. Use a valid expression for name property. ".
     ;
     ; 2023/3/18, by ccb
     ;

             cmp dword ptr vfpa_sys9124_data,0FFFFFFFFh
             je Label51970a
             cmp dword ptr vfpa_sys9124_data,00h
             je Label56ba09
             cmp dword ptr vfpa_invalidexpression_errornumber,00h
             je Label56ba09
             lea eax ,  dword ptr [ ebp + 011Ch ]
             push eax
             lea eax,byte ptr vfpa_invalidexpression_errortext
             push eax
             call lstrcpyA
             lea eax,byte ptr vfpa_invalidexpression_errormessage
             push eax
             lea eax,byte ptr vfpa_invalidexpression_errortext
             push eax
             call lstrcatA
             lea eax,byte ptr vfpa_invalidexpression_errorsource
             push eax
             lea eax,byte ptr vfpa_invalidexpression_errortext
             push eax
             call lstrcatA
             pushd 00h
             pushd 01h
             lea eax,byte ptr vfpa_invalidexpression_errortext
             push eax
             call Fun6da3d3
             jmp Label56ba19


     Label56ba09 ::
             pushd 00h                                                       ;0x0056ba09 :        6a00
             pushd 01h                                                       ;0x0056ba0b :        6a01
             lea eax ,  dword ptr [ ebp + 011Ch ]                            ;0x0056ba0d :        8d851c010000
             push eax                                                        ;0x0056ba13 :        50
             call Fun6da3d3                                                  ;0x0056ba14 :        e8bae91600

     Label56ba19 ::
             cmp eax , 01h                                                   ;0x0056ba19 :        83f801
             je Label51970a                                                  ;0x0056ba1c :        0f84e8dcfaff
             xor eax , eax                                                   ;0x0056ba22 :        33c0
             inc eax                                                         ;0x0056ba24 :        40
             mov ecx , esi                                                   ;0x0056ba25 :        8bce
             shl eax , cl                                                    ;0x0056ba27 :        d3e0
             and eax , 03FFFFh                                               ;0x0056ba29 :        25ffff0300
             or  dword ptr [ edi + 0B8h ] , eax                              ;0x0056ba2e :        0987b8000000
             jmp Label51970a                                                 ;0x0056ba34 :        e9d1dcfaff


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_vfp9fix253.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix263.asp
     http://www.baiyujia.com/vfpdocuments/f_vfp9fix264.asp

     2, foxite.com:
     https://www.foxite.com/archives/dynamicback-colour-0000386155.htm
     https://www.foxite.com/archives/dynamicbackcolor-0000159922.htm
     https://www.foxite.com/archives/grid-expression-invalid-0000181090.htm
     https://www.foxite.com/archives/grid-dynamicbackcolors-error-0000419030.htm
     https://www.foxite.com/archives/color-grid-cell-dynamic-columns-0000376645.htm


6. OTHER:

     For reference only, there is no guarantees.

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