Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Problem with an array
Message
De
25/06/2002 12:04:33
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Problèmes
Titre:
Problem with an array
Divers
Thread ID:
00672061
Message ID:
00672061
Vues:
30
Hello, i have this code that i've created. but when i tested before it seems that works perfect, today it don't, so i've been working with other table and stored into an array named arreglo so i work with a field of this array and stored again in the variable NMB:
NMB=ARREGLO(I,1)

and after this, i create a second array named pausaarray
and do a select with a table in order to see if exists some values to work with.
DIMENSION PAUSAARRAY(REG)
SELECT ATENCION.FINICIO, ATENCION.FFIN FROM ATENCION WHERE ATENCION.NUMERO=m.NMB INTO ARRAY PAUSAARRAY


But this arrays is always empty, this is part of the code where i need to do this operations:
		fdias = 0
		diap = 0
		USE ATENCION SHARED
		NMB=ARREGLO(I,1)
		GO BOTTOM
		REG=RECNO()
		GO TOP
		
		DIMENSION PAUSAARRAY(REG)
		SELECT ATENCION.FINICIO, ATENCION.FFIN FROM ATENCION WHERE ATENCION.NUMERO=m.NMB INTO ARRAY PAUSAARRAY 

		use festivos shared
	scan 
		if festivos.fecha >= arreglo(i,2) and festivos.fecha<=arreglo(i,3) 
			fdias = fdias + 1 
		endif
		*if festivos.fecha >= pausaarray(i,1) and festivos.fecha<=pausaarray(i,2) 
		*	diap = diap + 1 
		*endif
	endscan 

*set step on	
   m=1
   sw=0
   cont3=0
   cont4=0
 if not empty(pausaarray(1,1)) &&Here is where the arrays confirms me the emptyness
	if reg >= 1
	  for y=1 to reg
	    scan
	      if festivos.fecha >= pausaarray(y,m) and festivos.fecha<=pausaarray(y,m+1) 
			diap = diap + 1 
			sw=1
		  endif
	    endscan
	    do case
	      case sw=1
	         f_hora3 = hour(pausaarray(y,m))
		     f_minu3 = minute(pausaarray(y,m))
			 f_hora4 = hour(pausaarray(y,m+1))
			 f_minu4 = minute(pausaarray(y,m+1))

			 if f_hora3 < 8 
		       f_hora1 = 8
			   f_minu1 = 0
			 endif 
			 if f_hora3 > 17
			   f_hora1 = 17
			   f_minu1 = 0
			 endif  
			 if f_hora4 < 8 
			   f_hora2 = 8
			   f_minu2 = 0
			 endif 
			 if f_hora4 > 17
			   f_hora2 = 17
			   f_minu2 = 0
			 endif  
	
			 f_time3 = (f_hora1*60)+f_minu3
			 cont3=cont3+f_time3 &&almacena los min. y los va sumando de acuerdo al ciclo
			 f_time4 = (f_hora2*60)+f_minu4
			 cont4=cont4+f_time4 &&almacena los min. y los va sumando de acuerdo al ciclo
	      case sw=0 &&Case usado para saber cuando no hay dias festivos de por medio y verifica si el tiempo (si fue el mismo día) desde que se abrio hasta que se cerro el pendiente.
	        diap1=val(sys(11,pausaarray(y,m)))-val(sys(11,pausaarray(y,m+1)))
	        diap=diap+diap1
	        sw=0

	         f_hora3 = hour(pausaarray(y,m))
		     f_minu3 = minute(pausaarray(y,m))
			 f_hora4 = hour(pausaarray(y,m+1))
			 f_minu4 = minute(pausaarray(y,m+1))

			 if f_hora3 < 8 
		       f_hora1 = 8
			   f_minu1 = 0
			 endif 
			 if f_hora3 > 17
			   f_hora1 = 17
			   f_minu1 = 0
			 endif  
			 if f_hora4 < 8 
			   f_hora2 = 8
			   f_minu2 = 0
			 endif 
			 if f_hora4 > 17
			   f_hora2 = 17
			   f_minu2 = 0
			 endif  
	
			 f_time3 = (f_hora1*60)+f_minu3
			 cont3=cont3+f_time3
			 f_time4 = (f_hora2*60)+f_minu4
			 cont4=cont4+f_time4
  	    endcase
        sw=0
	  endfor
	endif
   endif

		diap=((diap*480)+cont4-cont3)/60
		arreglo(i,20) = arreglo(i,20) - fdias
Please help me with this thing. Thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform