-----------------------------------------------------------------------------------------------------------
                      [BUG/PRB.] VFP 9.0 FIX - THE DEFAULT DELIMITERS FOR THE GETWORDNUM() AND GETWORDCOUNT() FUNCTIONS
                               January 2024
                 -----------------------------------------------------------------------------------------------------------
                                     CCB



1. BUG:

     In vfp9 (and vfp7, vfp8), the default delimiters are space, tab, and line feed for the GETWORDNUM() and GETWORDCOUNT() functions,
     now the default delimiters are space, tab, carriage return, and line feed for the GETWORDNUM() and GETWORDCOUNT() functions.

     There is the bug for the WORDNUM() and WORDS() functions in the library file foxtools.fll.

     The bug was reported by Tony Vignone.


2. CAUSE:

     There are some BUGs in the following code.


3. RESOLUTION:

     We can write some code to fix the BUG.

     Fun759f9d :: ; proc near
             push ecx                                                        ;0x00759f9d :        51
             push esi                                                        ;0x00759f9e :        56
             push edi                                                        ;0x00759f9f :        57
             mov esi , ecx                                                   ;0x00759fa0 :        8bf1
             mov  ecx , dword ptr [ esi + 8 ]                                ;0x00759fa2 :        8b4e08
             mov edi , eax                                                   ;0x00759fa5 :        8bf8
             mov  eax , dword ptr [ esi + 32 ]                               ;0x00759fa7 :        8b4620
             pushd 00h                                                       ;0x00759faa :        6a00
             inc ecx                                                         ;0x00759fac :        41
             push eax                                                        ;0x00759fad :        50
             call Fun42c2c4                                                  ;0x00759fae :        e81123cdff
             test edi , edi                                                  ;0x00759fb3 :        85ff
             mov  ecx , dword ptr [ esi + 32 ]                               ;0x00759fb5 :        8b4e20
             mov  edx , dword ptr [ecx]                                      ;0x00759fb8 :        8b11
             mov  eax , dword ptr [ esi + 8 ]                                ;0x00759fba :        8b4608
             mov  byte ptr [ eax + edx ] , 00h                               ;0x00759fbd :        c6041000
             je Label759ffd                                                  ;0x00759fc1 :        743a
             imul edi , edi , 02Ch                                           ;0x00759fc3 :        6bff2c
             add esi , edi                                                   ;0x00759fc6 :        03f7
             mov eax , esi                                                   ;0x00759fc8 :        8bc6
             call Fun42371d                                                  ;0x00759fca :        e84e97ccff
             cmp  byte ptr [esi] , 048h                                      ;0x00759fcf :        803e48
             je Label759fde                                                  ;0x00759fd2 :        740a
             mov ecx , 0385h                                                 ;0x00759fd4 :        b985030000
             call Fun544742                                                  ;0x00759fd9 :        e864a7deff

     Label759fde ::
             mov  ecx , dword ptr [ esi + 8 ]                                ;0x00759fde :        8b4e08
             mov  edx , dword ptr [ esi + 32 ]                               ;0x00759fe1 :        8b5620
             pushd 00h                                                       ;0x00759fe4 :        6a00
             inc ecx                                                         ;0x00759fe6 :        41
             push edx                                                        ;0x00759fe7 :        52
             call Fun42c2c4                                                  ;0x00759fe8 :        e8d722cdff
             mov  eax , dword ptr [ esi + 32 ]                               ;0x00759fed :        8b4620
             mov  eax , dword ptr [eax]                                      ;0x00759ff0 :        8b00
             mov  ecx , dword ptr [ esi + 8 ]                                ;0x00759ff2 :        8b4e08
             mov  byte ptr [ eax + ecx ] , 00h                               ;0x00759ff5 :        c6040800
             pop edi                                                         ;0x00759ff9 :        5f
             pop esi                                                         ;0x00759ffa :        5e
             pop ecx                                                         ;0x00759ffb :        59
             ret                                                             ;0x00759ffc :        c3

     Label759ffd ::
             pop edi                                                         ;0x00759ffd :        5f
             mov eax , offset Data928eac                                              ;0x00759ffe :        b8ac8e9200


     ;
     ;                 ------------------------------------------------------------------------------------------------
     ;                      VFP 9.0 FIX - THE DEFAULT DELIMITERS FOR THE GETWORDNUM() AND GETWORDCOUNT() FUNCTIONS
     ;                                   May 2021
     ;                 ------------------------------------------------------------------------------------------------
     ;                                     CCB
     ;
     ; In vfp9, the default delimiters are space, tab, and line feed for the GETWORDNUM() and GETWORDCOUNT() functions,
     ; now the default delimiters are space, tab, carriage return, and line feed for the GETWORDNUM() and GETWORDCOUNT() functions.
     ;
     ; 2021/5/18, by ccb
     ;

             ; mov dword ptr [eax] , 0A0D0920h


             pop esi                                                         ;0x0075a003 :        5e
             pop ecx                                                         ;0x0075a004 :        59
             ret                                                             ;0x0075a005 :        c3


4. APPLIES TO:

     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

     2, foxite.com:
     https://www.foxite.com/archives/getwordnum-bug-0000482701.htm


6. OTHER:

     For reference only, there is no guarantees.

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