Help: Converting short to string (and visa versa)

  • Thread starter Thread starter VB Programmer
  • Start date Start date
V

VB Programmer

How can I do this (both ways)?

I've tried this: MessageBox.Show(Convet.ToString(MyShortVar));

But it fails telling me I have invalid arguments for Show.
 
How can I do this (both ways)?

I've tried this: MessageBox.Show(Convet.ToString(MyShortVar));

But it fails telling me I have invalid arguments for Show.

You might want to check the MessageBox.Show-method in your MSDN lib...
I'm sure you haven't yet...

as far as converting myShortVar to a string:
MyShortVar.ToString();
Convert.ToString(MyShortVar);
(string)MyShortVar;
 
NULL said:
(string)MyShortVar;

This one will fail at compile time - there's no implicit or explicit
conversion (in a language sense) from short to string.

Short.ToString, Convert.ToString, or String.Format are the way to go.
 
Back
Top