CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #1
    Join Date
    Feb 2011
    Posts
    4

    Unhappy help on making a save code

    (I posted what my form looks like)
    I'm having slight problems making my save code generator, which you enter your information into it, and it generates the save code for a game, but there are problems with some of the lines, which i have bolded

    Dim fa As Single
    Dim fb As Single
    Dim fc As Single
    Dim fd As Single
    Dim levelno As Single
    Dim clno As Single
    Dim colour As Single
    Dim skno As Single
    Dim skilllevel As Single
    Dim levelno2 As Single
    Dim unlocked As Single
    Dim nameleng As Single
    Dim username = TextBox1
    Dim savecode As Single
    Dim roundno As Single
    Dim clskno As Single


    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    If CheckBox1.Checked = True Then
    fa = "Done"
    End If
    If CheckBox2.Checked = True Then
    fb = "Done"
    End If
    If CheckBox3.Checked = True Then
    fc = "Done"
    End If
    If CheckBox4.Checked = True Then
    fd = "Done"
    End If
    If fa = "Done" Then
    levelno = 0
    End If
    If fb = "Done" Then
    levelno = levelno + 2
    End If
    If fc = "Done" Then
    levelno = levelno + 4
    End If
    If fd = "Done" Then
    levelno = levelno + 8
    End If
    If colour = "Yellow" Then
    clno = 0
    End If
    If colour = "Orange" Then
    clno = 1
    End If
    If colour = "White" Then
    clno = 2
    End If
    If colour = "Blue" Then
    clno = 3
    End If
    If colour = "Green" Then
    clno = 4
    End If
    If colour = "Turquoise" Then
    clno = 5
    End If
    If (skilllevel = "Normal") Then
    skno = 0
    End If
    If (skilllevel = "Pro") Then
    skno = 1
    End If
    If (skilllevel = "Easy") Then
    skno = 2
    End If
    levelno2 = Chr(levelno + unlocked * 15 + 33)
    If levelno2 = "0" Then
    levelno2 = "z"
    End If
    nameleng = Chr(Number(username.length) + 8 * Rnd(3) + 65)
    levelno = Chr(levelno + 65)
    roundno = Chr(unlocked + 7 * Random(3) + 65)
    clskno = Chr(Number(skno) * 6 + (Number(clno) + 65))
    savecode = (username + "." + levelno2 + levelno + roundno + clskno + nameleng)
    Label8.Visible = True
    TextBox2.Visible = True
    If TextBox1.TextLength < 9 Then
    TextBox2.Text = savecode
    End If
    End Sub

    Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged
    If ComboBox1.Text = "Orange" Then
    colour = "Orange"
    End If
    If ComboBox1.Text = "Blue" Then
    colour = "Blue"
    End If
    If ComboBox1.Text = "White" Then
    colour = "White"
    End If
    If ComboBox1.Text = "Green" Then
    colour = "Green"
    End If
    If ComboBox1.Text = "Turquoise" Then
    colour = "Turquoise"
    If ComboBox1.Text = "Yellow" Then
    colour = "Yellow"
    End If
    End If
    End Sub

    Private Sub ComboBox2_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox2.SelectedIndexChanged
    If ComboBox2.Text = "Easy" Then
    skilllevel = "Easy"
    End If
    If ComboBox2.Text = "Normal" Then
    skilllevel = "Normal"
    End If
    If ComboBox2.Text = "Pro" Then
    skilllevel = "Pro"
    End If
    End Sub
    Attached Images Attached Images

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured