Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Copy to array
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Copy to array
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01045589
Message ID:
01045589
Vues:
64
Hi everybody,

I have two comboboxes on my form: Product Line and SubProduct Line. Here is the code in InteractiveChange of Product Line combo
WITH THIS.PARENT.cboSubProductLine
	lcCategory = .cCategory_Description
	lcSubCategory = .cSubcategory_Description
	lcDept = m.goApp.cDept

	IF Get_description_from_Viscodes(m.lcCategory, m.lcSubCategory, ;
			m.lcDept, "c_VisCodesLookup", .F., .lSystemFlag, m.lcAdditionalFilter)
			
		LOCAL lnSelect, lnRows, lnCols, laFields[1]
		lnRows = RECCOUNT("c_VisCodesLookup")

		IF m.lnRows > 0 && our cursor does have rows

			lnSelect = SELECT()
			SELECT("c_VisCodesLookup")
			lnCols = AFIELDS(laFields)
			DIMENSION .aRowSource [m.lnRows, m.lnCols]
			COPY TO ARRAY .aRowSource

			SELECT (m.lnSelect)

			IF .lAddBlank
				AINS(.aRowSource,1) && inserts a row
				FOR lnI =1 TO m.lnCols
					STORE SPACE(1) TO .aRowSource [1, m.lnI]
				NEXT
			ENDIF

			IF .lAddAll
				AINS(.aRowSource,1)
				FOR lnI =1 TO m.lnCols
					STORE IIF(m.lnI = 1, "<<All>>", "") TO .aRowSource [1, m.lnI]
				NEXT
			ENDIF

			.requery()

			IF .lAddAll OR .lAddBlank
				.LISTINDEX = 1
			ENDIF
		ENDIF
		USE IN c_VisCodesLookup
		.AdjustWidth()
	ENDIF

ENDWITH
We found, that for some values, like IS Services (code value = '700') not all records are dissplayed. The SubProduct combo should display 2 records + 1 blank (since I set lAddBlank property to true), but it displays just one record + blank. The select statement returned correctly 2 records. Can you help me find out the problem in the above code?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform