Skip to main content
GameDev.net gamedev.net
🔒 Locked

Visual Basic trouble

Started by qSuperTank449 Jun 3, 2003 at 3:45 PM 1 replies 900+ views
Original Post
qSuperTank449
qSuperTank449
Im new to VB so if anyone can help me I would be very grateful You now the text box command well is there a way to display letters instead of numbers cause I cant seem to do it here is my programming Private Sub code_Click() End Sub Private Sub Form_Load() End Sub Private Sub Image1_Click() Completed = Val(hpdisplay.Text) '' Get letter Hp = Completed Picture1.Print Hp; End Sub
Dave Hunt
Dave Hunt
val()''s job is to turn a character into a number. If you just want the letters, don''t use val(). Just use hpdisplay.Text directly.

If you want only the first letter, use left$(hpdisplay.Text,1)

If you want to loop through the letters, use mid$(hpdisplay.Text,currentpos,1), where currentpos represents the current loop index value.
qSuperTank449
qSuperTank449
Thanks mate Im new to this so I easily make mistakes

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.