|
-
Jul 21st, 2004, 10:49 AM
#1
Integer to string [RESOLVED]
I wish to convert an integer into a string. Not just a string representation ( ie "1234") but its actual byte value.
I know its something like 1st byte + 2nd byte * 256 + 3rd byte *64k etc etc, but am trying to see if theres a .net conversion that already exists. I also need to convert it back again after.
Same thing for longs, shorts etc etc..
Any clues ?
Last edited by Grimfort; Jul 21st, 2004 at 11:37 AM.
-
Jul 21st, 2004, 11:37 AM
#2
VB Code:
Dim List() As Byte
'To the byte array
List = System.BitConverter.GetBytes(1234567891011121314)
'Back to the Int64
MsgBox(BitConverter.ToInt64(list, 0).ToString)
-
Jul 21st, 2004, 01:14 PM
#3
I wonder how many charact
VB Code:
[b] MsgBox[/b](BitConverter.ToInt64(list, 0).ToString)
Old Vb6 programmer ALERT!
-
Jul 21st, 2004, 01:55 PM
#4
Originally posted by nemaroller
VB Code:
[b] MsgBox(BitConverter.ToInt64(list, 0).ToString)
Old Vb6 programmer ALERT! [/B]
True, but even MS can't get it right, so how should we?
Over half of the samples I've seen on MSDN (where a messagebox is used) uses MsgBox.
The documentation for MessageBox.Show says that MessageBox is preferred, but I actually read an article once on MSDN where the encouraged using MsgBox instead.
So what to do, what to do....
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
-
Jul 21st, 2004, 03:23 PM
#5
Tis true, Im a VB6 programmer with more .net experience then most, but I still like using MsgBox especially if its just an test .
-
Jul 21st, 2004, 04:17 PM
#6
I wonder how many charact
Well, doesn't matter I guess... other than Messagebox.Show is part of the Windows.Forms library, and I think MSGBOX was the VisualBasic library....
The only benefit from using the Forms library is Messagebox.Show("Something") would work in C#, j#, etc... whereas MsgBox("Something") would not. So maintenance and project collaboration would probably dictate use of MessageBox.
And I was a Vb6 programmer too... and used MsgBox for weeks without realizing what this MessageBox.Show was all about
-
Jul 22nd, 2004, 01:28 AM
#7
Originally posted by nemaroller
And I was a Vb6 programmer too... and used MsgBox for weeks without realizing what this MessageBox.Show was all about
Me too...And I still use MsgBox when I'm only testing, just like you, Grimfort. It's just quicker to use. But if the message is part of the finished app I always use MessageBox.Show.
I think it's just a matter of breaking a habit, and getting used to something new.
And yes you are right, Nemaroller, the MsgBox IS part of the Microsoft.VisualBasic namespace.
I wish I could think of something witty to put in my sig...
...Currently using VS2013...
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|