首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > VFP >

PROCEDURE如何用

2012-03-01 
PROCEDURE怎么用?PUBLICcpromptcprompt LOCALccustno,nlenIFnKeyCode-7THENccustnoALLTRIM(this.Val

PROCEDURE怎么用?
PUBLIC   cprompt
              cprompt= " "
LOCAL   ccustno,nlen
IF   nKeyCode=-7   THEN  
                ccustno=ALLTRIM(this.Value)&&
                nlen=LEN(ccustno)                     &&
        SELECT   d_jhd
                SET   FILTER   TO     LOWER(SUBSTR(ALLTRIM(mingcheng),1,nlen))==LOWER(ccustno)&&
                SET   PROCEDURE   TO   E:\jxc1.1\programs     &&设定程序路径
                DEFINE   POPUP   popup1   from   5,5   TO   25,50   PROMPT   FIELD   d_jhd.jhdh+ "--> "+ALLTRIM(d_jhd.ghs)&&
                ON   SELECTION   POPUP   popup1   do   extproc   with   ALLTRIM(SUBSTR(PROMPT(),1))&&
                ACTIVATE   POPUP   popup1       &&
        SELECT   jijipeizhi
              SET   FILTER   TO               &&
              KEYBOARD   CHR(13)         &&
ENDIF
IF   LEN(cprompt)> 0   THEN
                    this.Value= " "       &&
*!*                     this.Value=ALLTRIM(cprompt)     &&CPROMPT
                    this.Visible=.f.
ENDIF
RELEASE   cprompt   &&
thisform.Refresh
*!*&&       PROCEDURE   extproc                
*!*****************************************
*!*PROCEDURE   extproc         &&
*!*   PARAMETER   MPROMPT
*!*   CPROMPT   =   MPROMPT       &&MPROMPTCPROMPT
*!*   DEACTIVATE   POPUP   POPUP1   &&DEFINE   POPUP
*!*   RETURN                                     &&
*!*ENDPROC
这个可以用不知道PROCEDURE怎么用那个MPROMPT是什么参数不知到是怎的

[解决办法]

PROCEDURE extproc &&
PARAMETER MPROMPT
CPROMPT = MPROMPT &&MPROMPTCPROMPT
DEACTIVATE POPUP POPUP1 &&DEFINE POPUP
RETURN &&
ENDPRO

放在一个Prg中,如MyFunc.prg,然后在主程序中加代码:
set proc to Myfunc.prg
[解决办法]
这个参数是

Do 的参数
[解决办法]
LPARAMETERS Command
See Also
Collapse All Expand All

Assigns data passed from a calling program to local variables or arrays.


LPARAMETERS Parameter1 [AS type [OF ClassLib]]
[, Parameter2 [AS type [OF ClassLib]]]



Parameters
LPARAMETERS ParameterList
Specifies one or more local variable or array names to assign data from the calling program. Use commas to separate multiple parameters in ParameterList. You can pass a maximum of 26 parameters.

Note
The LPARAMETERS statement must specify at least as many parameters as used by the call to the program, procedure, or function containing the LPARAMETERS statement. If more variables or arrays are listed in the LPARAMETERS statement than are passed by the calling program, the remaining variables or arrays in the LPARAMETERS statement are initialized to False (.F.).


[ AS type [OF ClassLib] ]
[ AS type [OF ClassLib] ]
Specifies the data type of the local variable or array and the class library containing the type description of type which this variable or array is based on.

You can use the AS clause to implement strong typing. IntelliSense functionality is available for object and variable references only when they are strongly typed. For more information, see How to: Implement Strong Typing for Class, Object, and Variable Code.

Remarks
When LPARAMETERS is used with a program, procedure, or user-defined function called with the DO command, it must be the first executable statement in the called program, procedure, or user-defined function.

By default, the WITH clause in the DO command passes

热点排行