Visual Basic trouble

Started by
1 comment, last by qSuperTank449 20 years, 10 months ago
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
Advertisement
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.
Thanks mate Im new to this so I easily make mistakes

This topic is closed to new replies.

Advertisement