Tutorials to .com

Tutorials to .com » Database » Foxpro » Modified to achieve by the standard class library VisualFoxPro

Modified to achieve by the standard class library VisualFoxPro

Print View , by: iSee ,Total views: 14 ,Word Count: 752 ,Date: Sat, 18 Apr 2009 Time: 9:37 PM

VisualFoxProForWindows its object-oriented programming and visualization programming technology has become a software developer, one of the preferred development tools. It provides the wizstyle.vcr Library contains a wealth of categories, so that software development easier and easier.

Searchclass (query) is a class library wizstyle.vcr categories, the data is essential for basic operation, one of the most frequently used category, use it to generate the query interface, the direct use of field names as a query query message, which is not appropriate for end-users, because the end-users and can not be the basis of field names to understand the true meaning of the fields. For the database table, vfp provides a description of the field "title (caption)", type in the query database can be used in the description field of "headline" message as a query to query.

To solve this problem, the database design of different query interface of course different, but effective, way to once and for all categories or to amend Searchclass.

Modified as follows:

First of all, to enter into project management (ProjectManager), select Class page, start wizstyle.vcr library to find searchclass button and then click Modify to modify searchclas category.

Cbofieds1 first event of the init code modifications, the revised code and modify part of the Notes as follows:

# DEFINENUM_AFIELDS16LOCALi, j add a local variable jPUBLICaWizFList, aWizFLista add a global variable aWizFListaDIMENSIONaWizFList [1] = AFIELDS (aWizFList) DIMENSIONaWizFLista [1] the definition of an array = AFIELDS (aWizFLista) will be assigned to the current array of table information aWizFListaj = aWizFLista (1, 12) will be assigned to the current name of the table jFORm.i = FCOUNT () TO1STEP-1 to determine whether the existence of the following to open the database, and the title of a database field in the array of alternative aWizFList the first column of field names. Free form, because the title does not exist, it is still using the field names.

IFLEN(DBC())$#@62;
0aWizFList(mi,1)=DBGETPROP(j+"."+aWizFList(mi,1),"field","caption")ENDIFI
FINLIST(aWizFList[mi,2],"G","M","U")
&&Memofield =ADEL(aWizFList,mi)
DIMENSIONaWizFList[MAX(1,ALEN(aWizFList,1)-1),NAFIELDS]=ADEL(aWizFLista,mi)
IFLEN(DBC())$#@62;
0aWizFList(mi,1)=DBGETPROP(j+"."+aWizFList(mi,1),"field","caption")ENDIFI
FINLIST(aWizFList[mi,2],"G","M","U")
&&Memofield =ADEL(aWizFList,mi)
DIMENSIONaWizFList[MAX(1,ALEN(aWizFList,1)-1),NAFIELDS]=ADEL(aWizFLista,mi)
IFLEN(DBC())$#@62;
0aWizFList(mi,1)=DBGETPROP(j+"."+aWizFList(mi,1),"field","caption")ENDIFI
FINLIST(aWizFList[mi,2],"G","M","U")
&&Memofield =ADEL(aWizFList,mi)
DIMENSIONaWizFList[MAX(1,ALEN(aWizFList,1)-1),NAFIELDS]=ADEL(aWizFLista,mi)
IFLEN(DBC())$#@62;
0aWizFList(mi,1)=DBGETPROP(j+"."+aWizFList(mi,1),"field","caption")ENDIFI
FINLIST(aWizFList[mi,2],"G","M","U")
&&Memofield =ADEL(aWizFList,mi)
DIMENSIONaWizFList[MAX(1,ALEN(aWizFList,1)-1),NAFIELDS]=ADEL(aWizFLista,mi)

The two lines to deal with memory-type sub-paragraph

DIMENSIONaWizFLista [MAX (1, ALEN (aWizFLista, 1) -1),

NUM_AFIELDS] ENDIFENDFORTHIS.RowSourceType = 5THIS.RowSource = "aWizFList"

To the original data source field name changed to the title for the data source THIS.VALUE = THIS.LIST [1] and then the seachclass code seachitem events section 6 m.cFldName = ALLTRIM (m.oField.Value ) to m.cFldName = ALLTRIM (aWizflista (m.oField.listitemid, 1)) modified the above, save to withdraw from.

More than changes in the Windows95, 98 environment, VFP5.0, VFP6.0 run normal, good effect.


FoxPro Tutorial Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.