You are on page 1of 66

Sub Detalle_de_agrupados()

' Detalle de un perodo de una factura, por numero de tel

Dim registro As Variant


Dim pathin, pathou, linea, factura, pagar, fecha As String
Dim fila As Integer
Dim fact, arch As String
Dim mesao As String
fact = ""

'pathin = "c:\temp\macro-genesis\lineas.txt"

'Open pathin For Input As 1

mesao = InputBox("Ingrese mes/ao")


linea = InputBox("Ingrese linea")

pathou = "d:\temp\d_agrupados" & Mid$(mesao, 1, 2) & "_" & Mid$(mesao, 4, 2) &


"_" & linea & ".txt"

Open pathou For Output As 2


With Session
'Do While Not EOF(1)

.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 6, 13
.WaitForDisplayString "Opcion....", "30", 6, 2
.TransmitANSI "1"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 7, 13
.WaitForDisplayString "Accion....", "30", 7, 2
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.SetMousePos 5, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

'Line Input #1, registro


'linea = Mid(registro, 1, 10)
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
.TransmitANSI "a"
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitANSI linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcEnterPos, "30", "0", 11, 3
fila = 11
Do While mesao <> GetDisplayText(fila, 69, 5)
If fila = 20 Then
.TransmitTerminalKey rcIBMPf8Key
.Wait ("1")
fila = 11
Else: fila = fila + 1
End If
If GetDisplayText(fila, 69, 5) = " " Then
GoTo fin
End If
Loop
'.TransmitTerminalKey rcIBMDownKey
'.TransmitTerminalKey rcIBMDownKey
'.TransmitTerminalKey rcIBMDownKey

.SetMousePos fila, 3
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rccurrentgraphicscursosrx,
rcCurrentGraphicsCursorY
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey

Do While .GetDisplayText(6, 55, 25) <> fact ' Marca


fact = .GetDisplayText(6, 55, 25) ' Marca
.SetSelectionStartPos 7, 1 'Fila y columna de inicio
.ExtendSelectionRect 20, 79 'Fila y columna fin
.CopySelection
Print #2, .GetClipboardText
.TransmitTerminalKey rcIBMEnterKey
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "", "0", 1, 1
'.WaitForEvent rcEnterPos, "", "0", 7, 3
Loop
.TransmitTerminalKey rcIBMPf3Key

'Loop

.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fin:
.TransmitTerminalKey rcIBMPf3Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
End With
'Close 1
Close 2

End Sub

Sub Hernancito_Facturacion()
'
' Hecho por Hernancito Copy Right Rock and Rule SA
'PRUEBO SIN DIMENSIONAR
'Dim pathin, pathou, linea, urb, iur, inter, mesin, vto, llur, lliur As String
Dim resumen(9) As String

pathin = "d:\TEMP\entrada.TXT"
'InputBox("Ingrese Ruta y nombre del archivo de texto que contiene las lneas",
"Telefonia Publica")
pathou = "d:\TEMP\resulta.TXT"
'InputBox("Ingrese Ruta y nombre del archivo de texto a crear", "Telefonia
Publica")

Open pathin For Input As 1


Open pathou For Output As 2
Print #2, "Linea" & " " & "FEmision" & " " & "Tipo" & " " & "NFactura" & " " &
"Total" & " " & "FVencimiento" & " " & "Resumen"
With Session
Do While Not EOF(1)
Line Input #1, registro
linea = Mid(registro, 1, 10)
.WaitForEvent rcEnterPos, "30", "0", 4, 10
.WaitForDisplayString "Opcion", "30", 4, 2
.TransmitANSI "1,1,c,"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 4, 14
.WaitForDisplayString "Fact..:", "30", 4, 6
.TransmitTerminalKey rcIBMDownKey
.TransmitTerminalKey rcIBMRightKey
.TransmitTerminalKey rcIBMRightKey
.TransmitTerminalKey rcIBMRightKey
.TransmitANSI linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 5, 14
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
.TransmitTerminalKey rcIBMPf22Key
.SetSelectionStartPos 11, 9
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 11, 3

datos1 = .GetDisplayText(11, 9, 65)


datos2 = .GetDisplayText(12, 9, 65)
datos3 = .GetDisplayText(13, 9, 65)
datos4 = .GetDisplayText(14, 9, 65)
datos5 = .GetDisplayText(15, 9, 65)
datos6 = .GetDisplayText(16, 9, 65)
datos7 = .GetDisplayText(17, 9, 65)
datos8 = .GetDisplayText(18, 9, 65)
datos9 = .GetDisplayText(19, 9, 65)

'**Agregado para capturar el resumen de cuentas


For ind = 0 To 9
resumen(ind) = ""
Next

hb = 11
Do Until hb = 20 Or .GetDisplayText(hb, 3, 1) <> "_"
.SetMousePos hb, 3
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI "resum"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
resumen(hb - 10) = Trim(.GetDisplayText(16, 61, 15))

.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
hb = hb + 1
Loop
'*********************************************

Print #2, linea & " " & datos1 & " " & resumen(1)
Print #2, linea & " " & datos2 & " " & resumen(2)
Print #2, linea & " " & datos3 & " " & resumen(3)
Print #2, linea & " " & datos4 & " " & resumen(4)
Print #2, linea & " " & datos5 & " " & resumen(5)
Print #2, linea & " " & datos6 & " " & resumen(6)
Print #2, linea & " " & datos7 & " " & resumen(7)
Print #2, linea & " " & datos8 & " " & resumen(8)
Print #2, linea & " " & datos9 & " " & resumen(9)

.TransmitTerminalKey rcIBMPf3Key
.TransmitTerminalKey rcIBMPf3Key
.TransmitTerminalKey rcIBMPf3Key
.TransmitTerminalKey rcIBMPf1Key
.TransmitTerminalKey rcIBMPf9Key

registro = registro + 1
Loop
Close 1
Close 2
End With
End Sub

Sub Hernan_libreria()
'algunas instrucciones

'Para buscar texto:

found = FindText("Servicios Telecom", 1, 1)


If found Then
fila = Application.FoundTextRow
serv = .GetDisplayText(fila, 64, 12)
End If
'--------- Buscar Resumen ----
found = FindText("Resumen de Cuenta", 1, 1)
If found Then
fila = Application.FoundTextRow
resum = .GetDisplayText(fila, 64, 12)
End If
'--------- Buscar Total ----
found = FindText("Total a Pagar", 1, 1)
If found Then
fila = Application.FoundTextRow
total = .GetDisplayText(fila, 64, 12)
End If
End Sub
Sub CY_CZ()

pathin = "d:\d\entrada.txt"
pathout = "d:\d\salidaCYCZ.txt"

Open pathin For Input As 1


Open pathout For Output As 2

With Session

Do While Not EOF(1)


Line Input #1, acuerdo
.SetMousePos 4, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX, rcCurrentGraphicsCursorY
.TransmitANSI acuerdo
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
CYCZ = .GetDisplayText(5, 42, 2)
Print #2, acuerdo & ";" & CYCZ
Loop

Close 1
Close 2
End With
End Sub

Sub Detalle_de_facturacion()
'
' Detalle_de_facturacion Macro
' Macro created 31/01/01 by Usuario

Dim registro As Variant


Dim pathin, pathou, linea, factura, pagar, fecha, Emi, emision As String
Dim fila, filaguion, Demi, Ultimo As Integer
Dim fact, arch As String
Dim mesao As String
fact = ""

pathin = "d:\temp\tocata.txt"
perin = "d:\temp\periodo.txt"

Open perin For Input As 3

'mesao = InputBox("Ingrese mes/ao") 'lista periodo


'linea = InputBox("Ingrese linea")

With Session
Do While Not EOF(3) 'lista periodo

Line Input #3, regper 'lista periodo


mesao = Mid(regper, 1, 5) 'lista periodo

Open pathin For Input As 1

Do While Not EOF(1)


.SetMousePos 21, 15
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForDisplayString "OPCN&SUBOPCN", "30", 21, 2
.TransmitANSI "1,1"
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

Line Input #1, registro


linea = Mid(registro, 1, 10)

pathou = "d:\temp\" & Mid$(mesao, 1, 2) & "_" & Mid$(mesao, 4, 2) & "_" &
linea & "_detalle.txt"
Open pathou For Output As 2

.WaitForDisplayString "Nro.Linea.:", "30", 5, 2


' .TransmitTerminalKey rcIBMTabKey
' .TransmitTerminalKey rcIBMTabKey
.TransmitANSI "a"
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitANSI linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcEnterPos, "30", "0", 11, 3
fila = 11
Do While mesao <> GetDisplayText(fila, 69, 5)
If fila = 20 Then
.TransmitTerminalKey rcIBMPf8Key
.Wait ("3")
fila = 11
Else: fila = fila + 1
End If
If GetDisplayText(fila, 69, 5) = " " Then
GoTo fin
End If
Loop
'Asigno la fecha de emision
Demi = .GetDisplayText(fila, 9, 2)
Emi = .GetDisplayText(fila, 11, 6)
Demi = Demi - 1
If Demi > 9 Then
emision = Demi & Emi
Else
emision = "0" & Demi & Emi
End If

'Emision = "01/11/99"
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 5, 14
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI emision
.TransmitTerminalKey rcIBMEnterKey
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcEnterPos, "30", "0", 11, 3
fila = 11
Do While mesao <> GetDisplayText(fila, 69, 5)
If fila = 20 Then
.TransmitTerminalKey rcIBMPf8Key
.Wait ("3")
fila = 11
Else: fila = fila + 1
End If
If GetDisplayText(fila, 69, 5) = " " Then
GoTo fin
End If
Loop

.SetMousePos fila, 3
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rccurrentgraphicscursosrx,
rcCurrentGraphicsCursorY
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "120", "0", 1, 1

.WaitForEvent rcEnterPos, "30", "0", 4, 7


.WaitForDisplayString "Fact:", "30", 4, 1
'capturo nro de factura
factura = .GetDisplayText(4, 7, 13)
Print #2, "Nro de Factura: " & factura
Print #2,

' 'urbanas e interurbanas


'
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI "urbint"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 4, 7
.WaitForDisplayString "Fact:", "30", 4, 1
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 4, 7
.WaitForDisplayString "Fact:", "30", 4, 1

Ultimo = 0
Do While Ultimo = 0
filaguion = 9
Do While filaguion < 21 And Ultimo = 0
If .GetDisplayText(filaguion, 14, 1) <> "-" Then Ultimo = 1
filaguion = filaguion + 1
Loop
filaguion = filaguion - 1
If Ultimo = 1 Then filaguion = filaguion - 1
.SetSelectionStartPos 7, 1 'Fila y columna de inicio
.ExtendSelectionRect filaguion, 79 'Fila y columna fin
.CopySelection
Print #2, .GetClipboardText
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "", "0", 1, 1
'.WaitForEvent rcEnterPos, "", "0", 7, 3
Loop

'internacionales

.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcEnterPos, "30", "0", 11, 3
fila = 11
Do While mesao <> GetDisplayText(fila, 69, 5)
If fila = 20 Then
.TransmitTerminalKey rcIBMPf8Key
.Wait ("3")
fila = 11
Else: fila = fila + 1
End If
If GetDisplayText(fila, 69, 5) = " " Then
GoTo fin
End If
Loop

.SetMousePos fila, 3
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rccurrentgraphicscursosrx,
rcCurrentGraphicsCursorY
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForEvent rcEnterPos, "30", "0", 4, 7
.WaitForDisplayString "Fact:", "30", 4, 1
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI "detint"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 4, 7
.WaitForDisplayString "Fact:", "30", 4, 1
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 4, 7
.WaitForDisplayString "Fact:", "30", 4, 1

Ultimo = 0

Do While Ultimo = 0
filaguion = 7

Do While filaguion < 21 And Ultimo = 0


If .GetDisplayText(filaguion, 26, 5) = "TOTAL" Then Ultimo = 1
filaguion = filaguion + 1
Loop
filaguion = filaguion - 1
If Ultimo = 1 Then filaguion = filaguion - 1
.SetSelectionStartPos 7, 1 'Fila y columna de inicio
.ExtendSelectionRect filaguion, 79 'Fila y columna fin
.CopySelection
Print #2, .GetClipboardText

.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "", "0", 1, 1
'.WaitForEvent rcEnterPos, "", "0", 7, 3

Loop
.TransmitTerminalKey rcIBMPf3Key

Close 2
Loop

.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

Close 1

Loop 'lista periodo

fin:
.TransmitTerminalKey rcIBMPf3Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

End With

Close 3

End Sub

Sub Hernancito_Fact_Por_Totales_Y_ABONO()

' Consulta de Facturacin para Telefona Pblica


' Recordar que la variable Urb es el total urb+interurb
Dim pathin, abono, pathou, linea, urb, iur, inter, mesin, vto, llur, lliur As
String
Dim fila As Integer

pathin = "C:\TEMP\tocata.TXT"
'InputBox("Ingrese Ruta y nombre del archivo de texto que contiene las lneas",
"Telefonia Publica")

'InputBox("Ingrese Ruta y nombre del archivo de texto a crear", "Telefonia


Publica")

Open pathin For Input As 1

mesin = InputBox("Ingrese el perodo a consultar(01/01 02/01...)", "Telefonia


Publica")
pathou = "C:\TEMP\fuga_agrupados" & Mid$(mesin, 1, 2) & "_" & Mid$(mesin, 4, 2) &
".TXT"
Open pathou For Output As 2
Print #2, "Linea;Total_urb_interurb;Internac;Abono;MesVencimiento"
With Session
.SetMousePos 21, 15
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForDisplayString "OPCN&SUBOPCN", "30", 21, 2
.TransmitANSI "1,1"
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'.WaitForEvent rcEnterPos, "30", "0", 5, 14
'Ingresamos la Lnea
Do While Not EOF(1)
Line Input #1, registro
linea = Mid(registro, 1, 10)
.SetMousePos 5, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
.TransmitANSI "a"
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitANSI linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'Seleccionamos Perodo
If GetDisplayText(22, 2, 6) <> " " Then
urb = 0
inter = 0

GoTo fin
End If
fila = 11
Do While mesin <> GetDisplayText(fila, 69, 5)
fila = fila + 1
If GetDisplayText(fila, 69, 5) = " " Then
urb = 0
iur = 0
inter = 0
llur = 0
lliur = 0

GoTo fin
End If
Loop
.SetMousePos fila, 3
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "rcomun"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.SetMousePos 5, 59
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Nro.Linea.", "30", 5, 48
.TransmitANSI "a" & linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

'-----------------------------------------------------
'Consultamos Total
fila = 9
Do While GetDisplayText(fila, 14, 5) <> "TOTAL"
fila = fila + 1
Loop
urb = .GetDisplayText(fila, 65, 11)

'------------------------sin errores---------------
'abono
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "abono "
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.SetMousePos 5, 59
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Nro.Linea.", "30", 5, 48
.TransmitANSI "a" & linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = 9
Do While GetDisplayText(fila, 26, 5) <> "TOTAL"
fila = fila + 1
Loop
abono = .GetDisplayText(fila, 68, 7)

'Consultamos Internacionales
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "detint"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.SetMousePos 5, 59
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Nro.Linea.", "30", 5, 48
.TransmitANSI "a" & linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = 6
If .GetDisplayText(9, 19, 5) = "MODO:" Then
Do While .GetDisplayText(fila, 26, 5) <> "TOTAL"
fila = fila + 1
If fila = 21 Then
fila = 6
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
End If
Loop
inter = .GetDisplayText(fila, 65, 11)
llinter = .GetDisplayText(fila, 53, 5)
Else
inter = 0
llinter = 0

End If

.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fin:
.TransmitTerminalKey rcIBMPf12Key

Print #2, linea & ";" & urb & ";" & inter & ";" & abono & ";" & mesin
Loop
Close 1
Close 2
End With
End Sub '
Sub DODDI_dispersion()
With Session

On Error GoTo mensaje

up = InputBox("Elija Usuario" + Chr$(13) + Chr$(13) + "1) u166898" + Chr$(13) + "2)


u174026" + Chr$(13) + "3) u178121")

If up = 1 Then
usr = "u166898"
pwd1 = "stefi" & Format(Month(Date), "0#")
pwd = "stefi" & Format((Month(Date + 30)), "0#")
End If

If up = 2 Then
usr = "u174026"
pwd1 = "lili" & Format(Month(Date), "0#")
pwd = "lili" & Format((Month(Date + 30)), "0#")
End If

If up = 3 Then
usr = "u178121"
pwd1 = "guati" & Format(Month(Date), "0#")
pwd = "guati" & Format((Month(Date + 30)), "0#")
End If

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForEvent rcEnterPos, "30", "0", 3, 15
.WaitForDisplayString "Application:", "30", 3, 2
.TransmitANSI "klst001"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "1", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 5, 26
.WaitForDisplayString "Usuario......", "30", 5, 12
denuevo:
.SetMousePos 5, 26
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY

.TransmitANSI usr
.TransmitTerminalKey rcIBMTabKey

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForEvent rcEnterPos, "30", "0", 6, 26
.WaitForDisplayString "Password.....", "30", 6, 12

.TransmitANSI pwd
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

If .FindText("PASSWORD NOT AUTHORIZED", 1, 1) Then


pwd = pwd1
GoTo denuevo
End If

.WaitForEvent rcEnterPos, "30", "0", 9, 2


.TransmitANSI "t"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 9, 2
.TransmitANSI "t"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 9, 2
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "1", 1, 1

If .FindText("BIENVENIDO", 1, 1) Then

.WaitForEvent rcEnterPos, "30", "0", 10, 26


.WaitForDisplayString ".", "30", 10, 24
.TransmitANSI usr
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

.TransmitANSI pwd
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
End If

Dim opci, opciint As Integer

pathin = "c:\windows\escritorio\facturacion - morosidad\macros\clientes.txt"


logging = "c:\windows\escritorio\facturacion - morosidad\macros\log.txt"

mesao = InputBox("Ingrese mes/ao (08/2000)")

pathou = "c:\windows\escritorio\facturacion - morosidad\macros\dispersion.txt"

Open pathin For Input As 1

.Wait ("2")
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitANSI "wfor"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcEnterPos, "30", "0", 22, 65
.WaitForDisplayString ":", "30", 22, 63

If usr = "u166898" Then

.TransmitANSI "3"

Else

.TransmitANSI "5"
End If
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 22, 65
.WaitForDisplayString ":", "30", 22, 63
.TransmitANSI "2"
.TransmitTerminalKey rcIBMEnterKey
.WindowState = rcMaximized
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 24
.WaitForDisplayString "CLIENTE:", "30", 3, 15

Open pathou For Output As 2


Print #2, "Numero de Cliente;Fecha de Cobro;Importe Cobrado;Numero de
Factura;Fecha Vencimiento;Titular;Fecha Reporte"

Do While Not EOF(1)


Line Input #1, registro
CLIENTE = Mid(registro, 1, 10)
sale = 0
cpage = 0
page = 0
.SetMousePos 3, 24
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcEnterPos, "30", "0", 3, 24
.WaitForDisplayString "CLIENTE:", "30", 3, 15
freporte = .GetDisplayText(1, 72, 8)
.TransmitANSI CLIENTE

.TransmitTerminalKey rcIBMEnterKey

nextpage:

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForEvent rcEnterPos, "30", "0", 22, 47
.WaitForDisplayString "OPCION:", "30", 22, 39

linea = 13
lineaint = 8

' CUANDO CAPTURA, VUELVE ACA

Do While linea < 22

If sale = 1 Then linea = linea + 1


opci = .GetDisplayText(linea, 4, 2)

If opci = " " Then GoTo siguiente


bandera = 0
If .GetDisplayText(linea, 59, 7) <> " " Then bandera = 1

.TransmitANSI opci
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 4, 73
.WaitForDisplayString "CONSULTA:", "30", 4, 63
.TransmitANSI "ft"
.TransmitTerminalKey rcIBMEnterKey

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForDisplayString "COBRO:", "30", 4, 12
' .TransmitTerminalKey rcIBMTabKey
' .TransmitTerminalKey rcIBMTabKey
' If bandera = 1 Then .TransmitTerminalKey rcIBMTabKey
' If bandera = 1 Then .TransmitTerminalKey rcIBMTabKey
' If bandera = 1 Then .TransmitTerminalKey rcIBMTabKey

.SetMousePos 4, 56
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcEnterPos, "30", "0", 4, 56

.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

If .GetDisplayText(9, 6, 10) = " " Then


sale = 1
GoTo fin
End If

' .WaitForEvent rcEnterPos, "30", "0", 21, 62

If sale = 1 Then
sale = 0
lineaint = 8
End If

lineaint = lineaint + 1
cuenta = 0
'cambio de pag si cambi antes
Do Until pagina = cuenta
.TransmitTerminalKey rcIBMPf8Key
cuenta = cuenta + 1
.WaitForEvent rcKbdEnabled, "200", "0", 1, 1
.WaitForEvent rcEnterPos, "200", "0", 21, 62
' .Wait ("5")
Loop

Do While .GetDisplayText(lineaint, 72, 7) <> mesao

If lineaint = 21 Then GoTo cpagina

If .GetDisplayText(lineaint, 72, 2) = " " Then


sale = 1
GoTo fin
End If

If lineaint = 20 Then
cpagina: If .GetDisplayText(21, 77, 3) = "+++" Then
.TransmitTerminalKey rcIBMPf8Key
pagina = pagina + 1
.WaitForEvent rcKbdEnabled, "200", "0", 1, 1
.WaitForEvent rcEnterPos, "200", "0", 21, 62
lineaint = 8
Else
sale = 1
GoTo fin
End If
End If

lineaint = lineaint + 1
Loop

opciint = .GetDisplayText(lineaint, 3, 2)
fvenc = .GetDisplayText(lineaint, 69, 12)
.WaitForEvent rcKbdEnabled, "200", "0", 1, 1
.WaitForEvent rcEnterPos, "200", "0", 21, 62
.TransmitANSI opciint
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 77
.WaitForDisplayString "CONSULTA:", "30", 3, 67

'captura de datos

fcobro = .GetDisplayText(10, 52, 10)


importe = .GetDisplayText(10, 20, 17)
nfactura = .GetDisplayText(5, 64, 13)
titular = .GetDisplayText(20, 18, 60)

Print #2, CLIENTE & ";" & fcobro & ";" & importe & ";" & nfactura & ";" & fvenc &
";" & titular & ";" & freporte

fin: .TransmitTerminalKey rcIBMPf3Key


If sale = 1 Then
pagina = 0

.TransmitTerminalKey rcIBMPf3Key
End If

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForDisplayString ":", "30", 22, 63
.TransmitANSI "2"

.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 22, 47
.WaitForDisplayString "OPCION:", "30", 22, 39

cpage = 0
Do Until cpage = page
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "OPCION:", "30", 22, 39
cpage = cpage + 1
Loop

Loop

siguiente:

If .GetDisplayText(22, 75, 3) = "+++" Then


.TransmitTerminalKey rcIBMPf8Key
sale = 0
page = page + 1
cpage = 0
GoTo nextpage
End If

Loop
.TransmitTerminalKey rcIBMPf12Key
Close 1
Close 2

Open logging For Append As #3


Print #3, "DISPERSION - EL ULTIMO CLIENTE CONSULTADO FUE: " & CLIENTE & " - " &
Date & " - " & Time
Close #3

Shell ("wscript .\mails\finDispersion.vbs")


End
mensaje: Shell ("wscript .\mails\eDispersion.vbs")
er = MsgBox(Error, vbOKOnly, "Error")
Resume

End With
End Sub

Sub DODDI_morosidad()
With Session

On Error GoTo mensaje

up = InputBox("Elija Usuario" + Chr$(13) + Chr$(13) + "1) u166898" + Chr$(13) + "2)


u174026" + Chr$(13) + "3) u178121")

If up = 1 Then
usr = "u166898"
pwd1 = "stefi" & Format(Month(Date), "0#")
pwd = "stefi" & Format((Month(Date + 30)), "0#")
End If

If up = 2 Then
usr = "u174026"
pwd1 = "lili" & Format(Month(Date), "0#")
pwd = "lili" & Format((Month(Date + 30)), "0#")
End If

If up = 3 Then
usr = "u178121"
pwd1 = "guati" & Format(Month(Date), "0#")
pwd = "guati" & Format((Month(Date + 30)), "0#")
End If

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForEvent rcEnterPos, "30", "0", 3, 15
.WaitForDisplayString "Application:", "30", 3, 2
.TransmitANSI "klst001"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "1", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 5, 26
.WaitForDisplayString "Usuario......", "30", 5, 12
denuevo:
.SetMousePos 5, 26
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY

.TransmitANSI usr
.TransmitTerminalKey rcIBMTabKey

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForEvent rcEnterPos, "30", "0", 6, 26
.WaitForDisplayString "Password.....", "30", 6, 12

.TransmitANSI pwd
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

If .FindText("PASSWORD NOT AUTHORIZED", 1, 1) Then


pwd = pwd1
GoTo denuevo
End If

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


.WaitForEvent rcEnterPos, "30", "0", 9, 2
.TransmitANSI "t"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 9, 2
.TransmitANSI "t"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 9, 2
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "1", 1, 1
.Wait ("3")
If .FindText("BIENVENIDO", 1, 1) Then

.WaitForEvent rcEnterPos, "30", "0", 10, 26


.WaitForDisplayString ".", "30", 10, 24
.TransmitANSI usr
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

.TransmitANSI pwd
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
End If

Dim opci, opciint As Integer

pathin = "c:\windows\escritorio\facturacion - morosidad\macros\clientes.txt"

'mesao = InputBox("Ingrese mes/ao (08/2000)")

pathou = "c:\windows\escritorio\facturacion - morosidad\macros\morosidad.txt"

logging = "c:\windows\escritorio\facturacion - morosidad\macros\log.txt"

Open pathin For Input As 1

.Wait ("2")
.TransmitTerminalKey rcIBMPf12Key
.TransmitANSI "wfor"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcEnterPos, "30", "0", 22, 65
.WaitForDisplayString ":", "30", 22, 63

If usr = "u166898" Then


.TransmitANSI "3"
Else
.TransmitANSI "5"

End If
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 22, 65
.WaitForDisplayString ":", "30", 22, 63
.TransmitANSI "2"
.TransmitTerminalKey rcIBMEnterKey
.WindowState = rcMaximized
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 3, 24
.WaitForDisplayString "CLIENTE:", "30", 3, 15

Open pathou For Output As 2


Print #2, "CLIENTE;ACUERDO;IMPORTE;ESTADO;RECLAMO;FVTO;FECHA
REPORTE;TITULAR"

Do While Not EOF(1)


Line Input #1, registro
CLIENTE = Mid(registro, 1, 10)
sale = 0
page = 0
cpage = 0
fecha = .GetDisplayText(1, 72, 8)
.SetMousePos 3, 24
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcEnterPos, "30", "0", 3, 24
.WaitForDisplayString "CLIENTE:", "30", 3, 15
.TransmitANSI CLIENTE

nextpage:

.TransmitTerminalKey rcIBMEnterKey

.WaitForEvent rcKbdEnabled, "30", "0", 1, 1


If .GetDisplayText(24, 9, 9) = "NO EXISTE" Then
Print #2, CLIENTE & ";No Existe"
GoTo siguiente
End If
.SetMousePos 22, 47
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcEnterPos, "30", "0", 22, 47
.WaitForDisplayString "OPCION:", "30", 22, 39

linea = 12

Do While linea < 22

otro: linea = linea + 1


opci = .GetDisplayText(linea, 4, 2)
deuda = .GetDisplayText(linea, 66, 4)

If opci = " " Then GoTo siguiente


If deuda = " " Then GoTo otro

.TransmitANSI opci

.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 4, 73
.WaitForDisplayString "CONSULTA:", "30", 4, 63
.TransmitANSI "ft"

.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "COBRO:", "30", 4, 12

npag: lineaint = 9

Do While lineaint < 21


If .GetDisplayText(lineaint, 1, 5) <> " " Then
acuerdo = .GetDisplayText(lineaint, 6, 10)
importe = .GetDisplayText(lineaint, 32, 14)
estado = .GetDisplayText(lineaint, 48, 13)
reclamo = .GetDisplayText(lineaint, 61, 7)
fvto = .GetDisplayText(lineaint, 69, 10)
titular = .GetDisplayText(5, 18, 60)
Print #2, CLIENTE & ";" & acuerdo & ";" & importe & ";" & estado & ";" &
reclamo & ";" & fvto & ";" & fecha & ";" & titular
lineaint = lineaint + 1

Else
GoTo sale
End If
Loop

sale: If .GetDisplayText(21, 77, 3) = "+++" Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "200", "0", 1, 1
.WaitForEvent rcEnterPos, "200", "0", 21, 62
GoTo npag
End If

.TransmitTerminalKey rcIBMPf3Key
.TransmitTerminalKey rcIBMPf3Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 22, 65
.WaitForDisplayString ":", "30", 22, 63
.TransmitANSI "2"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 22, 47
.WaitForDisplayString "OPCION:", "30", 22, 39

cpage = 0
Do Until cpage = page

.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "OPCION:", "30", 22, 39
cpage = cpage + 1
Loop

Loop

siguiente:

If .GetDisplayText(22, 75, 3) = "+++" Then


.TransmitTerminalKey rcIBMPf8Key
sale = 0
page = page + 1
cpage = 0
GoTo nextpage
End If
Loop
.TransmitTerminalKey rcIBMPf12Key
Close 1
Close 2

Open logging For Append As #3


Print #3, "MOROSIDAD - EL ULTIMO CLIENTE CONSULTADO FUE: " & CLIENTE & " - " & Date
& " - " & Time
Close #3
Shell ("wscript .\mails\finMorosidad.vbs")
End With
End
mensaje: Shell ("wscript .\mails\eMorosidad.vbs")
er = MsgBox(Error, vbOKOnly, "Error")
Resume

End Sub
Sub DODDI_facturacion()
'
' Generated by the Reflection Macro Recorder on 08-22-2001 10:44:33.80
' Generated by Reflection for IBM for Windows 8.00
'

'SOLO CONSULTA LA 1ERA PAGINA DE LAS FACTURAS

pathin = "c:\windows\escritorio\macros\parque.txt"
logout = "c:\windows\escritorio\macros\parque sin facturacion.txt"

mesao = InputBox("Ingrese mes/ao (08/00)")

mes = Mid$(mesao, 1, 2)
mesemi = mes - 2
If mesemi < 10 Then mesemi = "0" & mesemi
emision = "10/" & mesemi & Mid$(mesao, 3, 3)

pathou = "c:\windows\escritorio\macros\facturacion.txt"

With Session

Open pathin For Input As 1


Open logout For Output As 3

Open pathou For Output As 2


Print #2, "Nro Linea;Importe;Fecha de Vencimiento;Nro Acuerdo;Numero
Factura;Titular;Fecha Reporte;Cliente"

Do While Not EOF(1)


Line Input #1, registro
CLIENTE = Mid(registro, 1, 10)
.SetMousePos 21, 15
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcEnterPos, "30", "0", 21, 15
.WaitForDisplayString "OPCN&SUBOPCN", "30", 21, 2
.TransmitANSI "1,1"
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 5, 14
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2

hoy = .GetDisplayText(1, 70, 6) & .GetDisplayText(1, 78, 2)

.SetMousePos 4, 71
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX, rcCurrent
.TransmitANSI emision
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.SetMousePos 5, 17
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY

.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitANSI CLIENTE

bandera = 0

.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
' .WaitForEvent rcEnterPos, "30", "0", 5, 14
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
If .GetDisplayText(22, 7, 32) = "NUMERO DE SERVICIO NO ENCONTRADO" Then
conhoy: .SetMousePos 4, 71
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX, rcCurrent
.TransmitANSI hoy
bandera = 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

If .GetDisplayText(22, 7, 32) = "NUMERO DE SERVICIO NO ENCONTRADO" Then


Print #3, CLIENTE & ";NO EXISTE EL NUMERO EN LAS 2 FECHAS PROBADAS"
GoTo siguiente
End If

End If

titular = .GetDisplayText(9, 12, 52)


freporte = .GetDisplayText(1, 70, 10)
.TransmitTerminalKey rcIBMPf22Key
.SetSelectionStartPos 11, 46
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

linea = 11
vencimiento = .GetDisplayText(linea, 69, 5)

Do Until vencimiento = mesao

If linea = 20 And bandera = 0 Then


.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
GoTo conhoy
End If

If linea = 21 And bandera = 1 Then

Print #3, CLIENTE & ";NO ENCUENTRO FACTURACION EN ESE VENCIMIENTO"


GoTo siguiente

End If

linea = linea + 1
vencimiento = .GetDisplayText(linea, 69, 5)

Loop

total = .GetDisplayText(linea, 46, 15)

'TRANSFORMACION DEL IMPORTE

longitud = Len(total) + 1
i = 1
bandera = False
importe = ""

Do Until longitud < i


caracter = Mid$(total, i, 1)
If caracter = " " Then GoTo otro
If caracter = "." Then
caracter = ","
bandera = True
End If
If caracter = "," And bandera = False Then caracter = "."
If caracter = "-" Then
importe = "-" & importe
GoTo otro
End If
importe = importe & caracter
otro: i = i + 1
Loop
'-----------------------------

fvenc = .GetDisplayText(linea, 66, 8)


acuerdo = .GetDisplayText(4, 25, 10)
nfac = .GetDisplayText(linea, 28, 13)
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
client = .GetDisplayText(8, 13, 10)
Print #2, CLIENTE & ";" & importe & ";" & fvenc & ";" & acuerdo & ";" &
nfac & ";" & titular & ";" & freporte & ";" & client
siguiente: Loop
Close 1
Close 2
Close 3
End With
End Sub
Sub new_TENEDORES_MULTIPLES()

'
' Generated by : Saca trafico de llamadas para calificar como grandes clientes
'

Dim pathin, TOTLINEA, pathou, cat, linea, abo, urb, iur, clie, total, afact,
bacintur, pecintur, baurcla, peurcla, bacofro, pecofro As String
Dim fila, fila1, fila2 As Integer
Dim found As Integer
Dim fact, arch As String

pathin = "c:\temp\tm.TXT"
pathou = "c:\temp\resultm.TXT"

Open pathin For Input As 1


Open pathou For Output As 2
mes = InputBox("ingresa mes y no te lo repito m")

With Session

.WaitForDisplayString "Opcion", "30", 4, 2


.TransmitANSI "1"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Opcion....", "30", 6, 2
.TransmitANSI "1"
.TransmitTerminalKey rcIBMEnterKey
.WaitForDisplayString "Accion....", "30", 7, 2
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'kkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Print #2, "cat" & ";" & "linea" & ";" & "urb" & ";" & "iur" & ";" & "TOTAL"
& ";" & "abo" & ";" & "RDCLI" & ";" & "baseinter" & ";" & "pesosinter" & ";" &
"baseurba" & ";" & "pesourba" & ";" & "basefro" & ";" & "pesofro" & ";" & "total" &
";" & "totalfactu"
Do While Not EOF(1)
clie = ""
cat = ""
urb = ""
iur = ""
TOTLINEA = ""
abo = ""
bacintur = ""
pecintur = ""
baurcla = ""
peurcla = ""
bacofro = ""
pecofro = ""
total = ""
totfact = ""
Line Input #1, registro
linea = Mid(registro, 1, 10)
.SetMousePos 5, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
.TransmitANSI "a"
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitANSI linea
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

.WaitForDisplayString "Nro.Linea.:", "30", 5, 2


cat = .GetDisplayText(5, 42, 2)
clie = .GetDisplayText(8, 13, 10)
'-------------- paso a la sig pantalla-----
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'-------factura elegida-----
fila = 11
Do While mes <> GetDisplayText(fila, 69, 2)
fila = fila + 1
If GetDisplayText(fila, 69, 2) = " " Then
GoTo seguir
End If
Loop

.SetMousePos fila, 3
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
.TransmitTerminalKey rcIBMTabKey
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rccurrentgraphicscursosrx,
rcCurrentGraphicsCursorY
.TransmitANSI "s"
'--------- total a pagar ------------
total = .GetDisplayText(fila, 48, 13)
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'----------------------------------------------

found = FindText("Total Facturado", 1, 1)


If found Then
fila = Application.FoundTextRow
totfact = .GetDisplayText(fila, 64, 12)
End If
' si no esta en primer pantalla
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'busca en 2da pantalla
found = FindText("Total Facturado", 1, 1)
If found Then
fila = Application.FoundTextRow
totfact = .GetDisplayText(fila, 64, 12)
End If
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "abono"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitANSI linea
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
found = FindText("TOTAL LINEA", 1, 1)
If found Then
fila = Application.FoundTextRow
abo = .GetDisplayText(fila, 65, 10)
End If
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "rcomun"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitANSI linea
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

found = FindText("TOTAL LINEA", 1, 1)


If found Then
fila = Application.FoundTextRow
TOTLINEA = .GetDisplayText(fila, 66, 10)
End If

found = FindText("Urbana", 1, 1)
If found Then
fila = Application.FoundTextRow
urb = .GetDisplayText(fila, 66, 10)
End If
found = FindText("Interurbana", 1, 1)
If found Then
fila = Application.FoundTextRow
iur = .GetDisplayText(fila, 66, 10)
End If
'&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
'---- UTILIZO SECCIONES (tottel)---
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "tottel"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

'-------------------------------------------------------------------------
' busqueda de claves en primer pantalla
'------- Buscar consumos interurbanos -----
found = FindText("Consumos Interurbanos", 1, 1)
If found Then
fila = Application.FoundTextRow
bacintur = .GetDisplayText(fila, 44, 10)
pecintur = .GetDisplayText(fila, 64, 11)
End If
'--------- Buscar urbanos y clave 1 ----
found = FindText("Consumos Urb.+ Clave 1", 1, 1)
If found Then
fila = Application.FoundTextRow
baurcla = .GetDisplayText(fila, 44, 10)
peurcla = .GetDisplayText(fila, 64, 11)
End If
'--------- Buscar consumos fronterizos----
found = FindText("Consumos Nacionales y Front", 1, 1)
If found Then
fila = Application.FoundTextRow
bacofro = .GetDisplayText(fila, 44, 10)
pecofro = .GetDisplayText(fila, 64, 11)
End If

'############################################################
'-----------fin de busqueda 1er pantalla e inicio de 2da-----
'############################################################

.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

found = FindText("Consumos Interurbanos", 1, 1)


If found Then
fila = Application.FoundTextRow
bacintur = .GetDisplayText(fila, 44, 10)
pecintur = .GetDisplayText(fila, 66, 11)
End If
'--------- Buscar urbanos y clave 1 ----
found = FindText("Consumos Urb.+ Clave 1", 1, 1)
If found Then
fila = Application.FoundTextRow
baurcla = .GetDisplayText(fila, 44, 10)
peurcla = .GetDisplayText(fila, 66, 11)
End If
'--------- Buscar consumos fronterizos----
found = FindText("Consumos Nacionales y Front", 1, 1)
If found Then
fila = Application.FoundTextRow
bacofro = .GetDisplayText(fila, 43, 11)
pecofro = .GetDisplayText(fila, 64, 11)
End If

'------------ fin y regreso ----------------------


.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
seguir:
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

cat = Trim$(cat)
linea = Trim$(linea)
urb = Trim$(urb)
iur = Trim$(iur)
abo = Trim$(abo)
clie = Trim$(clie)
basecintur = Trim$(bacintur)
pesocintur = Trim$(pecintur)
baseurcla = Trim$(baurcla)
pesourcla = Trim$(peurcla)
total = Trim$(total)
totalfact = Trim$(totfact)
Print #2, cat & ";" & linea & ";" & urb & ";" & iur & ";" & TOTLINEA &
";" & abo & ";" & clie & ";" & basecintur & ";" & pesocintur & ";" & baseurcla &
";" & pesourcla & ";" & bacofro & ";" & pecofro & ";" & total & ";" & totalfact
Loop
Close 1
Close 2

End With
End Sub

Sub Grandes_Clientes_nuevo()

Dim pathin, pathou, linea, afact, nfact, vto, fbaj, retri, serv, total As String
Dim nombclie, clie, abo100, bacla2hr, pecla2hr, bacla2hn, pecla2hn, bacla3hr,
pecla3hr, bacla3hn, pecla3hn, bacla4hr, pecla4hr, bacla4hn, pecla4hn, bacla5hr,
pecla5hr, bacla5hn, pecla5hn, bacla612hr, pecla612hr, bacla612hn, pecla612hn,
bonif, comi, todesc, bacofro, pecofro As String
Dim totba, totpa As Long

Dim sEmision As String


Dim fEmision As Date
Dim fila, fila1, fila2 As Integer
Dim found As Integer
Dim Inicial, Tot As Long
Dim i As Integer
Dim Salir As Boolean
Dim sFI, sFC As String
Dim dFI, dFC As Date

pathin = "c:\temp\entrada.txt"
pathou = "c:\temp\salida.txt"
Dim fso As Object, file As Object

Open pathin For Input As 1


Open pathou For Output As 2
With Session
Dim hostpassword As String

.WaitForEvent rcKbdEnabled, "180", "0", 1, 1


.WaitForDisplayString "Opcion", "180", 4, 2
.TransmitANSI "1"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Opcion....", "180", 6, 2
.TransmitANSI "1"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Accion....", "180", 7, 2
.TransmitANSI "c"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
Print #2, "FLABE-NEW" & ";" & "nomclie" & ";" & "ACUERDO" & ";" & "NROFACT"
& ";" & "FBAJA" & ";" & "FVTO" & ";" & "TOTAL" & ";" & "RDCLI" & ";" & "BONIFABO" &
";" & "ADSL" & ";" & "BACLA2HR" & ";" & "PECLA2HR" & ";" & "BACLA2HN" & ";" &
"pecla2hn" & ";"; "bacla3hr" & ";" & "pecla3hr" & ";" & "bacla3hn" & ";" &
"pecla3hn" & ";" & "bacla4hr" & ";" & "pecla4hr" & ";" & "bacla4hn" & ";" &
"pecla4hn" & ";" & "bacla5hr" & ";" & "pecla5hr" & ";" & "bacla5hn" & ";" &
"pecla5hn" & ";" & "bacla612hr" & ";" & "pecla612hr" & ";" & "bacla612hn" & ";" &
"pecla612hn" & ";" & "Total_base_claves" & ";" & "Total_desc_claves" & ";" &
"bonif" & ";" & "comi" & ";" & "todesc" & ";" & "bacofro" & ";" & "pecofro"
Do While Not EOF(1)

boarap = ""
afact = ""
nfact = ""
fbaj = ""
vto = ""
serv = ""
resum = ""
retri = ""
total = ""
Inicial = Inicial + 1
nomclie = ""
clie = ""
abo100 = ""
bacla2hr = ""
pecla2hr = ""
bacla2hn = ""
pecla2hn = ""
bacla3hr = ""
pecla3hr = ""
bacla3hn = ""
pecla3hn = ""
bacla4hr = ""
pecla4hr = ""
bacla4hn = ""
pecla4hn = ""
bacla5hr = ""
pecla5hr = ""
bacla5hn = ""
pecla5hn = ""
bacla612hr = ""
pecla612hr = ""
bacla612hn = ""
pecla612hn = ""
totba = ""
totpe = ""
bonif = ""
comin = ""
todesc = ""
bacofro = ""
pecofro = ""

Line Input #1, registro


linea = Mid(registro, 1, 10)
'.Caption = linea & " MACRO LISU " & Format((Inicial / Tot) * 100,
"##00.00") & "%" & " El total de Lineas a procesar es : " & Tot
.SetMousePos 4, 71
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.TransmitANSI " "

.SetMousePos 5, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForDisplayString "Nro.Linea.:", "180", 5, 2
.TransmitANSI "a"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitANSI linea
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Nro.Linea.:", "180", 5, 2
'copia el acuerdo de facturacin-----
afact = .GetDisplayText(4, 14, 10)
fbaj = .GetDisplayText(5, 71, 8)
'-------------- FIN PRIMER PANTALLA-----
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
'RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
dEmision = .GetDisplayText(11, 9, 8)

If Trim(dEmision) <> "" Then


fEmision = CDate(dEmision)
.TransmitTerminalKey rcIBMPf3Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitANSI "4"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitANSI "l"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForDisplayString "FCDLS2", "180", 1, 3
'----------- PANTALLA NUEVA ----------------
Salir = False
i = 0
While Not (Salir)
sFI = .GetDisplayText(10 + i, 3, 8) ' FI = Fecha Inicio
sFC = .GetDisplayText(10 + i, 13, 8) ' FC = Fecha Cancel
afact = .GetDisplayText(10 + i, 23, 10) ' Acuerdo
If (Not (IsDate(sFC))) And (IsDate(sFI)) Then
dFI = CDate(sFI)
Salir = True
ElseIf (Not (IsDate(sFC))) And (Not (IsDate(sFI))) Then
Salir = True
Else
dFI = CDate(sFI)
dFC = CDate(sFC)
sFI_siguiente = Trim(.GetDisplayText(11 + i, 3, 8))
If ((fEmision >= dFI) And (fEmision <= dFC)) Or (sFI_siguiente =
"") Then Salir = True
End If
i = i + 1
If i = 9 Then
i = 0
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
End If
Wend
.TransmitTerminalKey rcIBMPf3Key
.WaitForDisplayString "FFW120", "180", 1, 3
.TransmitANSI "1"
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

.SetMousePos 4, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

.TransmitANSI afact
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Nro.Linea.:", "180", 5, 2
'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
clie = .GetDisplayText(8, 13, 10)
nomclie = .GetDisplayText(9, 13, 49)

'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
End If
nfact = .GetDisplayText(11, 28, 13)
vto = .GetDisplayText(11, 66, 8)
'--------ENTRAMOS EN LA ULTIMA FACTURA-----
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
If GetDisplayText(4, 1, 1) = " " Then GoTo seguir
.WaitForDisplayString "Fact:", "180", 4, 1
'----CON ESTO ME TRAIGO TODO A UNA PANTALLA----
'---- UTILIZO SECCIONES (RESUM)---
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "resum"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

'--------- Buscar Total ----


found = FindText("Total a Pagar", 1, 1)
If found Then
fila = Application.FoundTextRow
total = .GetDisplayText(fila, 64, 12)
End If
'-----------------------------------
'------- entrar en tottel------
.TransmitTerminalKey rcIBMTabKey
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "tottel"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
'############################################
'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
'------- Buscar clave2hr -----
found = FindText("Clave 2 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla2hr = .GetDisplayText(fila, 44, 10)
pecla2hr = .GetDisplayText(fila, 66, 9)
End If
'--------- Buscar clave2hn ----
found = FindText("Clave 2 Horario Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla2hn = .GetDisplayText(fila, 44, 10)
pecla2hn = .GetDisplayText(fila, 66, 9)
End If

'-------- Buscar Clave3hr---------------


found = FindText("Clave 3 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla3hr = .GetDisplayText(fila, 44, 10)
pecla3hr = .GetDisplayText(fila, 66, 9)
End If

'--------buscar clave3hn----------------
found = FindText("Clave 3 Horario Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla3hn = .GetDisplayText(fila, 44, 10)
pecla3hn = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave4hr----------------
found = FindText("Clave 4 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla4hr = .GetDisplayText(fila, 44, 10)
pecla4hr = .GetDisplayText(fila, 66, 9)

End If

'--------buscar clave4hn----------------
found = FindText("Clave 4 Horario Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla4hn = .GetDisplayText(fila, 44, 10)
pecla4hn = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave5hr ---------
found = FindText("Clave 5 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla5hr = .GetDisplayText(fila, 44, 10)
pecla5hr = .GetDisplayText(fila, 66, 9)
End If

'--------buscar clave5hn ---------


found = FindText("Clave 5 Horario Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla5hn = .GetDisplayText(fila, 44, 10)
pecla5hn = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave612hn ---------
found = FindText("Clave 6 a 12H. Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla612hn = .GetDisplayText(fila, 44, 10)
pecla612hn = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave612hr ---------
found = FindText("Clave 6 a 12H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla612hr = .GetDisplayText(fila, 44, 10)
pecla612hr = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave612hn (con espacio)---------
found = FindText("Clave 6 a 12 H. Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla612hn = .GetDisplayText(fila, 44, 10)
pecla612hn = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave612hr (con espacio)---------
found = FindText("Clave 6 a 12 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla612hr = .GetDisplayText(fila, 44, 10)
pecla612hr = .GetDisplayText(fila, 66, 9)
End If
'--------buscar cosumos fronterizos ---------
found = FindText("Consumos front/reg", 1, 1)
If found Then
fila = Application.FoundTextRow
bacofro = .GetDisplayText(fila, 44, 10)
pecofro = .GetDisplayText(fila, 66, 9)
End If

'############################################################
'-----------fin de busqueda 1er pantalla e inicio de 2da-----
'############################################################
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'--------buscar clave612hn ---------
If bacla612hn = "" Then
found = FindText("Clave 6 a 12H. Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla612hn = .GetDisplayText(fila, 44, 10)
pecla612hn = .GetDisplayText(fila, 66, 9)
End If
End If
'_____________________________________________
If bacla612hr = "" Then
'--------buscar clave612hr ---------
found = FindText("Clave 6 a 12H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla612hr = .GetDisplayText(fila, 44, 10)
pecla612hr = .GetDisplayText(fila, 66, 9)
End If
End If
'--------buscar clave612hn (con espacio)---------
If bacla612hn = "" Then
found = FindText("Clave 6 a 12 H. Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla612hn = .GetDisplayText(fila, 44, 10)
pecla612hn = .GetDisplayText(fila, 66, 9)
End If
End If
'--------buscar clave612hr (con espacio)---------
If bacla612hr = "" Then
found = FindText("Clave 6 a 12 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
bacla612hr = .GetDisplayText(fila, 44, 10)
pecla612hr = .GetDisplayText(fila, 66, 9)
End If
End If
'--------buscar consumos fronterizos ---------
found = FindText("Consumos front/reg", 1, 1)
If found Then
fila = Application.FoundTextRow
bacofro = .GetDisplayText(fila, 44, 10)
pecofro = .GetDisplayText(fila, 66, 9)
End If
'###############################################
'sacar descuentos y promociones
'###############################################
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "descue"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'-----------------------------------------------
' - Primer pantalla -
'-----------------------------------------------
' saca abono 100%
If abo100 = "" Then
found = FindText("Dto. esp. acciones promocionales", 1, 1)
If found Then
fila = Application.FoundTextRow
abo100 = .GetDisplayText(fila, 64, 12)
End If
End If
If boarap = "" Then
found = FindText("Bonificacion Acceso Rapido", 1, 1)
If found Then
fila = Application.FoundTextRow
boarap = .GetDisplayText(fila, 64, 12)
End If
End If

' saca valor de bonificacion en el total de descuentos


If bonif = "" Then
found = FindText("Bonif.", 1, 1)
If found Then
fila = Application.FoundTextRow
bonif = .GetDisplayText(fila, 64, 12)
End If
End If
If todesc = "" Then
found = FindText("TOTAL DE DESCUENTOS Y PROMOCIONES", 1, 1)
If found Then
fila = Application.FoundTextRow
todesc = .GetDisplayText(fila, 64, 12)

End If
End If
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If todesc = "" Then
found = FindText("TOTAL DE DESCUENTOS Y PROMOCIONES", 1, 1)
If found Then
fila = Application.FoundTextRow
todesc = .GetDisplayText(fila, 64, 12)

End If
End If
.TransmitTerminalKey rcIBMPf7Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

'###############################################
'sacar total consumos internacionales
'###############################################
' - Primer busqueda -
If comin = "" Then
found = FindText("TOTAL DE COMUNIC. INTERNACIONALES", 1, 1)
If found Then
fila = Application.FoundTextRow
comin = .GetDisplayText(fila, 64, 12)
End If
End If
'------- retrocede------------------------------
.TransmitTerminalKey rcIBMPf7Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If comin = "" Then
found = FindText("TOTAL DE COMUNIC. INTERNACIONALES", 1, 1)
If found Then
fila = Application.FoundTextRow
comin = .GetDisplayText(fila, 64, 12)

End If
End If

'FINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFIN
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
seguir:
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

linea = Trim$(linea)
afact = Trim$(afact)
nfact = Trim$(nfact)
fbaj = Trim$(fbaj)
vto = Trim$(vto)
total = Trim$(total)
nomclie = Trim$(nomclie)
clie = Trim$(clie)
abo100 = Trim$(abo100)
boarap = Trim$(boarap)
bacla2hr = Trim$(bacla2hr)
pecla2hr = Trim$(pecla2hr)
bacla2hn = Trim$(bacla2hn)
pecla2hn = Trim$(pecla2hn)
bacla3hr = Trim$(bacla3hr)
pecla3hr = Trim$(pecla3hr)
bacla3hn = Trim$(bacla3hn)
pecla3hn = Trim$(pecla3hn)
bacla4hr = Trim$(bacla4hr)
pecla4hr = Trim$(pecla4hr)
bacla4hn = Trim$(bacla4hn)
pecla4hn = Trim$(pecla4hn)
bacla5hr = Trim$(bacla5hr)
pecla5hr = Trim$(pecla5hr)
bacla5hn = Trim$(bacla5hn)
pecla5hn = Trim$(pecla5hn)
bacla612hr = Trim$(bacla612hr)
pecla612hr = Trim$(pecla612hr)
bacla612hn = Trim$(bacla612hn)
pecla612hn = Trim$(pecla612hn)
bonif = Trim$(bonif)
comin = Trim$(comin)
todesc = Trim$(todesc)
bacofro = Trim$(bacofro)
pecofro = Trim$(pecofro)

totba = Val(Replace(bacla2hn, ",", ".")) + Val(Replace(bacla2hr, ",",


".")) + Val(Replace(bacla3hn, ",", ".")) + Val(Replace(bacla3hr, ",", ".")) +
Val(Replace(bacla4hn, ",", ".")) + Val(Replace(bacla4hr, ",", ".")) +
Val(Replace(bacla5hn, ",", ".")) + Val(Replace(bacla5hr, ",", ".")) +
Val(Replace(bacla612hn, ",", ".")) + Val(Replace(bacla612hr, ",", "."))
totpe = Val(Replace(pecla2hn, ",", ".")) + Val(Replace(pecla2hr, ",",
".")) + Val(Replace(pecla3hn, ",", ".")) + Val(Replace(pecla3hr, ",", ".")) +
Val(Replace(pecla4hn, ",", ".")) + Val(Replace(pecla4hr, ",", ".")) +
Val(Replace(pecla5hn, ",", ".")) + Val(Replace(pecla5hr, ",", ".")) +
Val(Replace(pecla612hn, ",", ".")) + Val(Replace(pecla612hr, ",", "."))

Print #2, linea & ";" & nomclie & ";" & afact & ";" & nfact & ";" &
fbaj & ";" & vto & ";" & total & ";" & clie & ";" & abo100 & ";" & boarap & ";" &
bacla2hr & ";" & pecla2hr & ";" & bacla2hn & ";" & pecla2hn & ";" & bacla3hr & ";"
& pecla3hr & ";" & bacla3hn & ";" & pecla3hn & ";" & bacla4hr & ";" & pecla4hr &
";" & bacla4hn & ";" & pecla4hn & ";" & bacla5hr & ";" & pecla5hr & ";" & bacla5hn
& ";" & pecla5hn & ";" & bacla612hr & ";" & pecla612hr & ";" & bacla612hn & ";" &
pecla612hn & ";" & totba & ";" & totpe & ";" & bonif & ";" & comin & ";" & todesc &
";" & bacofro & ";" & pecofro

Loop
Close
'Call logPrint("### TERMINO Proceso de Importacin de List LISU ###",
Get_INI("LISU", "pathlog"))

.TransmitTerminalKey rcIBMPf3Key
.TransmitTerminalKey rcIBMPf3Key
.TransmitTerminalKey rcIBMPf3Key

Dim X
X = MsgBox("FIN DE LA MACRO", vbOKOnly)
End With
End Sub

Sub Hernancito_Fact_agrupados()

' Consulta de Facturacin para Telefona Pblica

Dim pathin, pathou, linea, urb, iur, inter, mesin, vto, llur, lliur As String
Dim fila, i As Integer
Dim mes(8) As String

mes(1) = "05"
mes(2) = "04"
mes(3) = "03"
mes(4) = "02"
mes(5) = "01"
mes(6) = "12"
mes(7) = "11"
mes(8) = "10"

'*** PONER EL MES ACA


i = 0

Do Until i = 8
i = i + 1
pathin = "C:\TEMP\tocata_agrupados.TXT"

'InputBox("Ingrese Ruta y nombre del archivo de texto que contiene las lneas",
"Telefonia Publica")
'mesin = InputBox("Ingrese el perodo a consultar(01 02...)", "Telefonia
Publica")
mesin = mes(i)
pathou = "C:\TEMP\fuga_agrupados_" & mesin & ".TXT"
'InputBox("Ingrese Ruta y nombre del archivo de texto a crear", "Telefonia
Publica")

Open pathin For Input As 1


Open pathou For Output As 2
Print #2, "linea" & ";" & "urb" & ";" & "interurb" & ";" & "internac" & ";" &
"cant_urb" & ";" & "cant_interurb"

With Session
.SetMousePos 21, 15
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForDisplayString "OPCN&SUBOPCN", "30", 21, 2
.TransmitANSI "1,1"
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'.WaitForEvent rcEnterPos, "30", "0", 5, 14
'Ingresamos la Lnea
Do While Not EOF(1)
Line Input #1, registro
linea = Mid(registro, 1, 10)
.SetMousePos 5, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
.TransmitANSI "a"
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitANSI linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Nro.Linea.:", "30", 5, 2
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'Seleccionamos Perodo
If GetDisplayText(22, 2, 6) <> " " Then
urb = 0
iur = 0
inter = 0
llur = 0
lliur = 0

GoTo fin
End If
fila = 11
Do While mesin <> GetDisplayText(fila, 69, 2)
fila = fila + 1
If GetDisplayText(fila, 69, 2) = " " Then
urb = 0
iur = 0
inter = 0
llur = 0
lliur = 0

GoTo fin
End If
Loop
.SetMousePos fila, 3
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If .GetDisplayText(22, 7, 15) = "FACTURA MIGRADA" Then GoTo fin
'Consultamos Nacionales
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "rcomun"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.SetMousePos 5, 59
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Nro.Linea.", "30", 5, 48
.TransmitANSI "a" & linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

'-----------------------------------------------------
'Consultamos Urbanas
fila = 9
If GetDisplayText(fila, 16, 6) = "Urbana" Then
urb = .GetDisplayText(fila, 65, 11)
llur = .GetDisplayText(fila, 53, 5)
fila = fila + 1
Else
urb = 0
llur = 0
End If
'Consultamos Interubanas
If GetDisplayText(fila, 16, 11) = "Interurbana" Then
iur = .GetDisplayText(fila, 65, 11)
lliur = .GetDisplayText(fila, 53, 5)
Else
iur = 0
lliur = 0

End If
'------------------------sin errores---------------
'Consultamos Internacionales
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "detint"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.SetMousePos 5, 59
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Nro.Linea.", "30", 5, 48
.TransmitANSI "a" & linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = 6
If .GetDisplayText(9, 19, 5) = "MODO:" Then
Do While .GetDisplayText(fila, 26, 5) <> "TOTAL"
fila = fila + 1
If fila = 21 Then
fila = 6
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
End If
Loop
inter = .GetDisplayText(fila, 65, 11)
llinter = .GetDisplayText(fila, 53, 5)
Else
inter = 0
llinter = 0

End If
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fin:
.TransmitTerminalKey rcIBMPf12Key
Print #2, linea & ";" & urb & ";" & iur & ";" & inter & ";" & llur &
";" & lliur
Loop
Close 1
Close 2
End With

Loop
End Sub
Sub Estudio_de_trafico()

Dim pathin, pathou, linea, afact, nfact, vto, fbaj, retri, serv, total As String
Dim nombclie, clie, abo100, pecla2hr, pecla2hn, pecla3hr, pecla3hn, pecla4hr,
pecla4hn, pecla5hr, pecla5hn, pecla612hr, pecla612hn, bonif, comi, todesc, bacofro,
pecofro, Curbmul, Durbmul, Curbnor, Durbnor, Curbred, Durbred, Cc1mul, Dc1mul,
Pc1mul, Cc1nor, DC1nor, Pc1nor, CC1red, DC1red, Pc1red, Cc2mul, Dc2mul, P2mul,
Cc2nor, DC2nor, Pc2nor, C2red, DC2red, Pc2red, Cc3mul, Dc3mul, Pc3mul, Cc3nor,
DC3nor, Pc3nor, CC3red, DC3red, Pc3red, Cc4mul, Dc4mul, Pc4mul, Cc4nor, DC4nor,
Pc4nor, CC4red, DC4red, Pc4red, Cc5mul, Dc5mul, Pc5mul, Cc5nor, DC5nor, CC5red,
DC5red, Pc5red, Cc6mul, Dc6mul, Pc6mul, Cc6nor, DC6nor, Pc6nor, CC6red, DC6red,
Pc6red, baseurb, peurb As String
Dim totba, totpa As Long

Dim sEmision As String


Dim fEmision As Date
Dim fila, fila1, fila2 As Integer
Dim found As Integer
Dim Inicial, Tot As Long
Dim i As Integer
Dim Salir As Boolean
Dim sFI, sFC As String
Dim dFI, dFC As Date

pathin = "c:\temp\entrada.txt"
pathou = "c:\temp\trafico_genesis_ene.txt"

Dim fso As Object, file As Object

Open pathin For Input As 1


Open pathou For Output As 2
With Session
Dim hostpassword As String

.WaitForEvent rcKbdEnabled, "180", "0", 1, 1


.WaitForDisplayString "Opcion", "180", 4, 2
.TransmitANSI "1"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Opcion....", "180", 6, 2
.TransmitANSI "1"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Accion....", "180", 7, 2
.TransmitANSI "c"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
Print #2, "FLABE-NEW" & ";" & "nomclie" & ";" & "ACUERDO" & ";" & "NROFACT"
& ";" & "FBAJA" & ";" & "FVTO" & ";" & "TOTAL" & ";" & "RDCLI" & ";" & "BONIFABO" &
";" & "ADSL" & ";" & "PECLA2HR" & ";" & "pecla2hn" & ";" & "pecla3hr" & ";" &
"pecla3hn" & ";" & "pecla4hr" & ";" & "pecla4hn" & ";" & "pecla5hr" & ";" &
"pecla5hn" & ";" & "pecla612hr" & ";" & "pecla612hn" & ";" & "Total_desc_claves" &
";" & "bonif" & ";" & "comi" & ";" & "todesc" & ";" & "bacofro" & ";" & "pecofro" &
";" & _
"Curbmul" & ";" & "Durbmul" & ";" & "Curbnor" & ";" & "Durbnor" & ";" &
"Curbred" & ";" & "Durbred" & ";" & "Cc1mul" & ";" & "Dc1mul" & ";" & "Cc1nor" &
";" & "DC1nor" & ";" & "CC1red" & ";" & "DC1red" & ";" & "Cc2mul" & ";" & "Dc2mul"
& ";" & "Pc2mul" & ";" & "Cc2nor" & ";" & "DC2nor" & ";" & "Pc2nor" & ";" &
"CC2red" & ";" & "DC2red" & ";" & "Pc2red" & ";" & "Cc3mul" & ";" & "Dc3mul" & ";"
& "Pc3mul" & ";" & "Cc3nor" & ";" & "DC3nor" & ";" & "Pc3nor" & ";" & "CC3red" &
";" & "DC3red" & ";" & "Pc3red" & ";" & "Cc4mul" & ";" & "Dc4mul" & ";" & "Pc4mul"
& ";" & "Cc4nor" & ";" & "DC4nor" & ";" & "Pc4nor" & ";" & "CC4red" & ";" &
"DC4red" & ";" & "Pc4red" & ";" & "Cc5mul" & ";" & "Dc5mul" & ";" & "Pc5mul" & ";"
& "Cc5nor" & ";" & "DC5nor" & ";" & "Pc5nor" & ";" & "CC5red" & ";" & "DC5red" &
";" & "Pc5red" & ";" & "Cc6mul" & ";" & "Dc6mul" & ";" & "Pc6mul" & ";" & "Cc6nor"
& ";" & "DC6nor" & ";" & "Pc6nor" & ";" & "CC6red" & ";" & "DC6red" & ";" &
"Pc6red" & ";" & "baseurb" & ";" & "peurb"
Do While Not EOF(1)

boarap = ""
afact = ""
nfact = ""
fbaj = ""
vto = ""
serv = ""
resum = ""
retri = ""
total = ""
Inicial = Inicial + 1
nomclie = ""
clie = ""
abo100 = ""
pecla2hr = ""
pecla2hn = ""
pecla3hr = ""
pecla3hn = ""
pecla4hr = ""
pecla4hn = ""
pecla5hr = ""
pecla5hn = ""
pecla612hr = ""
pecla612hn = ""
'totba = ""
totpe = ""
bonif = ""
comin = ""
todesc = ""
bacofro = ""
pecofro = ""
Curbmul = ""
Durbmul = ""
Curbnor = ""
Durbnor = ""
Curbred = ""
Durbred = ""
Cc1mul = ""
Dc1mul = ""
Cc1nor = ""
DC1nor = ""
CC1red = ""
DC1red = ""
Cc2mul = ""
Dc2mul = ""
Pc2mul = ""
Cc2nor = ""
DC2nor = ""
Pc2nor = ""
CC2red = ""
DC2red = ""
Pc2red = ""
Cc3mul = ""
Dc3mul = ""
Pc3mul = ""
Cc3nor = ""
DC3nor = ""
Pc3nor = ""
CC3red = ""
DC3red = ""
Pc3red = ""
Cc4mul = ""
Dc4mul = ""
Pc4mul = ""
Cc4nor = ""
DC4nor = ""
Pc4nor = ""
CC4red = ""
DC4red = ""
Pc4red = ""
Cc5mul = ""
Dc5mul = ""
Pc5mul = ""
Cc5nor = ""
DC5nor = ""
Pc5nor = ""
CC5red = ""
DC5red = ""
Pc5red = ""
Cc6mul = ""
Dc6mul = ""
Pc6mul = ""
Cc6nor = ""
DC6nor = ""
Pc6nor = ""
CC6red = ""
DC6red = ""
Pc6red = ""
baseurb = ""
peurb = ""

Line Input #1, registro


linea = Mid(registro, 1, 10)
'.Caption = linea & " MACRO LISU " & Format((Inicial / Tot) * 100,
"##00.00") & "%" & " El total de Lineas a procesar es : " & Tot
.SetMousePos 4, 71
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.TransmitANSI " "

.SetMousePos 5, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForDisplayString "Nro.Linea.:", "180", 5, 2
.TransmitANSI "a"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitANSI linea
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Nro.Linea.:", "180", 5, 2
'copia el acuerdo de facturacin-----
afact = .GetDisplayText(4, 14, 10)
fbaj = .GetDisplayText(5, 71, 8)
'-------------- FIN PRIMER PANTALLA-----
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
'RRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
dEmision = .GetDisplayText(11, 9, 8)

If Trim(dEmision) <> "" Then


fEmision = CDate(dEmision)
.TransmitTerminalKey rcIBMPf3Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitANSI "4"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitANSI "l"
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForDisplayString "FCDLS2", "180", 1, 3
'----------- PANTALLA NUEVA ----------------
Salir = False
i = 0
While Not (Salir)
sFI = .GetDisplayText(10 + i, 3, 8) ' FI = Fecha Inicio
sFC = .GetDisplayText(10 + i, 13, 8) ' FC = Fecha Cancel
afact = .GetDisplayText(10 + i, 23, 10) ' Acuerdo
If (Not (IsDate(sFC))) And (IsDate(sFI)) Then
dFI = CDate(sFI)
Salir = True
ElseIf (Not (IsDate(sFC))) And (Not (IsDate(sFI))) Then
Salir = True
Else
dFI = CDate(sFI)
dFC = CDate(sFC)
sFI_siguiente = Trim(.GetDisplayText(11 + i, 3, 8))
If ((fEmision >= dFI) And (fEmision <= dFC)) Or (sFI_siguiente =
"") Then Salir = True
End If
i = i + 1
If i = 9 Then
i = 0
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
End If
Wend
.TransmitTerminalKey rcIBMPf3Key
.WaitForDisplayString "FFW120", "180", 1, 3
.TransmitANSI "1"
.TransmitTerminalKey rcIBMTabKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

.SetMousePos 4, 14
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.TransmitTerminalKey rcIBMDeleteCharKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

.TransmitANSI afact
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Nro.Linea.:", "180", 5, 2
'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
clie = .GetDisplayText(8, 13, 10)
nomclie = .GetDisplayText(9, 13, 49)

'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
.TransmitTerminalKey rcIBMPf22Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
End If
nfact = .GetDisplayText(13, 28, 13)
vto = .GetDisplayText(13, 66, 8)
'vto = .GetDisplayText(11, 66, 8)
'--------ENTRAMOS EN LA ULTIMA FACTURA-----
.TransmitTerminalKey rcIBMTabKey 'para entrar a la factura anterior
.TransmitTerminalKey rcIBMTabKey
.TransmitANSI "s"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
If GetDisplayText(4, 1, 1) = " " Then GoTo seguir
.WaitForDisplayString "Fact:", "180", 4, 1

'--------BUSCAMOS LOS VALORES FISICOS --------


.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "ESTFAC"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

'--------------------- BUSCO VALORES URBANOS --------------------

control = 1
BUSCA: If FindText("Comunicaciones Urbanas", 1, 1) Then
fila = Application.FoundTextRow
If fila >= 20 Then
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Multibanda" Then


Curbmul = .GetDisplayText(fila, 35, 10)
Durbmul = .GetDisplayText(fila, 53, 9)

Else
If .GetDisplayText(fila, 20, 10) = "Normal "
Then
fila = Application.FoundTextRow
Curbnor = .GetDisplayText(fila, 35, 10)
Durbnor = .GetDisplayText(fila, 53, 9)

Else
If .GetDisplayText(fila, 20, 10) =
"Reducida " Then
fila = Application.FoundTextRow
Curbred = .GetDisplayText(fila, 35, 10)
Durbred = .GetDisplayText(fila, 53, 9)

End If
End If
End If
Else
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

If control > 10 Then


GoTo proximo
Else
control = control + 1
End If

GoTo BUSCA
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Normal " Then


Curbnor = .GetDisplayText(fila, 35, 10)
Durbnor = .GetDisplayText(fila, 53, 9)

Else
If .GetDisplayText(fila, 20, 10) = "Reducida "
Then
fila = Application.FoundTextRow
Curbred = .GetDisplayText(fila, 35, 10)
Durbred = .GetDisplayText(fila, 53, 9)

End If
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Reducida " Then


Curbred = .GetDisplayText(fila, 35, 10)
Durbred = .GetDisplayText(fila, 53, 9)

End If

' -------------------- BUSCO VALOES CLAVE 1 ---------------------

proximo: control = 1
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "ESTFAC"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

BUSCA1: If FindText("HASTA 30 KM", 1, 1) Then


fila = Application.FoundTextRow
If fila >= 20 Then
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Multibanda" Then


Cc1mul = .GetDisplayText(fila, 35, 10)
Dc1mul = .GetDisplayText(fila, 53, 9)

Else
If .GetDisplayText(fila, 20, 10) = "Normal "
Then

Cc1nor = .GetDisplayText(fila, 35, 10)


DC1nor = .GetDisplayText(fila, 53, 9)

Else
If .GetDisplayText(fila, 20, 10) =
"Reducida " Then

CC1red = .GetDisplayText(fila, 35, 10)


DC1red = .GetDisplayText(fila, 53, 9)

End If
End If
End If
Else
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

If control > 10 Then


GoTo PROXIMO1
Else
control = control + 1
End If
GoTo BUSCA1
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

fila = "7"
Else
fila = fila + 1
End If
If .GetDisplayText(fila, 20, 10) = "Normal " Then
Cc1nor = .GetDisplayText(fila, 35, 10)
DC1nor = .GetDisplayText(fila, 53, 9)

Else
If .GetDisplayText(fila, 20, 10) = "Reducida "
Then

CC1red = .GetDisplayText(fila, 35, 10)


DC1red = .GetDisplayText(fila, 53, 9)

End If
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Reducida " Then


CC1red = .GetDisplayText(fila, 35, 10)
DC1red = .GetDisplayText(fila, 53, 9)

End If

' -------------------- BUSCO VALOES CLAVE 2 ---------------------

PROXIMO1: control = 1
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "ESTFAC"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

BUSCA2: If FindText("DE 30 A 55 KM", 1, 1) Then


fila = Application.FoundTextRow
If fila >= 20 Then
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Multibanda" Then


Cc2mul = .GetDisplayText(fila, 35, 10)
Dc2mul = .GetDisplayText(fila, 53, 9)
Pc2mul = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Normal "
Then
Cc2nor = .GetDisplayText(fila, 35, 10)
DC2nor = .GetDisplayText(fila, 53, 9)
Pc2nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) =
"Reducida " Then
CC2red = .GetDisplayText(fila, 35, 10)
DC2red = .GetDisplayText(fila, 53, 9)
Pc2red = .GetDisplayText(fila, 66, 9)
End If
End If
End If
Else
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

If control > 10 Then


GoTo PROXIMO2
Else
control = control + 1
End If

GoTo BUSCA2
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Normal " Then


Cc2nor = .GetDisplayText(fila, 35, 10)
DC2nor = .GetDisplayText(fila, 53, 9)
Pc2nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Reducida "
Then
CC2red = .GetDisplayText(fila, 35, 10)
DC2red = .GetDisplayText(fila, 53, 9)
Pc2red = .GetDisplayText(fila, 66, 9)
End If

End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If
If .GetDisplayText(fila, 20, 10) = "Reducida " Then
CC2red = .GetDisplayText(fila, 35, 10)
DC2red = .GetDisplayText(fila, 53, 9)
Pc2red = .GetDisplayText(fila, 66, 9)
End If

' -------------------- BUSCO VALOES CLAVE 3 ---------------------

PROXIMO2: control = 1
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "ESTFAC"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

BUSCA3: If FindText("DE 55 A 110 KM", 1, 1) Then


fila = Application.FoundTextRow

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Multibanda" Then


Cc3mul = .GetDisplayText(fila, 35, 10)
Dc3mul = .GetDisplayText(fila, 53, 9)
Pc3mul = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Normal "
Then
Cc3nor = .GetDisplayText(fila, 35, 10)
DC3nor = .GetDisplayText(fila, 53, 9)
Pc3nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) =
"Reducida " Then
CC3red = .GetDisplayText(fila, 35, 10)
DC3red = .GetDisplayText(fila, 53, 9)
Pc3red = .GetDisplayText(fila, 66, 9)
End If
End If
End If
Else
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If control > 10 Then
GoTo PROXIMO3
Else
control = control + 1
End If
GoTo BUSCA3
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Normal " Then


Cc3nor = .GetDisplayText(fila, 35, 10)
DC3nor = .GetDisplayText(fila, 53, 9)
Pc3nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Reducida "
Then
CC3red = .GetDisplayText(fila, 35, 10)
DC3red = .GetDisplayText(fila, 53, 9)
Pc3red = .GetDisplayText(fila, 66, 9)
End If
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Reducida " Then


CC3red = .GetDisplayText(fila, 35, 10)
DC3red = .GetDisplayText(fila, 53, 9)
End If

' -------------------- BUSCO VALOES CLAVE 4 ---------------------

PROXIMO3: control = 1
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "ESTFAC"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

BUSCA4: If FindText("DE 110 A 170 KM", 1, 1) Then


fila = Application.FoundTextRow
If fila >= 20 Then
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Multibanda" Then


Cc4mul = .GetDisplayText(fila, 35, 10)
Dc4mul = .GetDisplayText(fila, 53, 9)
Pc4mul = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Normal "
Then
Cc4nor = .GetDisplayText(fila, 35, 10)
DC4nor = .GetDisplayText(fila, 53, 9)
Pc4nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) =
"Reducida " Then
CC4red = .GetDisplayText(fila, 35, 10)
DC4red = .GetDisplayText(fila, 53, 9)
Pc4red = .GetDisplayText(fila, 66, 9)
End If
End If
End If
Else
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If control > 10 Then
GoTo PROXIMO4
Else
control = control + 1
End If

GoTo BUSCA4
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Normal " Then


Cc4nor = .GetDisplayText(fila, 35, 10)
DC4nor = .GetDisplayText(fila, 53, 9)
Pc4nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Reducida "
Then
CC4red = .GetDisplayText(fila, 35, 10)
DC4red = .GetDisplayText(fila, 53, 9)
Pc4red = .GetDisplayText(fila, 66, 9)
End If
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If
If .GetDisplayText(fila, 20, 10) = "Reducida " Then
CC4red = .GetDisplayText(fila, 35, 10)
DC4red = .GetDisplayText(fila, 53, 9)
Pc4red = .GetDisplayText(fila, 66, 9)
End If

' -------------------- BUSCO VALOES CLAVE 5 ---------------------

PROXIMO4: control = 1
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "ESTFAC"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

BUSCA5: If FindText("DE 170 A 240 KM", 1, 1) Then


fila = Application.FoundTextRow
If fila >= 20 Then
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Multibanda" Then


Cc5mul = .GetDisplayText(fila, 35, 10)
Dc5mul = .GetDisplayText(fila, 53, 9)
Pc5mul = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Normal "
Then
Cc5nor = .GetDisplayText(fila, 35, 10)
DC5nor = .GetDisplayText(fila, 53, 9)
Pc5nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) =
"Reducida " Then
CC5red = .GetDisplayText(fila, 35, 10)
DC5red = .GetDisplayText(fila, 53, 9)
Pc5red = .GetDisplayText(fila, 66, 9)
End If
End If
End If
Else
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If control > 10 Then
GoTo PROXIMO5
Else
control = control + 1
End If

GoTo BUSCA5
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Normal " Then


Cc5nor = .GetDisplayText(fila, 35, 10)
DC5nor = .GetDisplayText(fila, 53, 9)
Pc5nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Reducida "
Then
CC5red = .GetDisplayText(fila, 35, 10)
DC5red = .GetDisplayText(fila, 53, 9)
Pc5red = .GetDisplayText(fila, 66, 9)
End If
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Reducida " Then


CC5red = .GetDisplayText(fila, 35, 10)
DC5red = .GetDisplayText(fila, 53, 9)
Pc5red = .GetDisplayText(fila, 66, 9)
End If

' -------------------- BUSCO VALOES CLAVE 6 A 12 ---------------------

PROXIMO5: control = 1
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "ESTFAC"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

BUSCA6: If FindText("MAS DE 240 KM", 1, 1) Then


fila = Application.FoundTextRow
If fila >= 20 Then
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Multibanda" Then


Cc6mul = .GetDisplayText(fila, 35, 10)
Dc6mul = .GetDisplayText(fila, 53, 9)
Pc6mul = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Normal "
Then
Cc6nor = .GetDisplayText(fila, 35, 10)
DC6nor = .GetDisplayText(fila, 53, 9)
Pc6nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) =
"Reducida " Then
CC6red = .GetDisplayText(fila, 35, 10)
DC6red = .GetDisplayText(fila, 53, 9)
Pc6red = .GetDisplayText(fila, 66, 9)
End If
End If
End If
Else
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If control > 10 Then
GoTo PROXIMO6
Else
control = control + 1
End If

GoTo BUSCA6
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Normal " Then


Cc6nor = .GetDisplayText(fila, 35, 10)
DC6nor = .GetDisplayText(fila, 53, 9)
Pc6nor = .GetDisplayText(fila, 66, 9)
Else
If .GetDisplayText(fila, 20, 10) = "Reducida "
Then
CC6red = .GetDisplayText(fila, 35, 10)
DC6red = .GetDisplayText(fila, 53, 9)
Pc6red = .GetDisplayText(fila, 66, 9)
End If
End If

If fila >= 20 Then


.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
fila = "7"
Else
fila = fila + 1
End If

If .GetDisplayText(fila, 20, 10) = "Reducida " Then


CC6red = .GetDisplayText(fila, 35, 10)
DC6red = .GetDisplayText(fila, 53, 9)
Pc6red = .GetDisplayText(fila, 66, 9)
End If

'----CON ESTO ME TRAIGO TODO A UNA PANTALLA----


'---- UTILIZO SECCIONES (RESUM)---
PROXIMO6: .SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "resum"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

'--------- Buscar Total ----


found = FindText("Servicios Telecom", 1, 1)
If found Then
fila = Application.FoundTextRow
total = .GetDisplayText(fila, 64, 12)
End If
'-----------------------------------
'------- entrar en tottel------
.TransmitTerminalKey rcIBMTabKey
.WaitForDisplayString "Seccion.", "180", 5, 11
.TransmitANSI "tottel"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
'############################################
'HHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHHH
'------- Buscar clave2hr -----
found = FindText("Clave 2 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla2hr = .GetDisplayText(fila, 66, 9)
End If
'--------- Buscar clave2hn ----
found = FindText("Clave 2 Horario Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla2hn = .GetDisplayText(fila, 66, 9)
End If

'-------- Buscar Clave3hr---------------


found = FindText("Clave 3 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla3hr = .GetDisplayText(fila, 66, 9)
End If

'--------buscar clave3hn----------------
found = FindText("Clave 3 Horario Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla3hn = .GetDisplayText(fila, 66, 9)
End If
'-------- buscar clave4hr ----------------
found = FindText("Clave 4 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla4hr = .GetDisplayText(fila, 66, 9)

End If

'-------- buscar clave4hn ----------------


found = FindText("Clave 4 Horario Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla4hn = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave5hr ---------
found = FindText("Clave 5 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla5hr = .GetDisplayText(fila, 66, 9)
End If

'--------buscar clave5hn ---------


found = FindText("Clave 5 Horario Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla5hn = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave612hn ---------
found = FindText("Clave 6 a 12 H. Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla612hn = .GetDisplayText(fila, 66, 9)
End If
'--------buscar clave612hr ---------
found = FindText("Clave 6 a 12 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla612hr = .GetDisplayText(fila, 66, 9)
End If
'--------buscar cosumos fronterizos ---------
found = FindText("Consumos front/reg", 1, 1)
If found Then
fila = Application.FoundTextRow
bacofro = .GetDisplayText(fila, 44, 10)
pecofro = .GetDisplayText(fila, 66, 9)
End If
'-------------- busca consumos urbanos --------------
found = FindText("Consumos Urb.+Clave 1 75%", 1, 1)
If found Then
fila = Application.FoundTextRow
baseurb = .GetDisplayText(fila, 44, 10)
peurb = .GetDisplayText(fila, 66, 9)
End If

'############################################################
'-----------fin de busqueda 1er pantalla e inicio de 2da-----
'############################################################
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'--------buscar clave612hn ---------
If bacla612hn = "" Then
found = FindText("Clave 6 a 12 H. Normal", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla612hn = .GetDisplayText(fila, 66, 9)
End If
End If
'_____________________________________________
If bacla612hr = "" Then
'--------buscar clave612hr ---------
found = FindText("Clave 6 a 12 H. Reducido", 1, 1)
If found Then
fila = Application.FoundTextRow
pecla612hr = .GetDisplayText(fila, 66, 9)
End If
End If
'-------- busca consumos urbanos ---------

found = FindText("Consumos Urb.+Clave 1 75%", 1, 1)


If found Then
fila = Application.FoundTextRow
baseurb = .GetDisplayText(fila, 44, 10)
peurb = .GetDisplayText(fila, 66, 9)
End If

'--------buscar consumos fronterizos ---------


found = FindText("Consumos front/reg", 1, 1)
If found Then
fila = Application.FoundTextRow
bacofro = .GetDisplayText(fila, 44, 10)
pecofro = .GetDisplayText(fila, 66, 9)
End If
'###############################################
'sacar descuentos y promociones
'###############################################
.SetMousePos 5, 20
.TerminalMouse rcLeftClick, rcMouseRow, rcMouseCol
.GraphicsMouse rcLeftClick, rcCurrentGraphicsCursorX,
rcCurrentGraphicsCursorY
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "Seccion.", "30", 5, 11
.TransmitANSI "descue"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
'-----------------------------------------------
' - Primer pantalla -
'-----------------------------------------------
' saca abono 100%
If abo100 = "" Then
found = FindText("Dto. esp. acciones promocionales", 1, 1)
If found Then
fila = Application.FoundTextRow
abo100 = .GetDisplayText(fila, 64, 12)
End If
End If
If boarap = "" Then
found = FindText("Bonificacion Acceso Rapido", 1, 1)
If found Then
fila = Application.FoundTextRow
boarap = .GetDisplayText(fila, 64, 12)
End If
End If

' saca valor de bonificacion en el total de descuentos


If bonif = "" Then
found = FindText("Bonif.", 1, 1)
If found Then
fila = Application.FoundTextRow
bonif = .GetDisplayText(fila, 64, 12)
End If
End If
If todesc = "" Then
found = FindText("TOTAL DE DESCUENTOS Y PROMOCIONES", 1, 1)
If found Then
fila = Application.FoundTextRow
todesc = .GetDisplayText(fila, 64, 12)

End If
End If
.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If todesc = "" Then
found = FindText("TOTAL DE DESCUENTOS Y PROMOCIONES", 1, 1)
If found Then
fila = Application.FoundTextRow
todesc = .GetDisplayText(fila, 64, 12)

End If
End If
.TransmitTerminalKey rcIBMPf7Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

'###############################################
'sacar total consumos internacionales
'###############################################
' - Primer busqueda -
If comin = "" Then
found = FindText("TOTAL DE COMUNIC. INTERNACIONALES", 1, 1)
If found Then
fila = Application.FoundTextRow
comin = .GetDisplayText(fila, 64, 12)
End If
End If
'------- retrocede------------------------------
.TransmitTerminalKey rcIBMPf7Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
If comin = "" Then
found = FindText("TOTAL DE COMUNIC. INTERNACIONALES", 1, 1)
If found Then
fila = Application.FoundTextRow
comin = .GetDisplayText(fila, 64, 12)

End If
End If

'FINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFINFIN
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1
seguir:
.TransmitTerminalKey rcIBMPf12Key
.WaitForEvent rcKbdEnabled, "180", "0", 1, 1

linea = Trim$(linea)
afact = Trim$(afact)
nfact = Trim$(nfact)
fbaj = Trim$(fbaj)
vto = Trim$(vto)
total = Trim$(total)
nomclie = Trim$(nomclie)
clie = Trim$(clie)
abo100 = Trim$(abo100)
boarap = Trim$(boarap)
pecla2hr = Trim$(pecla2hr)
pecla2hn = Trim$(pecla2hn)
pecla3hr = Trim$(pecla3hr)
pecla3hn = Trim$(pecla3hn)
pecla4hr = Trim$(pecla4hr)
pecla4hn = Trim$(pecla4hn)
pecla5hr = Trim$(pecla5hr)
pecla5hn = Trim$(pecla5hn)
pecla612hr = Trim$(pecla612hr)
pecla612hn = Trim$(pecla612hn)
bonif = Trim$(bonif)
comin = Trim$(comin)
todesc = Trim$(todesc)
bacofro = Trim$(bacofro)
pecofro = Trim$(pecofro)
Curbmul = Trim$(Curbmul)
Durbmul = Format(Trim$(Durbmul), "00" & hhmm)
Curbnor = Trim$(Curbnor)
hb = Format((Trim$(Durbnor)), hhmmss)
Curbred = Trim$(Curbred)
Durbred = Trim$(Durbred)
Cc1mul = Trim$(Cc1mul)
Dc1mul = Trim$(Dc1mul)
Cc1nor = Trim$(Cc1nor)
DC1nor = Trim$(DC1nor)
CC1red = Trim$(CC1red)
DC1red = Trim$(DC1red)
Cc2mul = Trim$(Cc2mul)
Dc2mul = Trim$(Dc2mul)
Pc2mul = Trim$(Pc2mul)
Cc2nor = Trim$(Cc2nor)
DC2nor = Trim$(DC2nor)
Pc2nor = Trim$(Pc2nor)
CC2red = Trim$(CC2red)
DC2red = Trim$(DC2red)
Pc2red = Trim$(Pc2red)
Cc3mul = Trim$(Cc3mul)
Dc3mul = Trim$(Dc3mul)
Pc3mul = Trim$(Pc3mul)
Cc3nor = Trim$(Cc3nor)
DC3nor = Trim$(DC3nor)
Pc3nor = Trim$(Pc3nor)
CC3red = Trim$(CC3red)
DC3red = Trim$(DC3red)
Pc3red = Trim$(Pc3red)
Cc4mul = Trim$(Cc4mul)
Dc4mul = Trim$(Dc4mul)
Pc4mul = Trim$(Pc4mul)
Cc4nor = Trim$(Cc4nor)
DC4nor = Trim$(DC4nor)
Pc4nor = Trim$(Pc4nor)
CC4red = Trim$(CC4red)
DC4red = Trim$(DC4red)
Pc4red = Trim$(Pc4red)
Cc5mul = Trim$(Cc5mul)
Dc5mul = Trim$(Dc5mul)
Pc5mul = Trim$(Pc5mul)
Cc5nor = Trim$(Cc5nor)
DC5nor = Trim$(DC5nor)
Pc5nor = Trim$(Pc5nor)
CC5red = Trim$(CC5red)
DC5red = Trim$(DC5red)
Pc5red = Trim$(Pc5red)
Cc6mul = Trim$(Cc6mul)
Dc6mul = Trim$(Dc6mul)
Pc6mul = Trim$(Pc6mul)
Cc6nor = Trim$(Cc6nor)
DC6nor = Trim$(DC6nor)
Pc6nor = Trim$(Pc6nor)
CC6red = Trim$(CC6red)
DC6red = Trim$(DC6red)
Pc6red = Trim$(Pc6red)
baseurb = Trim$(baseurb)
peurb = Trim$(peurb)

'totba = Val(Replace(bacla2hn, ",", ".")) + Val(Replace(bacla2hr, ",",


".")) + Val(Replace(bacla3hn, ",", ".")) + Val(Replace(bacla3hr, ",", ".")) +
Val(Replace(bacla4hn, ",", ".")) + Val(Replace(bacla4hr, ",", ".")) +
Val(Replace(bacla5hn, ",", ".")) + Val(Replace(bacla5hr, ",", ".")) +
Val(Replace(bacla612hn, ",", ".")) + Val(Replace(bacla612hr, ",", "."))
totpe = Val(Replace(pecla2hn, ",", ".")) + Val(Replace(pecla2hr, ",",
".")) + Val(Replace(pecla3hn, ",", ".")) + Val(Replace(pecla3hr, ",", ".")) +
Val(Replace(pecla4hn, ",", ".")) + Val(Replace(pecla4hr, ",", ".")) +
Val(Replace(pecla5hn, ",", ".")) + Val(Replace(pecla5hr, ",", ".")) +
Val(Replace(pecla612hn, ",", ".")) + Val(Replace(pecla612hr, ",", "."))

Print #2, linea & ";" & nomclie & ";" & afact & ";" & nfact & ";" & fbaj & ";" &
vto & ";" & total & ";" & clie & ";" & abo100 & ";" & boarap & ";" & pecla2hr & ";"
& pecla2hn & ";" & pecla3hr & ";" & pecla3hn & ";" & pecla4hr & ";" & pecla4hn &
";" & pecla5hr & ";" & pecla5hn & ";" & pecla612hr & ";" & pecla612hn & ";" & totpe
& ";" & bonif & ";" & comin & ";" & todesc & ";" & bacofro & ";" & pecofro & ";" &
Curbmul & ";" & Durbmul & ";" & Curbnor & ";" & Durbnor & ";" & Curbred & ";" &
Durbred & ";" & Cc1mul & ";" & Dc1mul & ";" & Cc1nor & ";" & DC1nor & ";" & CC1red
& ";" & DC1red & ";" & Cc2mul & ";" & Dc2mul & ";" & Pc2mul & ";" & Cc2nor & ";" &
DC2nor & ";" & Pc2nor & ";" & CC2red & ";" & DC2red & ";" & Pc2red & ";" & Cc3mul &
";" & Dc3mul & ";" & Pc3mul & ";" & Cc3nor & ";" & DC3nor & ";" & Pc3nor & ";" &
CC3red & ";" & DC3red & ";" & Pc3red & ";" & Cc4mul & ";" & Dc4mul & ";" & Pc4mul &
";" & Cc4nor & ";" & DC4nor _
& ";" & Pc4nor & ";" & CC4red & ";" & DC4red & ";" & Pc4red & ";" & Cc5mul & ";" &
Dc5mul & ";" & Pc5mul & ";" & Cc5nor & ";" & DC5nor & ";" & Pc5nor & ";" & CC5red &
";" & DC5red & ";" & Pc5red & ";" & Cc6mul & ";" & Dc6mul & ";" & Pc6mul & ";" &
Cc6nor & ";" & DC6nor & ";" & Pc6nor & ";" & CC6red & ";" & DC6red & ";" & Pc6red &
";" & baseurb & ";" & peurb

Loop
Close
'Call logPrint("### TERMINO Proceso de Importacin de List LISU ###",
Get_INI("LISU", "pathlog"))

.TransmitTerminalKey rcIBMPf3Key
.TransmitTerminalKey rcIBMPf3Key
.TransmitTerminalKey rcIBMPf3Key

Dim X
X = MsgBox("FIN DE LA MACRO", vbOKOnly)

End With
End Sub

Sub Prefacturacion()
'
' Generated by the Reflection Macro Recorder on 02-06-2004 10:04:41.23
' Generated by Reflection for IBM for Windows 8.00
'
With Session

linea = InputBox("Ingrese Numero")

pathou = "d:\temp\" & linea & "_prefacturacion.txt"


Open pathou For Output As 2
.WaitForEvent rcEnterPos, "30", "0", 4, 10
.WaitForDisplayString "Opcion", "30", 4, 2
.TransmitANSI "6"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 6, 13
.WaitForDisplayString "Opcion....", "30", 6, 2
.TransmitANSI "1"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 7, 13
.WaitForDisplayString "Accion....", "30", 7, 2
.TransmitANSI "c"
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForDisplayString "A", "30", 4, 13
.TransmitANSI linea
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 4, 13
.WaitForDisplayString "Nro.linea.", "30", 4, 2
.TransmitTerminalKey rcIBMEnterKey
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1
.WaitForEvent rcEnterPos, "30", "0", 8, 2

Do Until .GetDisplayText(20, 2, 1) = " "


.SetSelectionStartPos 8, 5 'Fila y columna de inicio
.ExtendSelectionRect 20, 77 'Fila y columna fin
.CopySelection
Print #2, .GetClipboardText

.TransmitTerminalKey rcIBMPf8Key
.WaitForEvent rcKbdEnabled, "30", "0", 1, 1

Loop

.SetSelectionStartPos 8, 5 'Fila y columna de inicio


.ExtendSelectionRect 20, 77 'Fila y columna fin
.CopySelection
Print #2, .GetClipboardText
Close 2
End With
End Sub

You might also like