Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - How to assign a string variable to a plastic variable in VB
How to assign a string variable to a plastic variable in VB
Friend, you can try. You create text, labels, and commands on the form.

Then enter the following code:

Mark t as a string and l as an integer.

Private subcommand 1_Click ()

t = Text 1。 text

L = Val(t)'val is converted to numeric type.

Label 1。 Title = l

End joint

After running, enter a number in the text (requirements: the number entered cannot be greater than 32768, and the reason shaping cannot exceed 32768). At this point, the number you entered in the text is a character.

When you press the command, the val transformation becomes a plastic in the value.

If you enter a non-number in the code, the output after val conversion will be 0.

Well, if you don't understand anything, send me a message.