当前位置: 代码迷 >> VFP >> 《Vfp编译软件(Vfp Compiler)》源代码预处理技术之四解决方法
  详细解决方案

《Vfp编译软件(Vfp Compiler)》源代码预处理技术之四解决方法

热度:4306   发布时间:2013-02-26 00:00:00.0
《Vfp编译软件(Vfp Compiler)》源代码预处理技术之四
《Vfp编译软件(Vfp Compiler)》源代码预处理技术之四:

4、/VCEXPANDINLINE=ON 展开内联函数

原代码:

?"VCTEST_PI()*VCTEST_PI()="+LTRIM(STR(VCTEST_PI()*VCTEST_PI(),16,5))
RETU
FUNCTION vctest_pi
* INLINE FUNCTION vctest_pi =
PRIVATE x3
=[GOTO LABEL_OK]
x3=PI()+100
RETU x3
=[LABEL_OK:]
x3=PI()
RETU x3


“展开内联函数”后代码:

PRIVATE X3_VCINLINE_VARIABLE_A__VCTEST_PI
=[GOTO LABEL_OK__VCTEST_PI_A]
X3_VCINLINE_VARIABLE_A__VCTEST_PI=PI()+100
PRIVATE m.__VC_AQBWRC_A
STORE (X3_VCINLINE_VARIABLE_A__VCTEST_PI) TO m.__VC_AQBWRC_A
=[GOTO FOXRUN_RETURN_LABEL_RETURN__VCTEST_PI_A]
=[LABEL_OK__VCTEST_PI_A:]
X3_VCINLINE_VARIABLE_A__VCTEST_PI=PI()
PRIVATE m.__VC_AQBWRC_A
STORE (X3_VCINLINE_VARIABLE_A__VCTEST_PI) TO m.__VC_AQBWRC_A
=[GOTO FOXRUN_RETURN_LABEL_RETURN__VCTEST_PI_A]
=[FOXRUN_RETURN_LABEL_RETURN__VCTEST_PI_A:]
PRIVATE m.__VC_AQBWRM_A_A
m.__VC_AQBWRM_A_A=m.__VC_AQBWRC_A
PRIVATE X3_VCINLINE_VARIABLE_A__VCTEST_PI
=[GOTO LABEL_OK__VCTEST_PI_B]
X3_VCINLINE_VARIABLE_A__VCTEST_PI=PI()+100
PRIVATE m.__VC_AQBWRC_A
STORE (X3_VCINLINE_VARIABLE_A__VCTEST_PI) TO m.__VC_AQBWRC_A
=[GOTO FOXRUN_RETURN_LABEL_RETURN__VCTEST_PI_B]
=[LABEL_OK__VCTEST_PI_B:]
X3_VCINLINE_VARIABLE_A__VCTEST_PI=PI()
PRIVATE m.__VC_AQBWRC_A
STORE (X3_VCINLINE_VARIABLE_A__VCTEST_PI) TO m.__VC_AQBWRC_A
=[GOTO FOXRUN_RETURN_LABEL_RETURN__VCTEST_PI_B]
=[FOXRUN_RETURN_LABEL_RETURN__VCTEST_PI_B:]
PRIVATE m.__VC_AQBWRM_A_B
m.__VC_AQBWRM_A_B=m.__VC_AQBWRC_A
?"VCTEST_PI()*VCTEST_PI()="+LTRIM(STR(m.__VC_AQBWRM_A_A*m.__VC_AQBWRM_A_B,16,5))
RETU
FUNCTION vctest_pi
PRIVATE x3
=[GOTO LABEL_OK]
x3=PI()+100
PRIVATE m.__VC_AQBWRC_A
STORE (x3) TO m.__VC_AQBWRC_A
=[GOTO FOXRUN_RETURN_LABEL_RETURN]
=[LABEL_OK:]
x3=PI()
PRIVATE m.__VC_AQBWRC_A
STORE (x3) TO m.__VC_AQBWRC_A
=[GOTO FOXRUN_RETURN_LABEL_RETURN]
=[FOXRUN_RETURN_LABEL_RETURN:]
RETURN m.__VC_AQBWRC_A

可以验证“展开内联函数”后代码与原代码的功能是相同的。



------解决方案--------------------------------------------------------
  相关解决方案