-
July 16th, 2003, 10:38 PM
#1
Convert string to hex value
Hi,
I'm saving the forecolor and backcolor of my labels to a text file as hex values...
print #1, "lbl1.fc=" & Hex(label1.forecolor)
print #1, "lbl1.bc=" & hex(label1.backcolor)
Therefore, my file would look like
lbl1.fc=80000012
lbl1.bc=FFFFFF
When I read those values back in, how do correctly insert those values to the forecolor and backcolor properties?
The values are (at the moment) read in as a string, so how do I convert them to hex values without changing the value of the value?
I can't say label1.forecolor = hex(80000012) because the number is already hex! I can't convert the string to a long because FFFFFF is not recognised as a number!
Any clues appreciated.
Thanks,
Mark
-
July 16th, 2003, 11:44 PM
#2
Add the prefix "&H" into the string and use the cDec function :
MsgBox cDec("&H" & sStringFromFile)
Busy
-
July 18th, 2003, 08:01 PM
#3
Thanks Threadl! That did the trick!
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
|