VB .NET change all numbers to hex value

Im gonna try to explain my problem

Originaly I use this structure in my project
Public Structure ParamCar
        Public Alfa As Double
        Public Eta As Double
        Public Mw7P As Double
        Public Z7P As Double
        Public Sg7P As Double
        Public Cf As Double
        Public Kw As Double
        Public Ja As Double
        Public Ya As Double

        Public Nscn As integer
        Public Banderascn As integer
        Public Metdesdob As integer
        Public n As integer
        Public metSg As integer
        Public metTb As integer
        Public metCriticas As integer
        Public metTc As integer
        Public metPc As integer
        Public metomega As integer
        Public ieq As integer

    End Structure

Open in new window


But due a few problems I had to change to
 
Public Structure ParamCar
        Public Alfa As Double
        Public Eta As Double
        Public Mw7P As Double
        Public Z7P As Double
        Public Sg7P As Double
        Public Cf As Double
        Public Kw As Double
        Public Ja As Double
        Public Ya As Double

        Public Nscn As Int16
        Public Banderascn As Int16
        Public Metdesdob As Int16
        Public n As Int16
        Public metSg As Int16
        Public metTb As Int16
        Public metCriticas As Int16
        Public metTc As Int16
        Public metPc As Int16
        Public metomega As Int16
        Public ieq As Int16

    End Structure

Open in new window



Since this change VB 2008 when I debug always show me the numerical numbers  as HEX

In my code no matter what type of data I use  VB always use HEX, you can see that in the following image
example1
As you can see the VB show the value of X as an HEX value, nevertheless X is a integer type not a int16 type

And also when I use the instruction redim, It doesnt change sometimes  the lenght of the prueba array

I dont know if the problem that I have with the instruction redim is related with this problem with the numerical number in VB



altariamx2003Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Jacques Bourgeois (James Burger)PresidentCommented:
That problem does not show in my VS2010 environment, but I think you can solve it simply by using the correct types.

An Integer is not an Int16, it is an Int32.

I am not shure what your "due a few problems I had to change to" were, but I suspect that you come from VB6 and did not know that what was an Integer in VB6 (a 16 bits integer) is a Short in VB.NET. Maybe that is why you had the problem first hand.

Go back to the original code, and change the Integer declarations for Short.

For your information, here is a table showing the changes in the integer types between VB6 and VB.NET:

VB6 -> VB.NET
Byte (8 bits) -> Byte
Integer (16 bits) -> Short (Int 16)
Long (32 bits) -> Integer (Int 32)
(64 bits - new in .NET) -> Long (Int64)


0
altariamx2003Author Commented:
I know that an Integer is not an int16

AS I say  the problem start when I made that change in the structure

After that no matter what type I use VB always show me the numbers as an HEX value

Also I change the variables int16 to short and VB gives me the same result


0
volkingCommented:
I know (a long time ago) VB had the ability to redefine what "INTEGER" meant. You could change it to mean INT16 or INT32 or even INT64. Maybe somehow you have stumbled on that problem?

You might also look at "Option Infer"

Fred
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

volkingCommented:
You might also run to a break point (like your example) then in the IMMEDIATE window type
>? x.gettype()

This will show you what VB "thinks" about X ...

Fred
0
volkingCommented:
Using VB 2008, I started with

        Dim x As Integer
        x = 9

and here's what "MY" VB thinks about x

>? x.gettype()
{Name = "Int32" FullName = "System.Int32"}
    System.RuntimeType: {Name = "Int32" FullName = "System.Int32"}
    Assembly: {System.Reflection.Assembly}
    AssemblyQualifiedName: "System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Attributes: 1057033
    BaseType: {Name = "ValueType" FullName = "System.ValueType"}
    ContainsGenericParameters: False
    DeclaringMethod: {"Method may only be called on a Type for which Type.IsGenericParameter is true."}
    DeclaringType: Nothing
    DefaultBinder: {System.DefaultBinder}
    Delimiter: "."c
    EmptyTypes: {Length=0}
    FilterAttribute: {Method = {System.Reflection.RuntimeMethodInfo}}
    FilterName: {Method = {System.Reflection.RuntimeMethodInfo}}
    FilterNameIgnoreCase: {Method = {System.Reflection.RuntimeMethodInfo}}
    FullName: "System.Int32"
    GenericParameterAttributes: {"Method may only be called on a Type for which Type.IsGenericParameter is true."}
    GenericParameterPosition: {"Method may only be called on a Type for which Type.IsGenericParameter is true."}
    GUID: {System.Guid}
    HasElementType: False
    IsAbstract: False
    IsAnsiClass: True
    IsArray: False
    IsAutoClass: False
    IsAutoLayout: False
    IsByRef: False
    IsClass: False
    IsCOMObject: False
    IsContextful: False
    IsEnum: False
    IsExplicitLayout: False
    IsGenericParameter: False
    IsGenericType: False
    IsGenericTypeDefinition: False
    IsImport: False
    IsInterface: False
    IsLayoutSequential: True
    IsMarshalByRef: False
    IsNested: False
    IsNestedAssembly: False
    IsNestedFamANDAssem: False
    IsNestedFamily: False
    IsNestedFamORAssem: False
    IsNestedPrivate: False
    IsNestedPublic: False
    IsNotPublic: False
    IsPointer: False
    IsPrimitive: True
    IsPublic: True
    IsSealed: True
    IsSerializable: True
    IsSpecialName: False
    IsUnicodeClass: False
    IsValueType: True
    IsVisible: True
    MemberType: TypeInfo {32}
    MetadataToken: 33554627
    Missing: {System.Reflection.Missing}
    Module: {System.Reflection.Module}
    Name: "Int32"
    Namespace: "System"
    ReflectedType: Nothing
    StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}
    TypeHandle: {System.RuntimeTypeHandle}
    TypeInitializer: Nothing
    UnderlyingSystemType: {Name = "Int32" FullName = "System.Int32"}
  

Open in new window


Is your VB type different than the above?
0
altariamx2003Author Commented:
I cannot belive this damn thing

I did what you suggest and VB show me the following information
? x.gettype()
{Name = "Int32" FullName = "System.Int32"}
    System.RuntimeType: {Name = "Int32" FullName = "System.Int32"}
    Assembly: {System.Reflection.Assembly}
    AssemblyQualifiedName: "System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
    Attributes: &H102109
    BaseType: {Name = "ValueType" FullName = "System.ValueType"}
    ContainsGenericParameters: False
    DeclaringMethod: {"Sólo se puede llamar al método en un tipo para el que Type.IsGenericParameter es true."}
    DeclaringType: Nothing
    DefaultBinder: {System.DefaultBinder}
    Delimiter: "."c
    EmptyTypes: {Length=&H0}
    FilterAttribute: {Method = {System.Reflection.RuntimeMethodInfo}}
    FilterName: {Method = {System.Reflection.RuntimeMethodInfo}}
    FilterNameIgnoreCase: {Method = {System.Reflection.RuntimeMethodInfo}}
    FullName: "System.Int32"
    GenericParameterAttributes: {"Sólo se puede llamar al método en un tipo para el que Type.IsGenericParameter es true."}
    GenericParameterPosition: {"Sólo se puede llamar al método en un tipo para el que Type.IsGenericParameter es true."}
    GUID: {System.Guid}
    HasElementType: False
    IsAbstract: False
    IsAnsiClass: True
    IsArray: False
    IsAutoClass: False
    IsAutoLayout: False
    IsByRef: False
    IsClass: False
    IsCOMObject: False
    IsContextful: False
    IsEnum: False
    IsExplicitLayout: False
    IsGenericParameter: False
    IsGenericType: False
    IsGenericTypeDefinition: False
    IsImport: False
    IsInterface: False
    IsLayoutSequential: True
    IsMarshalByRef: False
    IsNested: False
    IsNestedAssembly: False
    IsNestedFamANDAssem: False
    IsNestedFamily: False
    IsNestedFamORAssem: False
    IsNestedPrivate: False
    IsNestedPublic: False
    IsNotPublic: False
    IsPointer: False
    IsPrimitive: True
    IsPublic: True
    IsSealed: True
    IsSerializable: True
    IsSpecialName: False
    IsUnicodeClass: False
    IsValueType: True
    IsVisible: True
    MemberType: TypeInfo {32}
    MetadataToken: &H20000C3
    Missing: {System.Reflection.Missing}
    Module: {System.Reflection.Module}
    Name: "Int32"
    Namespace: "System"
    ReflectedType: Nothing
    StructLayoutAttribute: {System.Runtime.InteropServices.StructLayoutAttribute}
    TypeHandle: {System.RuntimeTypeHandle}
    TypeInitializer: Nothing
    UnderlyingSystemType: {Name = "Int32" FullName = "System.Int32"}

Open in new window


But as you see in the image VB show an HEX value
 example
This is nuts!!
hehehe
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
altariamx2003Author Commented:
I cannot find that windows in 2008, can you send a screen or something like that??
0
altariamx2003Author Commented:
I found it

Thanks a lot for your help

0
CodeCruiserCommented:
Glad to help :-)
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.