Jump to content
  • Advertisement


This topic is now archived and is closed to further replies.

Dark Ifna

Visual Basic trouble

This topic is 5644 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post

Link to post
Share on other sites
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.

Share this post

Link to post
Share on other sites

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!