Menú

Mostrar Mensajes

Esta sección te permite ver todos los mensajes escritos por este usuario. Ten en cuenta que sólo puedes ver los mensajes escritos en zonas a las que tienes acceso en este momento.

Mostrar Mensajes Menú

Mensajes - corlo

#51
Hola soy Corlo
muchas gracias Nebire por tu codigo me ha servido de mucha ayuda, muchisimas gracias.
#52
Hola soy Corlo
Gracias por responder Nebire
lo del control numerico scroll, no lo entiendo,
el objeto en poner al formulario es vscroll1 o hscroll1
me podrias poner en un ejemplo con codigo
gracias
#53
Hola soy Corlo
necesito una ayuda para el siguiente tema
La cuestion es que el siguiente programa que he hecho funciona correctamente, pero el problema que hay es que cuando pasa un dia entero que cambie el contador de n=1 en la caja de texto text1.text y que vaya sumando el contador correlativamente
dejo el codigo




Option Explicit
Dim n As Integer



Private Sub Command1_Click()
'Nuevo
Open App.Path & "\database.txt" For Random As 1 Len = Len(file)


n = LOF(1) / Len(file)

Get #1, n, file
Text1.Text = n + 1
Close #1

Text2.Text = Format(date, "dd/mm/yyyy")
Text3.Text = ""
Text3.SetFocus
End Sub

Private Sub Command2_Click()
'Guardar
file.id = Text1.Text
file.date = Text2.Text
file.name = Text3.Text

Open App.Path & "\database.txt" For Random As 1 Len = Len(file)

n = LOF(1) / Len(file)
Put #1, n + 1, file
Close #1
End Sub

Private Sub Command3_Click()
End
End Sub

Private Sub Command4_Click()
Unload Me
Form2.Show
End Sub

Private Sub Form_Load()
Open App.Path & "\database.txt" For Random As 1 Len = Len(file)

n = LOF(1) / Len(file)

Get #1, n, file
Text1.Text = n + 1

Close #1

Text2.Text = Format(date, "dd/mm/yyyy")
End Sub









y en un modulo





Type Task
id As Integer
date As Date
name As String * 30
End Type


Option Explicit
Global file As Task









Gracias



#54
Programación Visual Basic / como hacer un pdf
12 Marzo 2019, 23:07 PM
hola soy corlo
quisiera hacer un pdf del siguiente codigo




en un modulo:


Type Task
id As Integer
date As Date
name As String * 30
End Type


Option Explicit
Global file As Task



en el formulario






Private f_Canal     As Integer     ' canal del fichero.

Private Sub List1_Click()
    Call BuscarItems(lisFechas.List(lisFechas.ListIndex))
End Sub

' Qué buscamos?: El dato (fecha), que se ha pulsado en list1...
'  y lo buscamos en todos los registros del fichero.
Private Sub BuscarItems(ByVal strFecha As String)
    Dim item As String

    List2.Clear
    Open App.Path & "\database.txt" For Random As f_canal Len = Len(file)

    Seek (f_Canal), 1     ' posicionar el puntero de lectura al comienzo del fichero (en vb6 es la dirección 1).
    Do While Not EOF(f_Canal)
        Get f_Canal, , file
        With file
            If (StrComp(strFecha, CStr(.Date), vbTextCompare) = 0) Then
                item = FormatStr(CStr(.Id), 6, True)
                item = FormatStr(item, 12) & _
                       FormatStr(CStr(.Date), 16) & _
                       FormatStr(.Name, 44)
                Call List2.AddItem(item)  ' list2, probablemente no precise estar ordenado...
            End If
        End With
    Loop

Close #f_canal
End Sub








gracias



#55
hola soy corlo

gracias por la  informacion
#56
hola soy corlo
tengo un pequeño problema a la hora de pasar informacion de un archivo de texto de list1, y que vaya leyendo cada dia en list2.
en list1 hay lo siguiente:
list1
11/12/2018
12/12/2018
13/12/2018
en el list2 hay losiguiente:

en el dia 11/12/2018

1       11/12/2018                a
1       11/12/2018                b
1       11/12/2018                c
4       11/12/2018                d
5       11/12/2018                e

en dia 12/12/2018

5       12/12/2018                f
7       12/12/2018                g
8       12/12/2018                h
9       12/12/2018                i

en dia 13/12/2018

10      13/12/2018               o
11      13/12/2018               p
12      13/12/2018               s



Option Explicit
Dim n As Integer
Dim c As Integer


Private Sub Command1_Click()
Unload Me
Form1.Show
End Sub


Private Sub Form_Load()
List1.Clear
Open App.Path & "\database.txt" For Random As 1 Len = Len(file)
n = LOF(1) / Len(file)
c = 1
For c = 1 To n


Get #1, , file

List1.AddItem file.date
QuitaDup
Next
Close #1
End Sub
Private Sub QuitaDup()
  Dim i As Long, X As Long
  X = List1.ListCount - 1
  For i = 0 To List1.ListCount - 2
    If List1.List(i) = List1.List(X) Then
     
      List1.RemoveItem X
     
      Exit For
    End If
  Next i
End Sub

Private Sub List1_Click()
Dim i As Integer
Dim ind As Integer
List2.Clear
Form1.Text1.Text = file.id
Form1.Text2.Text = file.date
Form1.Text3.Text = file.name
ind = List1.ListIndex
Open App.Path & "\database.txt" For Random As 1 Len = Len(file)
n = LOF(1) / Len(file)
For i = 0 To List1.ListCount + 1
If ind <= 0 Then
Get #1, i + 1, file

List2.AddItem file.id & "         " & file.date & "          " & file.name
End If
Next
Close #1
End Sub






y en list2 solamente me lee el primer dia
que la rutina es en list1_click
y quisiera que me lea el primer dia el segundo dia y el tercer dia.
gracias.

#57
Hola soy Corlo

Gracias por responder XresH

Me podrias poner un ejemplo de lo que explicas con codigo , por que soy novato en tema de programacion, gracias
#58
Hola soy Corlo

hola quisiera pasar el codigo archivo secuencial de texto a archivo for random aleatorio
el codigo que tengo es este



Dim i As Integer
mes = Text8.Text
fecha = Text1.Text
nombre = Text2.Text
apellido = Text3.Text
producto = Text4.Text
cantidad = Text5.Text
precio = Text6.Text
total = Val(Text5.Text) * Val(Text6.Text)
Text7.Text = Val(Text5.Text) * Val(Text6.Text)
archivo = App.Path & "\ventas.txt"
Open archivo For Append As #1
Write #1, mes, fecha, nombre, apellido, producto, cantidad, precio, total
For i = 0 To List1.ListCount - 1

        Print #1, List1.List(i)
        Next i
Close #1




Gracias
#59
Hola soy corlo

gracias por responder shell root

osea mas o menos seria asi el codigo




dim d as integer
dim sum as integer
dim gh as string
gh = App.Path & "\facturas" & "\" & Prefix_Facturas & Text3.Text & ".TXT"
        Open gh For Random As #1 Len = Len(datos)
        Get #1, (List1.ListIndex + 1), datos
        Text7.Text = datos.producto
        Text8.Text = datos.precio
        Text9.Text = datos.existencias
        Text10.Text = datos.subtotal
       

for d = 1 to list1.listcount-1
sum = sum + cint(datos.subtotal)
next d

text11.text = sum

Close #1





#60
hola soy corlo

necesito sumar la variable datos.subtotal del list1

ahora no hace la suma, por eso os pregunto ¿como puedo hacer la suma de la variable
datos.subtotal




dim gh as string
gh = App.Path & "\facturas" & "\" & Prefix_Facturas & Text3.Text & ".TXT"
        Open gh For Random As #1 Len = Len(datos)
        Get #1, (List1.ListIndex + 1), datos
        Text7.Text = datos.producto
        Text8.Text = datos.precio
        Text9.Text = datos.existencias
        Text10.Text =[b] datos.subtotal[/b]

        Close #1