Dividir Horas con Numeros

loginsistemas
02 de Septiembre del 2003
-hola alguna sugerencia de como podria hacer para dividir la hora con numeros
es decir 132:00:00 / 78.00 = 1:40:00
con el excel es facil hacerlo pero en programacion es bastante enredado bueno si saben algo me lo dicen ok. aun que no creeo

armitronyac
02 de Septiembre del 2003
NO SE PERO VOY A AVERIGUAR.

KILLER
02 de Septiembre del 2003
TAMPOCO SE DEL TEMA, NI SIQUIERA CONOSCO EXCEL, PERO YA ME COMPRE UN LIBRO PARA PODERLE DAR UNA RESPUESTA A SU PREGUNTA para dividir la hora con numeros es decir 32:00:00 / 78.00 = 1:40:00

Jes?art?z Seijas
02 de Septiembre del 2003
No es tan dificil como lo imaginas, ahi te va el codigo de la función:
Invócala de esta manera (por ejemplo):
XXX = DIVHORA("132:00:00",78)

DIVHORA.PRG
----------------------------------------------------------
PARAMETERS XHORA,XDIV
* DESCOMPONE XHORA EN XNH, XNM Y XNS
XNH = VAL(XHORA) && HORAS
XNM = VAL(SUBSTR(XHORA,AT(":",XHORA,1)+1)) && MINUTOS
XNS = VAL(SUBSTR(XHORA,AT(":",XHORA,2)+1)) && SEGUNDOS
* TODO EN SEGUNDOS (USO LA MISMA VARIABLE XNS)
XNS = XNS + XNM*60 + XNH*3600
* HAGO LA DIVISION:
XNS = XNS / XDIV
* CALCULO DE XNH XNM Y XNS
XNH = INT(XNS/3600)
XNS = XNS - XNH*3600
XNM = INT(XNS/60)
XNS = XNS - XNM*60
* COMPONER SALIDA
XRET = ALLTRIM(STR(XNH,3,0))+":"+ALLTRIM(STR(XNM,3,0))+":"+ALLTRIM(STR(XNS,3,0))
RETURN XRET