6
FABRICIO LOPEZ ARENAS 5 “C” NRO 15 MODULO 6 OptionExplicit Sub Pausa(Segundos As Double) Dim inicio As Double 'Devuelve la cantidad de segundos desde que inicio windows inicio = Timer Do While (Timer - inicio) < Segundos 'pausa DoEvents Loop End Sub Private Sub Command1_Click() Dim texto As String texto = "...Hola Mundo--->>>" CallMostrarTexto(texto, 0.1, Me) End Sub Private Sub MostrarTexto(Frase As String, Segundos As Double, Destino As Object) Dim LenFrase As Integer Dim i As Integer Dim Caracter As String FABRICIO LOPEZ ARENAS

codigos

Embed Size (px)

DESCRIPTION

mysql

Citation preview

FABRICIO LOPEZ ARENAS 5 “C” NRO 15

MODULO 6

OptionExplicit

Sub Pausa(Segundos As Double)

Dim inicio As Double

'Devuelve la cantidad de segundos desde que inicio windows

inicio = Timer

Do While (Timer - inicio) < Segundos

'pausa

DoEvents

Loop

End Sub

Private Sub Command1_Click()

Dim texto As String

texto = "...Hola Mundo--->>>"

CallMostrarTexto(texto, 0.1, Me)

End Sub

Private Sub MostrarTexto(Frase As String, Segundos As Double, Destino As Object)

Dim LenFrase As Integer

Dim i As Integer

Dim Caracter As String

Dim texto As String

LenFrase = Len(Frase)

Do While i <= LenFrase

FABRICIO LOPEZ ARENAS

FABRICIO LOPEZ ARENAS 5 “C” NRO 15

Destino.Cls

DoEvents

i = i + 1

'Obtiene el siguiente caracter

Caracter = Mid(Frase, i, 1)

'texto actual

texto = texto &Caracter

Destino.Print texto 'Imprimi e/ dibuja el texto

'pausa o delay

Pausa Segundos

DoEvents

Loop

End Sub

Private Sub Form_Load()

Me.FontSize = 12

Me.FontBold = True

Me.ForeColor = vbRed

Command1.Caption = "Efecto de texto con mid"

End Sub

Private Sub Form_Unload(Cancel As Integer)

End

End Sub

FABRICIO LOPEZ ARENAS

FABRICIO LOPEZ ARENAS 5 “C” NRO 15

MODIULO NRO 7

Private Sub Form_Load()

Option1.Caption = "vbGeneralDate"

Option2.Caption = "vbLongDate"

Option3.Caption = "vbShortDate"

Option4.Caption = "vbLongTimer"

Option5.Caption = "vbShortTime"

Private Sub Option1_Click()

Me.Caption = FormatDateTime(Now, vbGeneralDate)

End Sub

Private Sub Option2_Click()

Me.Caption = FormatDateTime(Now, vbLongDate)

End Sub

Private Sub Option3_Click()

Me.Caption = FormatDateTime(Now, vbShortDate)

End Sub

Private Sub Option4_Click()

Me.Caption = FormatDateTime(Now, vbLongTime)

End Sub

Private Sub Option5_Click()

Me.Caption = FormatDateTime(Now, vbShortTime)

End Sub

FABRICIO LOPEZ ARENAS

FABRICIO LOPEZ ARENAS

FABRICIO LOPEZ ARENAS 5 “C” NRO 15

MODULO NRO 8

'recibe las dos fechas como parametros

'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''

Private Sub Calcular(Fecha_Inicial As Date, Fecha_Final As Date)

Const Formtao As String = "#,##0"

Me.Cls

Me.Print "Calcular Intervalos entre las fechas" &Fecha_Inicial& "hasta:" &Fecha_Final&vbNewLine&String(150, "-") &vbNewLine

Me.PrintFormat(DateDiff("s", Fecha_Inicial, Fecha_Final), Formato) & "segundos"

Me.PrintFormat(DateDiff("s", Fecha_Inicial, Fecha_Final), Formato) & "minutos"

Me.PrintFormat(DateDiff("s", Fecha_Inicial, Fecha_Final), Formato) & "horas"

Me.PrintFormat(DateDiff("s", Fecha_Inicial, Fecha_Final), Formato) & "dias"

Me.PrintFormat(DateDiff("s", Fecha_Inicial, Fecha_Final), Formato) & "semanas"

Me.PrintFormat(DateDiff("s", Fecha_Inicial, Fecha_Final), Formato) & "meses"

Me.PrintFormat(DateDiff("s", Fecha_Inicial, Fecha_Final), Formato) & "años"

End Sub

FABRICIO LOPEZ ARENAS

FABRICIO LOPEZ ARENAS 5 “C” NRO 15

Private Sub Command1_Click()

'le pasa las dos fechas a la funcion

Call Calcular("01/01/2000", Date)

End Sub

Private Sub Form_Load()

Me.AutoRedraw = True

Command1.Caption = "calcular intervalos"

End Sub

FABRICIO LOPEZ ARENAS