How to convert GenericValue to Int32

datatypes

#1

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?


How to use read range function to get integer value from excel
#2

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</>


#3

Hello V,

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


#4

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