-
Notifications
You must be signed in to change notification settings - Fork 1
/
AmenaFrm.frm
98 lines (97 loc) · 2.6 KB
/
AmenaFrm.frm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
VERSION 5.00
Begin VB.Form AmenaFrm
BorderStyle = 1 'Fixed Single
Caption = "Amena Recarga"
ClientHeight = 3135
ClientLeft = 3810
ClientTop = 3390
ClientWidth = 4740
Icon = "AmenaFrm.frx":0000
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
Picture = "AmenaFrm.frx":030A
ScaleHeight = 3135
ScaleWidth = 4740
Begin VB.CommandButton Command1
Caption = "Generar código"
Height = 375
Left = 240
TabIndex = 0
Top = 2400
Width = 1335
End
Begin VB.Label Label1
BackColor = &H00F3F3F3&
Caption = "0000000000000000"
BeginProperty Font
Name = "MS Sans Serif"
Size = 12
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 255
Left = 1680
TabIndex = 1
Top = 2400
Width = 2895
End
End
Attribute VB_Name = "AmenaFrm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim f As Integer
Dim txt As String
Dim num As String
Private Sub Command1_Click()
inicio:
f = FreeFile
num = ""
While Len(num) < 16
num = num & Left(Int(Rnd * 100), 1)
Wend
On Error GoTo error
Open "c:\no.txt" For Input As f
Do Until EOF(f)
Line Input #f, txt
If txt = num Then GoTo inicio
Loop
Close
Label1.Caption = Left(num, 16)
Open "C:\no.txt" For Append As f
Print #f, num
Close
error:
Select Case Err.Number
Case 53
f = FreeFile
Open "C:\no.txt" For Append As f
Print #f, "0000000000000000"
Close
GoTo inicio
End Select
End Sub
Private Sub Form_DblClick()
If Command1.Visible = False And Label1.Visible = False And Me.Picture = AmenaAtras.Picture Then
Command1.Visible = True
Label1.Visible = True
Me.Picture = normal.Picture
ElseIf Command1.Visible = True And Label1.Visible = True And Me.Picture = AmenaFrm.Picture Then
Me.Picture = AmenaAtras.Picture
Command1.Visible = False
Label1.Visible = False
End If
End Sub
Private Sub Form_Load()
Label1.Caption = ""
Me.Caption = "Amena Recarga " & App.Major & "." & App.Minor & "." & App.Revision
End Sub
Private Sub Form_Terminate()
Close f
End Sub