Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Adding Custom View Parameter?
Message
 
 
À
08/09/2008 14:28:04
Information générale
Forum:
Visual FoxPro
Catégorie:
Base de données, Tables, Vues, Index et syntaxe SQL
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Vista
Network:
Windows 2008 Server
Database:
MS SQL Server
Divers
Thread ID:
01345719
Message ID:
01345868
Vues:
27
>>It looks like in Amanda's case she needs to remember to set this parameter in Command Window before running validation program. Unless there is a way to do so in Stonefield.
>
>
>I was just about to update - and I found out I had already gotten a reply
>
>For documentation purposes (when I build doc about a view)
>
>
>I do this
>=View_ParameterList(m.ViewName, TRUE)
>use (m.ViewName) again in 0 alias doctable nodata
>=View_ParameterList(m.ViewName, FALSE)
>
>
>It sets public parameters - I know - but it's for a couple of seconds anyway
>
>The Parameterlist of the view has to be defined
>
>
>
>
>
>&& StringToArray() = sort of alines()
>
>
>
>
>*-------------------------------------
>function View_ParameterList(ViewName, ParametersSet)
>	
>	local Success
>	Success = TRUE
>
>	local i, aa[1], bb[1], pl, ParameterName, ParameterType
>	
>	do case
>	case !indbc(m.ViewName, 'View')
>		Success = FALSE
>	
>	otherwise
>		pl = dbgetprop(m.ViewName, 'View', 'ParameterList')
>		
>	endcase
>	
>	do case
>	case !m.Success
>	
>	case empty(m.pl)
>	
>	otherwise
>		for i = 1 to StringToArray(m.pl, @aa, ';')
>			
>			do case
>			case StringToArray(aa[m.i], @bb) <> 2
>				assert FALSE
>			
>			otherwise
>				ParameterName = bb[1]
>				ParameterType = strtran(bb[2], ['])
>				
>				do case
>				case !m.ParametersSet
>					release (m.ParameterName)
>				
>				otherwise
>					public (m.ParameterName)
>					
>					do case
>					case inlist(m.ParameterType, T_CHARACTER)
>						store [TRUE] to (m.ParameterName)
>						
>					case inlist(m.ParameterType, T_DATE)
>						store {} to (m.ParameterName)
>					
>					case inlist(m.ParameterType, T_DATETIME)
>						store {/ / :} to (m.ParameterName)
>					
>					case inlist(m.ParameterType, T_NUMERIC, T_FLOAT, T_DOUBLE)
>						store 0.00 to (m.ParameterName)
>					
>					case inlist(m.ParameterType, T_CURRENCY)
>						store $0 to (m.ParameterName)
>					
>					case inlist(m.ParameterType, T_INTEGER)
>						store 0 to (m.ParameterName)
>					
>					case inlist(m.ParameterType, T_LOGICAL)
>						store FALSE to (m.ParameterName)
>					
>					otherwise
>						assert FALSE
>					
>					endcase
>					
>				endcase
>			endcase
>		endfor
>	endcase
>					
>	return m.Success				
>		
>endfunc
>*--------------------------------------------------------------------------
Hi Gregory,

Which case this macro parameter will fall to? Did you try this type of view with your code?
If it's not broken, fix it until it is.


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

Click here to load this message in the networking platform