Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Returning Cursors...
Message
From
29/08/2002 15:24:50
 
 
To
29/08/2002 15:11:34
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00695065
Message ID:
00695136
Views:
15
SO this should work for what I need? I did so, and nothing happened... any suggestions, or am I wrong?
FUNCTION G2_EstoqToCursor(cCursor AS String) ;
		HELPSTRING [Esta função consulta estoque de um produto em uma determinada loja, e cria um cursor com o nome especificado.]		
		*-- Queries the stock and creates a cursor.
		
		LOCAL sbkMultiLocks,sbkReprocess
		
		IF EMPTY(This.Codigo)
			COMRETURNERROR([ComEstoque],[Can't search with empty Codigo.])
			RETURN .F.
		ENDIF 
		
		IF EMPTY(This.Loja)
			COMRETURNERROR([ComEstoque],[Can't search product in empty Loja.])
			RETURN .F.
		ENDIF 
		
		IF VARTYPE(cCursor) <> [C]
			COMRETURNERROR([ComEstoque],[Cursor name is empty or invalid])
			RETURN .F.
		ENDIF 
		
		SET DATASESSION TO 1
		
		sbkMultiLocks = SET("Multilocks")
		sbkReprocess  = SET("Reprocess")
		
		SET MULTILOCKS on
		SET REPROCESS TO 5 seconds
						
		This.AbreArquivos() && open tables on current datasession
		
		SELECT							  					 ;
			g2_estoq.custo_med								,;
			g2_estoq.ant_inv								,;
			g2_estoq.dat_custo								,;
			g2_estoq.dat_est								,;
			g2_estoq.dat_inv								,;
			g2_estoq.datultcomp								,;
			g2_estoq.dia_giro								,;
			g2_estoq.local									,;
			g2_estoq.pccompsicm								,;
			g2_estoq.qtd_est								,;
			g2_estoq.qtd_giro								,;
			g2_estoq.qtd_inv								,;
			g2_estoq.qtd_max								,;
			g2_estoq.qtd_min								,;
			g2_estoq.valultcomp								 ; 
		FROM 												 ;
			g2_estoq										 ;
		WHERE 												 ;
			g2_estoq.codigo == This.Codigo					 ;
			AND												 ;
			g2_estoq.loja   == This.Loja					 ;
		INTO CURSOR 										 ;
			(cCursor)
		
		This.FechaArquivos() && Close tables opened by This.AbreArquivos()
		
		SET MULTILOCKS   &sbkMultiLocks
		SET REPROCESS TO sbkReprocess
					
		SET DATASESSION TO This.DataSessionId
Pablo Márcio de Oliveira

Inside the scream is silent, inside it must remain
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform