RE:juan fernando - sonidos
Publicado por
Juan Fernando (1 intervención) el 13/11/2008 18:07:01
este es el código va en el evento valid de una text,tendrías que modicar parte
de el y adaptarlo .
Set bell ON
set talk off
Publ cod,nom,ape
Publ fe1,fe2
fe1=ctod("")
fe2=ctod("")
Sele tabla1
cod=Thisform.Text1.Value
Locate for Allt(Codigo)=Allt(cod)
nom=nombre
ape=apellido
fe1=fecha1
fe2=fechaexam
If Found()
Set Filter to Allt(Codigo)=Allt(cod)
Thisform.Command1.Enabled=.f.
*Thisform.Text2.Enabled=.f.
*------------------------------------------------------------------------
Thisform.Text2.Value=nom
Thisform.Text3.Value=ape
*Thisform.Text5.Value=date()
*Thisform.Text5.Value=fe2-31
Publ num1,num2
Store 0 To num1,nom2
Thisform.Text5.Value=date()
Thisform.Text4.Value=fe2
Num1=Day(Thisform.Text5.Value)
Num2=Day(Thisform.Text4.Value)
Thisform.Text6.Value=Round((num2-num1),0)
** aquí generamos el sonido de aviso ¿ cuántos dias faltan para el exámen ?
If Num1=Num2
Set Bell To "C:SistemaSonidoGallo.WAV"
??CHR(7)
Else
Set Bell To "C:SistemaSonidoVaca.WAV"
??CHR(7)
Endif
messagebox(' Código Encontrado **PUEDE SOLO MODIFICAR O ELIMINAR **',0+48+0,' ADVERTENCIA ')
Thisform.Command1.Enabled=.f.
Else
**-------------------------------------------------------------------
** **
messagebox(' código No ** Grabado **',0+48+0,' ADVERTENCIA ')
Thisform.Command1.Enabled=.t.
Return=.F.
Endif
Thisform.Text1.Refresh