VFP 9.0 Fix3 - Large Procedure In The Form

Rating: No reviews yet
Downloads: 121
Released: Apr 22, 2012
Updated: Apr 22, 2012 by ccb2000
Dev status: Stable Help Icon

Recommended Download

Source Code vfp9fix3
source code, 95K, uploaded Apr 22, 2012 - 121 downloads

Release Notes

1. BUG:

In vfp9, the procedure size can greater than 64KB.
But if there is a large procedure in the form, sometimes the form can't run correctly.

There is a program for test:

*PROC testlargeform

SET STEP OFF
SET ECHO OFF
SET DEBUG OFF
SET ESCAPE OFF
SET TALK OFF
SET SAFETY OFF

_SCREEN.VISIBLE=.T.
_SCREEN.WINDOWSTATE=2

PRIVATE m.x2
m.x2=""

COMPILE FORM testlargeform.scx
=MESSAGEBOX("Now the form file testlargeform.scx is good."CHR(13);
"We will run DO FORM testlargeform.scx and there is no problem.",0,"TEST LARGEFORM")
DO FORM testlargeform.scx

=MESSAGEBOX("Please make some changes."CHR(13);
"For example, Comment or Uncomment some statements.",0,"TEST LARGEFORM")
MODIFY FORM testlargeform.scx method INIT

COPY FILE testlargeform.scx TO testlargeform_bad.scx
COPY FILE testlargeform.sct TO testlargeform_bad.sct
USE testlargeform_bad.scx
LOCATE FOR objname="Form1"
=STRTOFILE(objcode,"testlargeform_bad.fxp")
USE

COPY FILE testlargeform.scx TO testlargeform_good.scx
COPY FILE testlargeform.sct TO testlargeform_good.sct
COMPILE FORM testlargeform_good.scx
USE testlargeform_good.scx
LOCATE FOR objname="Form1"
=STRTOFILE(objcode,"testlargeform_good.fxp")
USE

USE testlargeform.scx
LOCATE FOR objname="Form1"
PRIVATE m.q_com
m.q_com=methods
PRIVATE m.q_procedures
m.q_procedures=""
DO WHILE AT("PROCEDURE ",m.q_com)>0
m.qcom=SUBS(m.qcom,AT("PROCEDURE ",m.q_com))
m.qprocedures=m.qprocedures+LEFT(m.qcom,AT(CHR(13),m.qcom))
m.qcom=SUBS(m.qcom,AT(CHR(13),m.q_com)+1)
ENDDO
USE
m.qprocedures=STRTRAN(m.qprocedures,"PROCEDURE Init","PROCEDURE Init (LARGE PROCEDURE)")

IF FILETOSTR("testlargeformbad.fxp")==FILETOSTR("testlargeformgood.fxp")
=MESSAGEBOX("It seems the form file testlargeform.scx is good."CHR(13);
m.q_procedures+;
"We will run DO FORM testlargeform.scx and there is no problem.",0,"TEST LARGEFORM")
DO FORM testlargeform.scx
ELSE
=MESSAGEBOX("Now the form file testlargeform.scx is bad."CHR(13);
m.q_procedures+;
"If we run DO FORM testlargeform.scx then VFP will crash.",16,"TEST LARGEFORM")
DO FORM testlargeform.scx
ENDIF

RETURN

* END OF PROC TESTLARGEFORM.

In the testlargeform.scx:

PROCEDURE Load
SET TALK OFF
?"Load"
ENDPROC

PROCEDURE Init
* Please make some changes.
* For example, Comment or Uncomment some statements.
SET TALK OFF
SET TALK OFF
SET TALK OFF
?"Init"
PRIVATE m.x2
m.x2="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
m.x2="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
...
m.x2="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
m.x2="AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA"
ENDPROC

PROCEDURE Destroy
SET TALK OFF
?"Destroy"
ENDPROC

The size of the procedure Init is about 100KB, it is a large procedure.

Reviews for this release

No reviews yet for this release.