1
Visual Basic 6 / Re:programa loteria
« en: Junio 21, 2024, 07:57:41 am »
solo una aclaracion en el text2.text se introduce el numero de apuestas que quieres jugar por ejemplo 20 apuestas
gracias
gracias
Esta sección te permite ver todos los posts escritos por este usuario. Ten en cuenta que sólo puedes ver los posts escritos en zonas a las que tienes acceso en este momento.
Dim F_check1, F_check2, F_check3, F_check4, F_check5, F_check6 As Integer
cd1.InitDir = App.Path & "\fichero estudiante\"
cd1.ShowOpen
Open cd1.FileName For Input As #1
Do While EOF(1) <> -1
Input #1, mat, nom, postnom, F_check1, F_check2, F_check3, F_check4, sexe, F_check5, F_check6, price, datenaiss, adresse
Text1 = mat
Text2 = nom
Text3 = postnom
Text4 = datenaiss
Text5 = adresse
If CBool(F_check1) = True Then
Option1(0).Value = True
End If
If CBool(F_check2) = True Then
Option1(1).Value = True
End If
If CBool(F_check3) = True Then
Option1(2).Value = True
End If
If CBool(F_check4) = True Then
Option1(3).Value = True
End If
'If Option1(index).value = True Then
' Option1(0).Caption = F_check1
' Text6.Text = sexe
'Else
' Option1(1).Caption = F_check2
' Text6.Text = sexe
'End If
Text6.Text = sexe
If CBool(F_check5) = True Then
Option2(0).Value = True
Else
Option2(1).Value = True
End If
'If Option2(index).value = True Then
' Option2(0).Caption = F_check3
'Else
' Option2(1).Caption = F_check4
'End If
Text7.Text = price
Loop
Close #1
Public Sub limpiar()
Text1 = ""
Text2 = ""
Text3 = ""
Text4 = ""
Text5 = ""
Text1.SetFocus
End Sub
Private Sub Command1_Click()
Dim mat As String * 7
Dim nom As String * 30
Dim postnom As String * 30
Dim sexe As String * 10
Dim price As String * 10
Dim datenaiss As String * 10
Dim adresse As String * 40
mat = Text1
nom = Text2
postnom = Text3
datenaiss = Text4
adresse = Text5
sexe = Text6.Text
price = Text7.Text
Open App.Path & "\fichero estudiante\" & (nom + ".txt") For Output As #1
Write #1, mat, nom, postnom, Option1(0).Value, Option1(1).Value, sexe, Option2(0).Value, Option2(1).Value, price, datenaiss, adresse
Close #1
MsgBox "Guardado exitosamente !", vbInformation, "Gestion Estudiante"
limpiar
End Sub
Private Sub Command2_Click()
limpiar
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Command5_Click()
Dim F_check1, F_check2, F_check3, F_check4 As Integer
cd1.InitDir = App.Path & "\fichero estudiante\"
cd1.ShowOpen
Open cd1.FileName For Input As #1
Do While EOF(1) <> -1
Input #1, mat, nom, postnom, F_check1, F_check2, sexe, F_check3, F_check4, price, datenaiss, adresse
Text1 = mat
Text2 = nom
Text3 = postnom
Text4 = datenaiss
Text5 = adresse
If Option1(Index).Value = True Then
Option1(0).Caption = F_check1
Text6.Text = sexe
Else
Option1(1).Caption = F_check2
Text6.Text = sexe
End If
Text6.Text = sexe
If Option2(Index).Value = True Then
Option2(0).Caption = F_check3
Else
Option2(1).Caption = F_check4
End If
Text7.Text = price
Loop
Close #1
End Sub
Private Sub Option1_Click(Index As Integer)
Select Case Index
Case 0: Text6.Text = Label7.Caption
Case 1: Text6.Text = Label8.Caption
End Select
End Sub
Private Sub Option2_Click(Index As Integer)
Select Case Index
Case 0: Text7.Text = Label9.Caption
Case 1: Text7.Text = Label10.Caption
End Select
End Sub
Type Registro
IdDato As Integer
rTitulo As String * 25
End Type
datos as registro
Open "c:programacategorias.cat" For Random As #1 Len = Len(Datos)
for x = 0 to list1.listcount -1
put #1,x, Datos
next
Close #1
Open "c:programacategorias.cat" For Random As #1 Len = Len(Datos)
Get #1, List1.ListIndex + 1, Datos
Close #1
MsgBox Datos.rTitulo
' Añade un registro al fichero (y listado).
Private Sub Add(ByRef Registro As RegArticulosAlmacen)
Put #Canal, PtrToReg(NumRegs), Registro
NumRegs = (NumRegs + 1)
Put #Canal, 1, NumRegs ' y lo actualiza en fichero.
Put #Canal, , AutoIncArticuloAlmacen
Call List1.AddItem(RegArticuloToString(Registro))
List1.ItemData(NumRegs - 1) = Registro.IdArticulo
Call ActivarInterfaz
Call ForzarLecturaArticulos
End Sub
Private Sub leerindice()
Dim tk As Task
Dim Ix As Long
Close #Canal
Canal = FreeFile
'Dim tk As Task
LenRegTask = Len(tk)
Ruta = App.Path & "\database.txt"
Call AbriBaseDatos
Numregs = (FileLen(Ruta) \ LenRegTask)
Numregs = Numregs + 1
Get #Canal, Numregs, tk
frmRegistro.LabId.Caption = Numregs
End Sub
no se como pasar la variable numregs con el tk.id
lo de subir un archivo al foro no se como hacerlo, gracias