kapiaba Posted March 16, 2015 Report Share Posted March 16, 2015 Agendamento de Visitas, incrementar a hora. Galera, ajuda ai, como eu faço, conforme a imagem abaixo, ir incrementando em um WHILE... ENDDO, a hora da agenda, de 30 em 30 minutos, 8:00 + 30 + 30 + 30... Nunca fiz, alguém tem um exemplinho: Obg. abs. Quote Link to comment Share on other sites More sharing options...
VLNUNES Posted March 16, 2015 Report Share Posted March 16, 2015 Olá Kapiaba; http://www.pctoledo.com.br/forum/viewtopic.php?f=2&t=15975 Vander kapiaba 1 Quote Link to comment Share on other sites More sharing options...
Theotokos Posted March 16, 2015 Report Share Posted March 16, 2015 cIntervalo := '30' // intervalo entre os horarios 30 min cTime := SecToTime( Secs( cTime ) + (Val( cIntervalo )*60) ) kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 16, 2015 Author Report Share Posted March 16, 2015 Olá Kapiaba; http://www.pctoledo.com.br/forum/viewtopic.php?f=2&t=15975 Vander Obrigado Vander, vou estudar a rotina. Abraços. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 16, 2015 Author Report Share Posted March 16, 2015 FUNCTION Gerar_Agenda() Hora := 8:00 WHILE DataInicial < DataFinal Hora := Hora + .30 // 30 minutos // Como eu somo 30 minutos em 8:00 - 8:30, 9:00 // em um intervalo de 30 dias de agenda // exemplo: DataInicial := 01/03/2015 a 31/03/2015 ENDDO Obg. abs. Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 16, 2015 Author Report Share Posted March 16, 2015 cIntervalo := '30' // intervalo entre os horarios 30 min cTime := SecToTime( Secs( cTime ) + (Val( cIntervalo )*60) ) Obg. garoto, mas como eu somo na hora inicial, dentro do while..enddo, ex: cHoraInicial := 8:00 ??? Quote Link to comment Share on other sites More sharing options...
Theotokos Posted March 16, 2015 Report Share Posted March 16, 2015 Obg. garoto, mas como eu somo na hora inicial, dentro do while..enddo, ex: cHoraInicial := 8:00 ??? cIntervalo := '30' // intervalo entre os horarios 30 min cHoraInicial := "8:00" aAgenda := { } cTime := cHoraInicial While .t. cTime := SecToTime( Secs( cTime ) + (Val( cIntervalo )*60) ) // Aqui soma o ultimo horario com o intervalo AADD(aAgenda, { cTime, .... } If cTime = cHoraFinal exit EndIf EndDo Quote Link to comment Share on other sites More sharing options...
VLNUNES Posted March 16, 2015 Report Share Posted March 16, 2015 Nova resposta http://www.pctoledo.com.br/forum/viewtopic.php?f=2&t=15975&p=95358#p95358 kapiaba 1 Quote Link to comment Share on other sites More sharing options...
kapiaba Posted March 16, 2015 Author Report Share Posted March 16, 2015 Excelente, TheoTokos!!! #include "FiveWin.ch" FUNCTION Main() SET CENTURY ON // 4 DIGITOS PARA O ANO SET DATE BRITISH // FORMATO DD/MM/AAAA SET EPOCH TO YEAR( DATE() ) - 50 Gerar_Agenda() RETURN NIL FUNCTION Gerar_Agenda() LOCAL cDataIni := CTOD( "01/03/2015" ) LOCAL cDataFin := CTOD( "10/03/2015" ) LOCAL cIntervalo, aAgenda, cTime, cHoraInicial, cHoraFinal cIntervalo := '30' // intervalo entre os horarios 30 min cHoraInicial := "8:00" cTime := cHoraInicial aAgenda := { } While cDataIni < cDataFin //.t. IF cDataIni > cDataFin EXIT ENDIF cTime := SecToTime( Secs( cTime ) + (Val( cIntervalo )*60) ) // Aqui soma o ultimo horario com o intervalo ? cTime, cDataIni // AQUI SERA O REPLACE... NO BD. // AADD(aAgenda, { cTime, .... } /* // AQUI A CONDICAO E POR DATA INICIAL E FINAL. If cTime = cHoraFinal exit EndIf */ ++cDataIni EndDo RETURN NIL Muito obrigado, agora, eu entendi! Marinheiro de primeira viagem, é PHODA!! KKKKKKKKKKKKKKKKKKK Theotokos 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.