How to convert GenericValue to Int32

For example,
In my flow chart, I have use input dialog to take integer value.Now I want to validate this field with Decision control.If input is numeric than true else false.
For that I am checking input with GenericValue and put assign activity to convert value in to Int32.
But do not know how to conver it.

Can anybody help please?

Hi,

You can use below commands (VB.Net) in order to convert Generic value to Int :

  • Cint(GenericValue)
  • Convert.toInt32(GenericValue)
  • Integer.TryParse(GenericValue)

e.g.
Cint(test.ToString)
Convert.toInt32(test.ToString)
Integer.TryParse(test.ToString,test)

Regards,
V</>

4 Likes

Hello V,

Thanks for your time to reply.
I have try using “Convert.toInt32(GenericValue)” command.But it returns compilation error.

Hi,

Please append GenericValue variable with “.ToString”

For e.g. if GenericValue variable is InvoiceNum then you can convert as Convert.ToInt32(InvoiceNum.ToString)

Regards,
V

3 Likes