--------------------------------------------------------------------------------------------
[BUG/PRB.] VFP 9.0 FIX - THE DEFAULT SETTING OF THE PAGEFRAME.RIGHTTOLEFT PROPERTY
January 2026
--------------------------------------------------------------------------------------------
CCB
1. BUG:
In vfp9 (and vfp6, vfp7, vfp8), usually the default setting of the RightToLeft property is false (.F.),
but for the PageFrame object, the default setting of the RightToLeft property is true (.T.).
If the setting of the PageFrame.RightToLeft property is true (.T.), there are some problems for the Page.Caption property.
For example, if we set Page.Caption = "Page(1)", it will display "(Page(1".
Please refer to the picture testpagecaption-vfp9.jpg:
2. CAUSE:
There are some BUGs in the following code.
3. RESOLUTION:
We can write some code to fix the BUG.
Label44ac1d ::
mov eax , dword ptr [ ebp + 0 ] ;0x0044ac1d : 8b4500
mov ecx , dword ptr [ esp + 0170h ] ;0x0044ac20 : 8b8c2470010000
xor edx , edx ;0x0044ac27 : 33d2
mov dx , word ptr [ eax + 96 ] ;0x0044ac29 : 668b5060
and edx , 0800h ;0x0044ac2d : 81e200080000
sub edx , 0800h ;0x0044ac33 : 81ea00080000
neg edx ;0x0044ac39 : f7da
sbb edx , edx ;0x0044ac3b : 1bd2
xor ebx , ebx ;0x0044ac3d : 33db
inc edx ;0x0044ac3f : 42
test ecx , ecx ;0x0044ac40 : 85c9
setne bl ;0x0044ac42 : 0f95c3
cmp edx , ebx ;0x0044ac45 : 3bd3
je Label48186f ;0x0044ac47 : 0f84226c0300
test ecx , ecx ;0x0044ac4d : 85c9
je Label61213b ;0x0044ac4f : 0f84e6741c00
;
; ---------------------------------------------------------------------------------
; VFP 9.0 FIX - THE DEFAULT SETTING OF THE PAGEFRAME.RIGHTTOLEFT PROPERTY
; December 2017
; ---------------------------------------------------------------------------------
; CCB
;
; don't set the default setting of the PageFrame.RightToLeft property to true (.T.),
; now the default setting of the PageFrame.RightToLeft property is false (.F.).
;
; 2017/12/29, by ccb
;
; or byte ptr [ eax + 97 ] , 08h ;0x0044ac55 : 80486108
Label44ac59 ::
cmp word ptr [ Data939364 ] , 00h ;0x0044ac59 : 66833d6493930000
jne Label612144 ;0x0044ac61 : 0f85dd741c00
jmp Label48186f ;0x0044ac67 : e9036c0300
Now in VFP Advanced, the default setting of the PageFrame.RightToLeft property is false (.F.).
For example, if we set Page.Caption = "Page(1)", it will display "Page(1)".
Please refer to the picture testpagecaption-vfpa.jpg:
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
2, foxite.com:
https://www.foxite.com/archives/bug-in-page-caption-of-pageframe-0000411291.htm
https://www.foxite.com/archives/pageframe-captions-0000393709.htm
https://www.foxite.com/archives/pageframe-page-caption-bug-0000241406.htm
https://www.foxite.com/archives/page-caption-0000090695.htm
3, microsoft.com:
https://www.microsoft.com/middleeast/msdn/VisualFoxPro.aspx
https://social.msdn.microsoft.com/Forums/en-US/04267598-8c64-4061-b8be-6f1cd48fc664/page-frame-caption-weird-problem-vfp-9
https://social.msdn.microsoft.com/Forums/en-US/ed7ce735-1fba-47c4-a76e-b66618f7700b/page-frame-caption-property
4, mzvfp.com:
http://www.mzvfp.com/read.php?tid=100330
5, tek-tips.com:
http://www.tek-tips.com/viewthread.cfm?qid=1617661
6. OTHER:
For reference only, there is no guarantees.
Any questions or suggestions, please send me an email at ccb2000@163.com.
|