Wiki Home

Temp Page For Code


Namespace: WIN_COM_API
Page to display code that will be viewed within a min or so of being posted. Feel free to replace. The chances of messing things up are slim to none.
lox = CreateObject( "aCursor" )

Define Class aCursor As Custom

	cAlias = ""

	Procedure ScanProcess
	
	Lparameters ;
		toObject, ;
		tcMethod, ;
		toParameters, ;
		tcScope, ;
		txValue

*!*			toObject - Object that has tcMethod
*!*			tcMethod - method that is called for each record 
*!*			toParameters, parameter object that gets passed to tcMethod
*!*			tcScope - appled to SCAN 
*!*			txValue - applied to scope ( handy for non string values, i think.)
		
	Local ;
		lcScope, ;
		lcMethCall, ;
		llRet

	DO case
	
		Case Empty( tcScope )
			lcScope = "ALL"

*		Case Empty( txValue ) && doesn't work cuz txValue could be 0
		Case vartype( txValue ) = T_LOGICAL
			lcScope = tcScope

		Otherwise 
			* tcScope = "FOR nAmt <>"
			* txValue = 0
			* lcScope = "FOR nAmt <> txValue"
			lcScope = tcScope + " txValue"

	EndCase 
		
	lcMethCall = "toObject." + tcMethod + "(toParameters)"
	
	llRet = .t.
	
	Select (this.cAlias)
	
	Scan &lcScope
		llRet = Evaluate(lcMethCall)
		If !llRet
			Exit
		EndIf 
	Endscan
	
	Return llRet
	
	EndProc
	
Enddefine
( Topic last updated: 2004.03.08 02:38:04 PM )