Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
.NULL. in combo's rowsource possible?
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows NT
Database:
MS SQL Server
Divers
Thread ID:
01221232
Message ID:
01221268
Vues:
11
>Hi Naomi,
>
>If you could post a few snippets of the custom combo class, that would be great.

Here are the relevant pieces of the code (as promised, the whole code removed <g>).
DEFINE CLASS cboviscodes AS ccombobox
	<snip>

	*-- Array used to hold data for picklist
	DIMENSION arowsource[1]

	PROCEDURE laddall_assign
		lparameters vNewVal
		*To do: Modify this routine for the Assign method
		local lnI, lnCols, lnRows
		with this
			.lAddAll = m.vNewVal

			if .lAddAll and ascan(.aRowSource, "<<All>>",1,-1,1) = 0
				lnRows = alen(.aRowSource,1)
				lnCols = alen(.aRowSource,2)
				dimension .aRowSource[m.lnRows + 1, m.lnCols] && add one more row
				ains(.aRowSource,1)
				.aRowSource[1,1] = "<<All>>"
				for lnI = 2 to m.lnCols
					if m.lnRows > 0
						if vartype(.aRowSource [2, m.lnI])='C'
							.aRowSource[1, m.lnI] = "%"
						else
							.aRowSource[1, m.lnI] = 0
						endif
					else
						store "%" to .aRowSource [1, m.lnI]
					endif
				next
			endif
		endwith
	ENDPROC


	PROCEDURE laddblank_assign
		lparameters vNewVal
		local lnI, lnCols, lnRows
		*To do: Modify this routine for the Assign method
		with this

			if m.vNewVal and ascan(.aRowSource,space(1),1,-1,1) = 0
				lnRows = alen(.aRowSource,1)
				lnCols = alen(.aRowSource,2)
				dimension .aRowSource[m.lnRows + 1, m.lnCols] && add one more row
				ains(.aRowSource,1) && inserts a row
				for lnI =1 to m.lnCols
		*-- CHANGE - NN - December 06, 2005 - 16:20:47 - added NULL
					if m.lnRows > 0
						if vartype(.aRowSource [2, m.lnI])='C'
							.aRowSource[1, m.lnI] = " "
						else
							.aRowSource[1, m.lnI] = 0
						endif
					else
						store space(1) to .aRowSource [1, m.lnI]
					endif
				next
				.aRowSource[1,2] = cast(null as C)
				.nulldisplay = 'NULL'
			endif
			.lAddBlank = m.vNewVal
		endwith
	ENDPROC


	<snip>
ENDDEFINE
*
*-- EndDefine
**************************************************
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform