By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,986 Members | 2,042 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,986 IT Pros & Developers. It's quick & easy.

Noob simple question

P: 1
I have two text strings that I have read from a text file. The text strings that I have read are the 8 characters each, 859c58d4 and 80434d43. I have assigned them the varible names of string1 and string2.

This text strings in reality represent hex values.

How do I convert these text strings into numerical (long integers perhaps) so that I might subtract one from the other?

Please help a noob trying to learn VB6.

Rich
Jan 26 '08 #1
Share this Question
Share on Google+
3 Replies


daniel aristidou
100+
P: 491
How do I convert these text strings into numerical (long integers perhaps) so that I might subtract one from the other?

Rich
For Converting strings into integers etc we use "Cint(string)"
You can find a list of other "converters" in the object library type in "C" and you should find lots.....i believe there is one for hex
Jan 26 '08 #2

Expert 5K+
P: 8,434
Not sure what the size limits might be, but in the past I have used Val("&h" & String).
Jan 27 '08 #3

werks
100+
P: 220
I have two text strings that I have read from a text file. The text strings that I have read are the 8 characters each, 859c58d4 and 80434d43. I have assigned them the varible names of string1 and string2.

This text strings in reality represent hex values.

How do I convert these text strings into numerical (long integers perhaps) so that I might subtract one from the other?

Please help a noob trying to learn VB6.

Rich

Hi there!

Are you trying to Subtract the Value String1 = 859c58d4 and String2 = 80434d43

You can CInt(string1) - CInt(String2), but the problem is there are alphabetical letters in the strings, so i think it will prompt you an error.. What does c and d do in 859c58d4 (-.-)???


Better Than Yesterday
Jan 27 '08 #4

Post your reply

Sign in to post your reply or Sign up for a free account.