---------------------------------------------------------------------------------
                      [BUG/PRB.] VFP 9.0 FIX - EVALUATE THE LABEL.CAPTION PROPERTY EXPRESSION
                               January 2024
                 ---------------------------------------------------------------------------------
                                     CCB



1. BUG:

     In Visual FoxPro 8.0 and later versions, it will evaluate the Label.Caption property expression, for example,
     THISFORM.Label1.Caption = "=DTOC(DATE())"
     THISFORM.Label1.Caption is equal to the current system date,
     but we can't set Label.Caption property to a string that begins with an equal sign ("="), for example,
     THISFORM.Label1.Caption = "=HELLO"
     THISFORM.Label1.Caption is equal to an empty string,
     it's wrong!

     In Visual FoxPro 7.0 and earlier versions, it will not evaluate the Label.Caption property expression, for example,
     THISFORM.Label1.Caption = "=HELLO"
     THISFORM.Label1.Caption is equal to "=HELLO",
     so there is no the bug in Visual FoxPro 7.0 and earlier versions.


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Fun4b14cd :: ; proc near
             push esi                                                        ;0x004b14cd :        56
             call Fun4c213b                                                  ;0x004b14ce :        e8680c0100
             mov  ecx , dword ptr [ esp + 8 ]                                ;0x004b14d3 :        8b4c2408
             mov  byte ptr [ ecx + 96 ] , al                                 ;0x004b14d7 :        884160
             mov eax , esi                                                   ;0x004b14da :        8bc6
             lea ecx ,  dword ptr [ eax + 1 ]                                ;0x004b14dc :        8d4801

     Label4b14df ::
             mov  dl , byte ptr [eax]                                        ;0x004b14df :        8a10
             inc eax                                                         ;0x004b14e1 :        40
             test dl , dl                                                    ;0x004b14e2 :        84d2
             jne Label4b14df                                                 ;0x004b14e4 :        75f9
             sub eax , ecx                                                   ;0x004b14e6 :        2bc1
             push eax                                                        ;0x004b14e8 :        50
             mov  eax , dword ptr [ esp + 8 ]                                ;0x004b14e9 :        8b442408
             push esi                                                        ;0x004b14ed :        56
             pushd 03Ah                                                      ;0x004b14ee :        6a3a
             pop ecx                                                         ;0x004b14f0 :        59
             call Fun41d6a3                                                  ;0x004b14f1 :        e8adc1f6ff
             test esi , esi                                                  ;0x004b14f6 :        85f6
             je Label4b1503                                                  ;0x004b14f8 :        7409


     ;
     ;                 ----------------------------------------------------------------------
     ;                      VFP 9.0 FIX - EVALUATE THE LABEL.CAPTION PROPERTY EXPRESSION
     ;                                   May 2020
     ;                 ----------------------------------------------------------------------
     ;                                     CCB
     ;
     ; Evaluate the Label.Caption property expression.
     ;
     ; 2020/5/20, by ccb
     ;

             cmp dword ptr vfpa_sys9031_data,00h
             je Label4b1503


             cmp  byte ptr [esi] , 03Dh                                      ;0x004b14fa :        803e3d
             je Label5ff298                                                  ;0x004b14fd :        0f8495dd1400

     Label4b1503 ::
             xor eax , eax                                                   ;0x004b1503 :        33c0
             inc eax                                                         ;0x004b1505 :        40
             ret 08h                                                         ;0x004b1506 :        c20800


4. APPLIES TO:

     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_vfp9fix116.asp

     2, mzvfp.com:
     http://www.mzvfp.com/read.php?tid=105117


6. OTHER:

     For reference only, there is no guarantees.

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