Int32 Compiler error

studio

#1

While working on recreating the Guessing Game in the Control Flow video in a sequence instead of a flowchart, for the variable that stores the value entered by the user I defined it as Int32 just as in the flowchart but it gives me an error. It only runs if I leave it as a Generic Value. In the flowchart it works perfectly.

The error reads: Compiler error(s) encountered processing expression “avlueguessed”.Invalid L-value expression.:Reference expressions cannot end with Conversion. The provided expression’s type must exactly match the type T of VisualBasicReference or LambdaReference


#2

Hi, I’m not sure without seeing screenshots or workflow, but I can provide some ideas. You probably need to just convert your variable to an integer when you use it as a number.

For example,
(Cint(variable1)+Cint(variable2)).ToString

You can also use Convert.ToInt32() instead of CInt()

So, then you can use variables that are string or generic values. You can also store the converted value to an integer variable after you extract it from an element if you choose to.

Regards.


#3

Hi…I was not sure how to use it so I in the results box I tried… Convert.ToInt32(my variable)

The box still showed the blue sign with the error, however when I deleted to only show only “my variable”, and now the error is gone…any idea what may have happened?