0

Hello guys
i want get one value of my enum and then converted into hex
but i got a warning
Warning 1 Runtime errors might occur when converting 'String' to 'System.IFormatProvider'

for example

Public enum myenum
myvalue =0
end enum

sub mysub()

console.writeline( myenum.myvalue.tostring("X2"))

end sub

How can i do something like this?
also i have one function that return
Return hexvalue.ToString("X2")
is any problem with that?
give me your lights :)

2
Contributors
3
Replies
5
Views
7 Years
Discussion Span
Last Post by __avd
0

Format String can be only "G", "g", "X", "x", "F", "f", "D" or "d".

console.writeline( myenum.myvalue.tostring("X"))
0

Format String can be only "G", "g", "X", "x", "F", "f", "D" or "d".

console.writeline( myenum.myvalue.tostring("X"))

thanks for your reply
yes it works only with "X" parameter but i want 2digits

i find one way to do this like this

[Enum].Format(GetType(myemum),myenum.myvalue , "X").Remove(0, 6)

ugly right??
is any other possible solution?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.