0% found this document useful (0 votes)
46 views2 pages

Flames Code

This Visual Basic code takes two names provided in text boxes, removes matching letters, calculates the combined length of the remaining letters, and determines a "flames" relationship status based on the length. It removes duplicate letters between the two names in a nested loop, calculates the total length of the remaining letters, then maps that length to a predetermined flames label like "friend", "love", or "enemy" which is displayed in a message box.

Uploaded by

karthik289
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
46 views2 pages

Flames Code

This Visual Basic code takes two names provided in text boxes, removes matching letters, calculates the combined length of the remaining letters, and determines a "flames" relationship status based on the length. It removes duplicate letters between the two names in a nested loop, calculates the total length of the remaining letters, then maps that length to a predetermined flames label like "friend", "love", or "enemy" which is displayed in a message box.

Uploaded by

karthik289
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

Public Sub flamescode()

Dim i, j As Integer
Dim name1 As String
Dim name2 As String
Dim noname1, noname2 As Integer
name1 = name1TextBox.Text
name2 = name2TextBox.Text
noname1 = name1.Length
noname2 = name2.Length
For i = 0 To noname1 - 1
For j = 0 To noname2 - 1
If name1(i) = name2(j) Then
name1 = name1.Remove(i, 1)
name2 = name2.Remove(j, 1)
GoTo step1
End If
Next
Next
step1:
For i = 0 To name1.Length - 1
For j = 0 To name2.Length - 1
If name1(i) = name2(j) Then
name1 = name1.Remove(i, 1)
name2 = name2.Remove(j, 1)
GoTo step1
End If
Next
Next
Dim flamesno As Integer
flamesno = name1.Length + name2.Length
'MsgBox(flamesno)
Dim flames As String = ""
If flamesno = 1 Then
flames = "S"
ElseIf flamesno = 2 Then
flames = "enemy"
ElseIf flamesno = 3 Then
flames = "friend"
ElseIf flamesno = 4 Then
flames = "enemy"
ElseIf flamesno = 5 Then
flames = "friend"
ElseIf flamesno = 6 Then
flames = "marriage"
ElseIf flamesno = 7 Then
flames = "enemy"
ElseIf flamesno = 8 Then
flames = "affection"
ElseIf flamesno = 9 Then
flames = "enemy"
ElseIf flamesno = 10 Then
flames = "love"
ElseIf flamesno = 11 Then
flames = "marriage"
ElseIf flamesno = 12 Then
flames = "affection"
ElseIf flamesno = 13 Then
flames = "afection"
ElseIf flamesno = 14 Then
flames = "friend"
ElseIf flamesno = 15 Then
flames = "marriage"
ElseIf flamesno = 16 Then
flames = "friend"
ElseIf flamesno = 17 Then
flames = "marriage"
ElseIf flamesno = 18 Then
flames = "friend"
ElseIf flamesno = 19 Then
flames = "love"
ElseIf flamesno = 20 Then
flames = "enemy"
ElseIf flamesno = 0 Then
flames = "r u mad"

End If
'MsgBox(flames)
result.Text = flames
Beep()

End Sub

You might also like