Skip to main content
gamedev.net
🔒 Locked

vb6 string to hex

Started by BloodLust666 0 replies 650+ views
Original Post
BloodLust666
BloodLust666
I have a file that i read from that says what the forecolor of a button should be, i read that data and in comes in to something like "&H000000FF&", as a string, how do i turn that into hexadecimal or whatever format i need to put it in so i can put it into the ForeColor attribute of my button?
-------------------------Unless specified otherwise, my questions pertain:Windows Platform (with the mindset to keep things multi-platform as possible)C++Visual Studio 2008OpenGL with SFML
NisseBosseLasse
NisseBosseLasse
You could use Val (value):
Dim a as String, i as Integera = "&HFF"i = Val(a)

Val recognizes the "&H", and interpret it as a hexdecimal, returning an integer.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.